-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
Avoid rerequesting reviews with the new codeowners mechanism #347592
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with non-substantial nitpicking.
@@ -80,7 +80,7 @@ if ! "$SCRIPT_DIR"/verify-base-branch.sh "$tmp/nixpkgs.git" "$headRef" "$baseRep | |||
fi | |||
|
|||
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, but I moved headRef
before prNumber
because both are related to the PR :)
ci/request-reviews/get-reviewers.sh
Outdated
@@ -32,8 +34,8 @@ log "This PR touches ${#touchedFiles[@]} files" | |||
# remove code owners to avoid pinging them | |||
git -C "$gitRepo" show "$baseRef":"$ownersFile" > "$tmp"/codeowners | |||
|
|||
# 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# 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
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.