Skip to content

Fix removal of team review request - #9360

Merged
tlively merged 1 commit into
mainfrom
reviewer-script-fix-remove-team
Nov 7, 2026
Merged

tlively merged 1 commit into
mainfrom
reviewer-script-fix-remove-team

Conversation

@tlively

@tlively tlively commented Nov 7, 2026

Copy link
Copy Markdown
Member

The review assignment script attempted to remove the binaryen-reviewers team review request after selecting a particular team member to assign the review to. But the API call to remove the request was missing the required reviewers field. Fix it.

The review assignment script attempted to remove the binaryen-reviewers team review request after selecting a particular team member to assign the review to. But the API call to remove the request was missing the required `reviewers` field. Fix it.
@tlively
tlively requested a review from a team as a code owner November 7, 2026 00:23

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the GitHub API call in scripts/assign_reviewer.py to include the reviewers[] parameter when removing requested reviewers. However, it also removes the try...except block that handled API call failures. The reviewer correctly notes that removing this error handling makes the script fragile to transient API issues and recommends restoring the try-except block to allow the script to fail gracefully.

Comment on lines +313 to +321
gh_api([
'--method',
'DELETE',
f'repos/{owner}/{name}/pulls/{pr_number}/requested_reviewers',
'-f',
'reviewers[]',
'-f',
f'team_reviewers[]={TEAM_SLUG}',
])

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Removing the try...except block makes the script fragile. If the DELETE request to remove the team review request fails (for example, due to transient GitHub API issues or permission limitations), the entire script will crash with an unhandled subprocess.CalledProcessError. Since the primary action of assigning the individual reviewer has already succeeded, this cleanup step should fail gracefully rather than crashing the script.

Suggested change
gh_api([
'--method',
'DELETE',
f'repos/{owner}/{name}/pulls/{pr_number}/requested_reviewers',
'-f',
'reviewers[]',
'-f',
f'team_reviewers[]={TEAM_SLUG}',
])
try:
gh_api([
'--method',
'DELETE',
f'repos/{owner}/{name}/pulls/{pr_number}/requested_reviewers',
'-f',
'reviewers[]',
'-f',
f'team_reviewers[]={TEAM_SLUG}',
])
except subprocess.CalledProcessError as e:
detail = e.stderr.strip() if e.stderr else str(e)
print(
f'Note: could not remove team review request: {detail}',
file=sys.stderr,
)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'd rather hear loudly about failures, even after the main action has been completed successfully.

@tlively
tlively enabled auto-merge (squash) November 7, 2026 00:53
@tlively
tlively merged commit 3c46cb5 into main Nov 7, 2026
19 checks passed
@tlively
tlively deleted the reviewer-script-fix-remove-team branch November 7, 2026 01:06
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