ci: auto-assign a round-robin reviewer to new PRs#1760
Conversation
New PRs currently land in a shared queue with no named reviewer, so many sit unreviewed. This adds a workflow that requests one reviewer per new non-draft PR, round-robin over the existing AUTHORIZED_USERS roster (pr.number % pool), skipping PRs that already have a reviewer and never assigning the author. Follows the metadata-only pull_request_target pattern from pr-size.yml (needed so fork PRs can be assigned; safe because no PR code is checked out). Also adds a dry-run-by-default sweep script to assign reviewers to the existing backlog of unreviewed PRs.
Package TarballHow to installgh release download pr-1760-tarball --repo aws/agentcore-cli --pattern "*.tgz" --dir /tmp/pr-tarball
npm install -g /tmp/pr-tarball/aws-agentcore-0.24.1.tgz |
|
Claude Security Review: no high-confidence findings. (run) |
Coverage Report
|
|
Claude Security Review: no high-confidence findings. (run) |
| @@ -0,0 +1,67 @@ | |||
| name: Assign PR Reviewer (round-robin) | |||
|
|
|||
| # Auto-assigns one reviewer to each new external PR, so community contributions | |||
There was a problem hiding this comment.
Are there ideas in the comment here that we don't feel like are expressed clearly below in the implementation, if so why?
|
|
||
| // Stateless round-robin: PR number modulo pool size. Deterministic, no state | ||
| // file to keep in sync, and spreads load evenly as PR numbers increase. | ||
| const reviewer = pool[pr.number % pool.length]; |
| @@ -0,0 +1,67 @@ | |||
| name: Assign PR Reviewer (round-robin) | |||
There was a problem hiding this comment.
broader q: is there any prior art you were able to find in your research? Does the strands team have anything?
I'm wondering about what happens if the assigned reviewer isn't available (PTO), or busy with another project. Also is there a clear path to overriding the assigned reviewer here if I want someone else to review?
Also wondering if a no-code solution might be simpler. For example, on-call responsible for external PR review for their week, or we delegate these are part of sprint work.
External PRs currently land in a shared queue with no named reviewer, so many sit unreviewed.
This PR adds a workflow that requests one reviewer per new non-draft PR when the PR author is not in the existing
AUTHORIZED_USERSroster. Reviewers are selected round-robin from that roster. PRs authored by someone inAUTHORIZED_USERSare left unassigned, and PRs that already have a reviewer are skipped.Safety: follows the metadata-only
pull_request_targetpattern frompr-size.yml(needed so fork PRs can be assigned; safe because no PR code is checked out or executed, only PR metadata is read and a reviewer requested).Future work: We can look into adding a CODEOWNERS file and then editing this workflow to make sure the right folks with context are tagged in PRs. I will also be looking into a simple starter system to assignees to get pinged on our slack