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

ci/request-reviews: request reviewers 1-by-1 #370857

Merged
merged 5 commits into from
Jan 4, 2025

Conversation

wolfgangwalther
Copy link
Contributor

Requesting reviewers 1-by-1 works around odd failures in edge cases when some reviewers can't be requested, even though they are collaborators.

Should fix / work around #370456 (comment).

First few commits are only some refactors, last commit is the actual change.

Don't know how to test this, seems like I would need to set up more stuff, including a GitHub App etc. in my own fork? Maybe that's easier for you to test, @infinisil?

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

Now that we have maintainer reviews as well, be a bit more explicit
about naming.
This is now re-used for both code owners and maintainers.
Odd to have this in the "Tagging pull request" step, which is only about
labels otherwise.
@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 4, 2025
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Jan 4, 2025

log "Requesting reviews from: $(<"$tmp/reviewers.json")"

if ! response=$(effect gh api \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The one thing this doesn't preserve yet is the effect part here, which implements dry mode, which is used to avoid requesting reviews from code owners for draft PRs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added two fixups to put back the effect part, let me know when they are OK to squash.

This brings up the question: Should we enable DRY_MODE for maintainer requests, too?

Copy link
Member

@infinisil infinisil Jan 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fixups look good to me!

Should we enable DRY_MODE for maintainer requests, too?

Yeah definitely. Will involve mirroring

types: [opened, ready_for_review, synchronize, reopened, edited]
and
# Don't do anything on draft PRs
DRY_MODE: ${{ github.event.pull_request.draft && '1' || '' }}
Could be done in a separate PR though

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just squashed the commits for now, no other changes. Will add the DRY_MODE in a separate PR.

@wolfgangwalther wolfgangwalther force-pushed the ci-request-reviews-1-by-1 branch from 2a66936 to 1526a4b Compare January 4, 2025 14:34
This makes it easier to add ofborg's request-1-by-1 logic, where failed
requests are OK for edge cases.
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.
@wolfgangwalther wolfgangwalther force-pushed the ci-request-reviews-1-by-1 branch from 1526a4b to 034613f Compare January 4, 2025 17:34
@infinisil
Copy link
Member

Copy link
Member

@infinisil infinisil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work, thank you!

@infinisil infinisil merged commit c5eba57 into NixOS:master Jan 4, 2025
24 checks passed
@wolfgangwalther wolfgangwalther deleted the ci-request-reviews-1-by-1 branch January 4, 2025 18:32
@wolfgangwalther
Copy link
Contributor Author

Backport added in #370709.

@wolfgangwalther
Copy link
Contributor Author

wolfgangwalther commented Jan 5, 2025

I probably broke something about preventing mass-pings with code owners, see #371100 for example. (@drupol)

@drupol
Copy link
Contributor

drupol commented Jan 5, 2025

No problem it happen :-)
I have recreated the PR at #371108 should I wait before marking it as ready?

@wolfgangwalther
Copy link
Contributor Author

I have recreated the PR at #371108 should I wait before marking it as ready?

I think that only happened on the change of the target branch. Since the new PR is already targeting staging, you should be good to go. I hope.

@drupol
Copy link
Contributor

drupol commented Jan 5, 2025

OK testing now.

@wolfgangwalther
Copy link
Contributor Author

I probably broke something about preventing mass-pings with code owners

Not related to code-owners, it pinged all the maintainers when changing the target branch without proper rebasing. So the result is kind of the same as with the old code-owners.

This didn't come up before, because the request would just fail with more than 15 reviewers. The 1-by-1 approach in this PR works around that limit.

A quick fix is to add the same limit that ofborg had to limit the number of reviewers added at the same time. I am working on it.

@drupol
Copy link
Contributor

drupol commented Jan 5, 2025

Not related to code-owners, it pinged all the maintainers when changing the target branch without proper rebasing. So the result is kind of the same as with the old code-owners.

The rebase was done correctly, I even took care to move the PR in draft just before doing it.

@wolfgangwalther
Copy link
Contributor Author

The rebase was done correctly, I even took care to move the PR in draft just before doing it.

Yeah, I didn't mean to imply you did something wrong, sorry. The maintainer review requests don't consider draft mode, yet - so that didn't do anything.

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 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants