Skip to content

Fix release docs reviewer routing - #1124

Open
danbarr wants to merge 3 commits into
mainfrom
fix-release-docs-reviewer-fyi
Open

Fix release docs reviewer routing#1124
danbarr wants to merge 3 commits into
mainfrom
fix-release-docs-reviewer-fyi

Conversation

@danbarr

@danbarr danbarr commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Description

Fixes reviewer-routing regressions introduced by #1111 and exposed by #1120, without adding a PAT or organization-membership permission.

The workflow now treats GitHub's review-request response as the repository-access check and fails closed when GitHub cannot provide a reliable decision:

  • The release owner is always assigned and requested as a reviewer, including when their own commits are classified as non-docs-facing.
  • Each docs-facing contributor is requested directly. If GitHub specifically rejects the request because the contributor lacks repository access, the workflow maps every relevant full commit SHA to its merged upstream PR and requests the human merger as a stand-in.
  • Rate limits, server errors, malformed responses, and transport failures stop reviewer routing instead of being mistaken for access rejection.
  • A rejected docs-facing owner follows the same merger stand-in path as any other docs-facing contributor.
  • If no eligible stand-in can be requested, the PR body provides an explicit manual-routing action without @-mentioning the upstream contributor.
  • An unresolved release owner is counted as a routing issue so the PR cannot report that no action is required.
  • Non-docs-facing contributors are counted without being individually named or notified because they have no review action.
  • A missing, incomplete, invalid, or duplicate contributor classification in REVIEWERS.json falls back to requesting every release contributor.

Reviewer assignment now lives in a focused Python helper instead of inline workflow Bash. Regression tests cover access rejection versus operational API failure, unconditional owner review, docs-facing owner fallback, missing and invalid classification fallbacks, conflicting duplicate classifications, multiple docs-facing PRs, stand-in deduplication, non-docs-facing counts, unresolved owner handling, and unresolved stand-in routing.

Type of change

  • Bug fix (typo, broken link, etc.)

Related issues/PRs

Testing

  • python3 -m unittest discover -s .github/scripts -p 'test_*.py'
  • actionlint .github/workflows/upstream-release-docs.yml .github/workflows/_static-checks.yaml
  • zizmor .github/workflows/upstream-release-docs.yml .github/workflows/_static-checks.yaml
  • npm run prettier
  • npm run eslint
  • npm run build

Submitter checklist

Content and formatting

  • I have reviewed the content for technical accuracy
  • I have reviewed the content for spelling, grammar, and style

Reviewer checklist

Content

  • I have reviewed the content for technical accuracy
  • I have reviewed the content for spelling, grammar, and style

Copilot AI lite review requested due to automatic review settings August 27, 2026 19:07
@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs-website Ready Ready Preview Aug 28, 2026 2:41pm

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the .github/workflows/upstream-release-docs.yml reviewer assignment logic to avoid pinging external (non-collaborator) contributors for “no docs impact” commits, and to add a stand-in reviewer fallback when GitHub rejects review requests for non-collaborator docs-facing contributors.

Changes:

  • Restricts “No docs impact identified” @-mentions to docs-website collaborators; counts external contributors without mentioning them.
  • Adds stand-in reviewer resolution by finding the merger of the upstream PR containing a contributor’s first commit, and requests review from that merger when the contributor can’t be assigned.
  • Extends PR-body augmentation to include stand-in explanations and separate member vs external FYI counts.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/upstream-release-docs.yml Outdated
Use GitHub's review-request result as the repository-access check and route rejected docs-facing contributors to the human mergers of their specific upstream PRs. Keep owner and noisy fallback behavior, avoid contributor pings, and cover the routing cases with tests.
@danbarr
danbarr force-pushed the fix-release-docs-reviewer-fyi branch from 7c238d2 to 71a23f8 Compare August 27, 2026 20:28
@danbarr danbarr changed the title Fix reviewer FYI and stand-in logic in release docs Fix release docs reviewer routing Aug 27, 2026
@danbarr
danbarr requested a lite review from Copilot August 27, 2026 20:32
@danbarr
danbarr marked this pull request as ready for review August 27, 2026 20:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Comment thread .github/workflows/upstream-release-docs.yml Outdated
Comment thread .github/scripts/assign_release_docs_reviewers.py Outdated
Comment thread .github/workflows/upstream-release-docs.yml Outdated

@jhrozek jhrozek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM overall. I found a few routing edge cases worth addressing before this workflow becomes the source of truth for review assignment.

"-f",
f"reviewers[]={login}",
)
return result.returncode == 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

request_review() returns only a boolean, so every nonzero gh api result is handled as though GitHub rejected this contributor's repository access. A secondary rate limit, transient 5xx, or network failure will therefore trigger merger fallback and allow the workflow to succeed with a potentially unrelated reviewer.

Could we preserve the response status here and distinguish an expected reviewer-access rejection from an operational failure? Use merger fallback only for the access-rejection case. For rate limits, 5xx responses, malformed responses, and transport failures, retry where appropriate or fail the routing step so the release cannot report a successful routing decision based on an unavailable GitHub API.

Please add tests for both an access rejection and a transient API failure.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good catch. Fixed in 00746ba. request_review() now treats only GitHub’s specific 422 collaborator-access rejection as recoverable. Other HTTP or transport failures raise ReviewRequestError and fail the routing step. Tests cover both access rejection and a transient 503.

[login for login in selection.non_docs_facing if login != config.owner]
)

for contributor, shas in selection.docs_facing.items():

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This unconditional owner skip leaves a gap when the release owner is also docs-facing: if the owner's direct review request fails above, their SHAs never enter the existing merger-stand-in path. The workflow records an unresolved note even when an eligible human merger exists.

Could we skip the owner here only after their reviewer request succeeds? When it fails and the owner has docs-facing SHAs, route those SHAs through the same commit-to-merged-PR fallback used for other docs-facing contributors. A focused regression test can assert that a rejected docs-facing owner request produces a reviewer request for the eligible merger.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 00746ba. A rejected docs-facing owner now follows the same commit-to-PR-to-merger fallback as other contributors. The regression test verifies that the eligible merger receives the request without leaving an unresolved routing note.

candidates,
commits,
"REVIEWERS.json omitted release contributors: " + ", ".join(missing),
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Repeated contributor records silently overwrite the earlier entry in by_login. A later docs_facing: false record can erase a prior docs-facing SHA list, allowing a malformed REVIEWERS.json to suppress both direct review and merger fallback for that contributor.

Could we detect duplicate candidate logins while validating the artifact and use the existing "request all contributors" fallback? This keeps malformed classification noisy instead of trusting the last record. Please add a fixture where conflicting duplicate entries trigger the fallback.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 00746ba. Duplicate candidate logins now invalidate REVIEWERS.json and trigger the noisy request-all fallback. The new test covers conflicting docs-facing and non-docs-facing records.

f"Release owner `{config.owner}` could not be requested as a reviewer. "
"A docs maintainer must route this review."
)
else:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

An unresolved release owner produces a warning but does not contribute to unresolved_count. The PR body can consequently report Action required: None even though it says a docs maintainer must adopt the unassigned PR.

Could we record absent owner resolution as an unresolved routing outcome, then include it in the existing action-required calculation? Add a test for an app-authored release with no eligible owner, asserting that the rendered release PR requires manual action.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 00746ba. An unresolved owner now creates an unresolved routing outcome and emits unresolved_count=1, which drives the generated PR’s action-required row. Added coverage for that output.

@danbarr

danbarr commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator Author

@jhrozek thanks for the review! I've addressed the items you pointed out.

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.

3 participants