Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-24.11] workflows/eval: Request reviews from changed package maintainers #370709

Merged
merged 19 commits into from
Jan 11, 2025

Conversation

Currently we need to rely on ofborg requesting reviews from package
maintainers, which takes a while with ofborg's eval queue. Since
recently we're doing faster evaluations with GitHub Actions, which contain all
necessary information to determine reviewers of changed packages the
same way ofborg does. This PR takes advantage of that.

(cherry picked from commit b9d800d)
…ged packages

The handles can change over time and there's nothing guaranteeing the
ones in the maintainer list are up-to-date. In comparison GitHub IDs
never change.

(cherry picked from commit b844cba)
@github-actions github-actions bot added 6.topic: policy discussion 6.topic: continuous integration Affects continuous integration (CI) in Nixpkgs, including Ofborg and GitHub Actions labels Jan 3, 2025
We can reuse the new process-reviewers.json part for requesting
reviews from maintainers.

(cherry picked from commit 0371b7f)
Filters out the PR author and avoids rerequesting reviews from people
that already left a review. In a future commit, this can be expanded to
also avoid requesting reviews from people not in the org

(cherry picked from commit 0ebab0b)
@wolfgangwalther
Copy link
Contributor

We get this in "Eval / Process":

error: cannot evaluate a function that has an argument without a value ('touchedFilesJson')
       Nix attempted to evaluate a function as a top level expression; in
       this case it must have its arguments supplied either by default
       values, or passed explicitly with '--arg' or '--argstr'. See
       https://nixos.org/manual/nix/stable/language/constructs.html#functions.
       at /home/runner/work/nixpkgs/nixpkgs/nixpkgs/ci/eval/compare/default.nix:11:3:
           10|   afterResultDir,
           11|   touchedFilesJson,
             |   ^
           12| }:

Do we need to backport something else as well?

@wolfgangwalther
Copy link
Contributor

Ah, what happens here: The first commit adds the touchedFilesJson argument, but runs the command against the base branch. This can only pass after merging. I assume the original PR failed the same way.

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Jan 3, 2025
@getchoo getchoo added 12.approvals: 2 This PR was reviewed and approved by two reputable people and removed 12.approvals: 1 This PR was reviewed and approved by one reputable person labels Jan 3, 2025
@wolfgangwalther
Copy link
Contributor

Marked as draft until the issues that came up in #370456 are resolved.

@wolfgangwalther wolfgangwalther marked this pull request as draft January 4, 2025 13:54
infinisil and others added 3 commits January 4, 2025 14:55
The ${{ }} syntax is best avoided in scripts. While it wouldn't be a
problem here, let's do this for consistency

(cherry picked from commit ab248be)
Fixes this problem for maintainer-based reviews when the maintainer
didn't yet accept or missed the automated invite:

    gh: Reviews may only be requested from collaborators. One or more of
the users or teams you specified is not a collaborator of the
NixOS/nixpkgs repository. (HTTP 422)

(cherry picked from commit 077007a)
This script assumed to get lowercased input before, but with the
addition of pinging maintainers that's not necessarily true anymore.

Since the checks for prAuthor and already-reviewed-by already lowercase,
make sure to lowercase the handles in the users array, too.

(cherry picked from commit 213dbf1)
@wolfgangwalther wolfgangwalther force-pushed the backport-366046-to-release-24.11 branch from fd28da3 to 58e9df7 Compare January 4, 2025 13:55
Now that we have maintainer reviews as well, be a bit more explicit
about naming.

(cherry picked from commit cf0616f)
This is now re-used for both code owners and maintainers.

(cherry picked from commit ffb0ace)
Odd to have this in the "Tagging pull request" step, which is only about
labels otherwise.

(cherry picked from commit 2e61194)
This makes it easier to add ofborg's request-1-by-1 logic, where failed
requests are OK for edge cases.

(cherry picked from commit 62779fb)
This is to be able to ignore the odd failure for some users, who are
listed as collaborators, but still fail to be requested properly.

(cherry picked from commit 034613f)
This mirrors ofborg for now.

(cherry picked from commit 240c82b)
This is to ensure that the eval summary is still set as commit status,
even when the review requests fail due to too many reviewers.

(cherry picked from commit 3c9794d)
@wolfgangwalther
Copy link
Contributor

We are still working on some things around maintainer reviews, but the current state is still ready to be backported imho. This will already be an improvement to get back maintainer reviews for backport PRs.

@wolfgangwalther wolfgangwalther marked this pull request as ready for review January 11, 2025 11:48
JohnRTitor and others added 5 commits January 11, 2025 14:41
Additionally, no permissions are needed so set it to an empty set
Signed-off-by: John Titor <50095635+JohnRTitor@users.noreply.github.com>
(cherry picked from commit 3ff50a2)
Lock the Ubuntu runner to ubuntu-22.04 to avoid accidental updates [1]
and increase reproducibility.

[1]: actions/runner-images#10636

(cherry picked from commit 2660dd1)
@wolfgangwalther
Copy link
Contributor

I added three more PRs (see description). Those are not directly related to review requests, but this makes it easier to backport other changes in the future.

I left out any changes to the periodic-merge workflows, because those run on a schedule and thus only from the master anyway. But I had to resolve some merge conflicts for those files, so the "check cherry-picks" should turn up red.

@wolfgangwalther wolfgangwalther merged commit 1925ad6 into release-24.11 Jan 11, 2025
18 of 20 checks passed
@wolfgangwalther wolfgangwalther deleted the backport-366046-to-release-24.11 branch January 11, 2025 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: continuous integration Affects continuous integration (CI) in Nixpkgs, including Ofborg and GitHub Actions 6.topic: policy discussion 12.approvals: 2 This PR was reviewed and approved by two reputable people
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants