Avoid rerequesting reviews with the new codeowners mechanism#347592
Merged
infinisil merged 2 commits intoNixOS:masterfrom Oct 9, 2024
Merged
Avoid rerequesting reviews with the new codeowners mechanism#347592infinisil merged 2 commits intoNixOS:masterfrom
infinisil merged 2 commits intoNixOS:masterfrom
Conversation
9 tasks
philiptaron
approved these changes
Oct 9, 2024
Contributor
philiptaron
left a comment
There was a problem hiding this comment.
Approved with non-substantial nitpicking.
|
|
||
| log "Getting code owners to request reviews from" | ||
| "$SCRIPT_DIR"/get-reviewers.sh "$tmp/nixpkgs.git" "$baseBranch" "$headRef" "$ownersFile" "$prAuthor" > "$tmp/reviewers.json" | ||
| "$SCRIPT_DIR"/get-reviewers.sh "$tmp/nixpkgs.git" "$baseBranch" "$headRef" "$ownersFile" "$prAuthor" "$baseRepo" "$prNumber" > "$tmp/reviewers.json" |
Contributor
There was a problem hiding this comment.
Comment warning: complete nitpicking.
As a matter of order, what makes the most sense to me is:
- headRef
- ownersFile
- baseRepo
- baseBranch
- prNumber
- prAuthor
plus then aligning these names with the names of the variables in the get-reviewers script.
Member
Author
There was a problem hiding this comment.
Done, but I moved headRef before prNumber because both are related to the PR :)
ci/request-reviews/get-reviewers.sh
Outdated
|
|
||
| # Associative arrays with the team/user as the key for easy deduplication | ||
| declare -A teams users | ||
| # Associative with the user as the key for easy deduplication |
Contributor
There was a problem hiding this comment.
Suggested change
| # Associative with the user as the key for easy deduplication | |
| # Associative array with the user as the key for easy de-duplication |
The automation should never rerequest reviews from users that already reviewed the changes, which is what was happening before this change: NixOS#347354 (comment) Also reorder the arguments to make more sense
This makes this codeowner mechanism behave differently than the native one, but there's no other way to avoid rerequesting reviews from teams when a member already reviewed the PR.
7cc6098 to
1ff83b2
Compare
This was referenced Oct 9, 2024
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As a follow-up to #336261, the automation should never rerequest reviews from users that already reviewed the changes, which is what was happening before this change: #347354 (comment)
Furthermore, request reviews from individual team members. This makes this alternate codeowner mechanism behave differently than the native GitHub one, but there's no other way to avoid rerequesting reviews from teams when a member already reviewed the PR.
Things done
This work is sponsored by Antithesis ✨
Add a 👍 reaction to pull requests you find important.