Skip to content

Avoid rerequesting reviews with the new codeowners mechanism#347592

Merged
infinisil merged 2 commits intoNixOS:masterfrom
tweag:codeowners-avoid-rerequests
Oct 9, 2024
Merged

Avoid rerequesting reviews with the new codeowners mechanism#347592
infinisil merged 2 commits intoNixOS:masterfrom
tweag:codeowners-avoid-rerequests

Conversation

@infinisil
Copy link
Member

@infinisil infinisil commented Oct 9, 2024

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.

Copy link
Contributor

@philiptaron philiptaron left a 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.


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"
Copy link
Contributor

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:

  1. headRef
  2. ownersFile
  3. baseRepo
  4. baseBranch
  5. prNumber
  6. prAuthor

plus then aligning these names with the names of the variables in the get-reviewers script.

Copy link
Member Author

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 :)


# 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
Copy link
Contributor

Choose a reason for hiding this comment

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

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.
@infinisil infinisil force-pushed the codeowners-avoid-rerequests branch from 7cc6098 to 1ff83b2 Compare October 9, 2024 21:49
@infinisil infinisil merged commit cf952d3 into NixOS:master Oct 9, 2024
@infinisil infinisil deleted the codeowners-avoid-rerequests branch October 9, 2024 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants