ci: request CODEOWNERS reviewers on staging-sync PRs#10422
Conversation
GitHub's CODEOWNERS auto-request silently skips PRs opened from an org-owned fork (the staging mirror), even though it fires normally for user forks. The sync workflow's PRs were never getting owners assigned, so branch protection blocked merges with no reviewers in flight. Add a post-send_pr step that parses CODEOWNERS from the PR base branch, matches changed files, and explicitly requests the resulting teams and users via `gh pr edit --add-reviewer`. Chunked at 15 to respect the request-reviewers endpoint cap. Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
|
clang-tidy review says "All clean, LGTM! 👍" |
System Python on ubuntu-latest is PEP 668 externally-managed, so the bare `pip install pathspec` failed the new CODEOWNERS-request step with `externally-managed-environment`. Create a venv under /tmp and install into it instead. Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dead22978d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
clang-tidy review says "All clean, LGTM! 👍" |
1 similar comment
|
clang-tidy review says "All clean, LGTM! 👍" |
`gh pr edit --add-reviewer` runs a GraphQL query that touches team
login/name/slug fields, all of which require read:org. Our tokens
have repo+workflow but not read:org, so the step fails with "Your
token has not been granted the required scopes."
Switch to POST /repos/{owner}/{repo}/pulls/{n}/requested_reviewers,
which only writes and works with the existing pull-requests:write
scope. Send team_reviewers (bare slug, not org/slug) and reviewers in
separate arrays, each chunked to 15.
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
4a7fcea to
6cdf883
Compare
|
clang-tidy review says "All clean, LGTM! 👍" |
|
This is a ugly hack to workaround what appears to be an undocumented GitHub limitation. I've filed a ticket but in the meantime this should generate reviews for the PII use case. The ordinary user fork works fine already. |
0d2df95
into
The-OpenROAD-Project:master
GitHub's CODEOWNERS auto-request silently skips PRs opened from an org-owned fork (the staging mirror), even though it fires normally for user forks. The sync workflow's PRs were never getting owners assigned, so branch protection blocked merges with no reviewers in flight.
Add a post-send_pr step that parses CODEOWNERS from the PR base branch, matches changed files, and explicitly requests the resulting teams and users via
gh pr edit --add-reviewer. Chunked at 15 to respect the request-reviewers endpoint cap.