Skip to content

Let the review bot label PRs with its verdict - #2260

Open
robhogan wants to merge 3 commits into
mainfrom
pr2260
Open

robhogan wants to merge 3 commits into
mainfrom
pr2260

Conversation

@robhogan

@robhogan robhogan commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Adds verdict labels (Good, Nits, Discuss, Change) for the review bot, and clears them on push.

Changelog: Internal

This lets the review bot label each PR it reviews with its verdict, so the queue can be filtered at a glance: `Auto review: Good` (nothing to change), `Auto review: Nits`, `Auto review: Discuss` and `Auto review: Change`. They join `Auto review: Skipped` on the allowlist, and a review payload swaps one for another. I've created them and applied them to open PRs from their latest reviews.

A verdict only describes the head it reviewed, so a push to the PR now removes it until the next review. That job runs on `pull_request_target`, but only removes labels and never checks out PR code.

Changelog: Internal

Test plan:
`repository_dispatch` workflows only run from `main`, so I ran both jobs against a mocked `github`/`core`/`context`: a push removes only the verdict label and tolerates one that's already gone, a review payload swaps one verdict for another and creates a missing label, a skip removes any verdict label, and unknown labels are still rejected. `actionlint` is clean.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 20, 2026
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Metro review: Looks good

Risk: low · Commit: 429d71a · 1 command run

This PR adds four verdict labels (Good, Nits, Discuss, Change) to the review-post workflow's allowlist. It also adds a pull_request_target synchronize job that removes those labels on every push, and that job never checks out PR code. My previous finding about a pending clear being cancelled is fixed: clear-verdict now has its own per-PR concurrency group, and post checks the head again after adding labels, undoing its verdict labels if the PR has moved. Neither ordering of a push against labeling leaves a label from an older head, and I found nothing else to change.

No findings.

Verified
  • ✅ node -e (load .github/workflows/review-post.yml with js-yaml and compile each job's github-script body as an async function) — The YAML parses. Both the clear-verdict and post scripts compile. The triggers are repository_dispatch[metro-review] and pull_request_target[synchronize].

Not run: I didn't run the workflow on GitHub Actions, so the concurrency-group behavior and the label API calls are checked by reading the code only. I couldn't read the sender script outside this repo to confirm it removes the previous verdict label when a head is re-reviewed. No benchmarks: this is CI-only code. Windows doesn't matter here.

Automated review by Claude. Advisory only: it never approves or blocks, and a maintainer makes the call.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant