feat(agentic): scaffold Code Review Action trigger (NOP)#13167
Merged
Conversation
Wires up both trigger paths for #13163 -- requesting @openlibrary-bot as a PR reviewer, and @-mentioning it in a PR comment -- staff-gated on both. No review logic yet; posts a placeholder comment confirming the trigger fired so the untested event wiring (review_requested, staff-only issue_comment on a PR) can be verified independently of the review-generation work, which is still blocked on research. Plain actions/github-script, no claude-code-action -- avoids the permission-bypass and ref-resolution-lag issues found in #13161 until real review logic actually needs an LLM.
This was referenced Jul 15, 2026
… and self-authored PRs Splits the scaffold into two workflows: - auto_assign_reviewer.yml: requests openlibrary-bot as reviewer on any non-draft PR that doesn't already have one, opened or moved out of draft. Skips PRs openlibrary-bot itself authored. - code_review_action.yml: fires on review_requested (manual or auto-assigned), on opened/ready_for_review when openlibrary-bot is the PR's own author, and on staff-only @-mentions. Still a NOP placeholder -- no review logic yet. Draft PRs never trigger a review on any path, including a defensive in-job check for the paths whose event payload has no draft field. GitHub rejects requesting a PR's own author as a reviewer (422), so self-authored PRs can't go through the normal request-reviewer path -- code_review_action.yml's own opened/ready_for_review trigger is the direct substitute for that case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Scaffolds the trigger wiring for the Code Review Action (#13163) without the actual review logic, which is still blocked on research (how Copilot structures inline review comments, whether
claude-code-actionsupports the GitHub Review API'scomments[]natively). This lets the trigger paths get verified independently of that work.Does not close #13163 — this is deliberately just the trigger scaffold.
Design
Split into two workflows:
auto_assign_reviewer.yml— requests@openlibrary-botas a reviewer on any non-draft PR (opened, or moved out of draft) that doesn't already have one requested or reviewed. Skips PRsopenlibrary-botitself authored.code_review_action.yml— the actual trigger + (currently NOP) review, reachable via three paths:review_requestedwithopenlibrary-botas the reviewer — covers both a human manually requesting it andauto_assign_reviewer.yml's automated request. No staff check needed here: requesting any reviewer already requires write/triage access on GitHub's side.opened/ready_for_reviewwhere the PR's own author isopenlibrary-bot— see note below.issue_comment@-mention on a PR — open to anyone who can comment, so this path keeps an explicit staff allowlist (mirrorspr_autoresponder.yml/issue_enrichment.md).Draft PRs never trigger a review on any path — checked at the workflow
if:level where the event payload has adraftfield, and defensively re-checked inside the job itself for the one path (issue_comment) whose payload doesn't carry it.Note on self-authored PRs: GitHub's API rejects requesting a PR's own author as a reviewer (
422). So "addopenlibrary-botas a reviewer on its own PR" isn't literally possible —code_review_action.yml's directopened/ready_for_reviewtrigger forpull_request.user.login == 'openlibrary-bot'is the substitute: it skips the reviewer-request step entirely and goes straight to triggering review.Idempotency guard:
code_review_action.ymlchecks for its own<!-- ol-pr-review-bot -->marker before posting, since a PR can reach it through more than one overlapping path (e.g.opened→ auto-assign →review_requested).Testing
pre-commit runpasses on both files.openlibrary-botitself) before building the review logic on top.Related