You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assign reviewers per-user instead of pre-filtering by collaborator API
Replaces the upfront `gh api repos/X/collaborators/Y` filter with
per-user `gh pr edit --add-reviewer` attempts. Routes GitHub's own
rejection (422) into the mention list instead of relying on our
filter to pre-compute the split.
Why: on PR #759 the collaborator check returned 404 for Stacklok
employees who ARE collaborators via the `stackers` team (push
permission on docs-website) -- `ChrisJBurns`, `jhrozek`, `reyortiz3`,
`tgrunnagle`. Only `rdimitrov` passed, so four reviewers silently
vanished. A local check with a PAT that has read:org confirms all
five are collaborators; the discrepancy appears to be GITHUB_TOKEN
treating team-based access differently at the collaborator endpoint,
though we haven't pinned the exact rule.
The authoritative answer is "will GitHub accept this person as a
reviewer right now" -- asking that question directly (via the
add-reviewer API) avoids the filter being wrong. Each attempt is
independent, so one rejection doesn't kill the batch.
The separate "Add reviewers" step is now redundant -- assignments
happen inline during candidate iteration. Dropped.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
# Exposed for diagnostic visibility in the PR body (e.g.,
456
+
# "Auto-assigned: @alice @bob") and for the next workflow_
457
+
# dispatch retry to know what was attempted.
447
458
echo "list=$ASSIGN_LIST" >> "$GITHUB_OUTPUT"
448
459
{
449
460
echo "mention_block<<MENTION_EOF"
450
461
if [ -n "$MENTION_LIST" ]; then
451
-
echo "Release contributors who aren't collaborators on this repo and so couldn't be auto-assigned as reviewers. Mentioning them so they see the PR documenting their work:"
462
+
echo "Release contributors we couldn't auto-assign as reviewers (review fatigue cap or GitHub rejected the assignment). Mentioning them so they see the PR documenting their work:"
0 commit comments