mirror of
https://github.com/Comfy-Org/github-workflows.git
synced 2026-11-05 00:17:37 +00:00
[PR #340] [MERGED] feat(cursor-review): opt-in auto-approve by severity threshold #341
Labels
No labels
cursor-review-catalog-drift
groom
groom
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/github-workflows#341
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/github-workflows/pull/340
Author: @mattmillerai
Created: 10/6/2026
Status: ✅ Merged
Merged: 10/6/2026
Merged by: @mattmillerai
Base:
main← Head:matt/cursor-review-auto-approve📝 Commits (3)
5395890feat(cursor-review): opt-in auto-approve by severity threshold87c4541fix(cursor-review): resolve coderabbit review comments6753b2efix(cursor-review): address the auto-approve panel findings and CI📊 Changes
9 files changed (+961 additions, -4 deletions)
View changed files
📝
.github/cursor-review/README.md(+2 -0)➕
.github/cursor-review/auto-approve.py(+427 -0)📝
.github/cursor-review/gate-unresolved.py(+3 -0)➕
.github/cursor-review/tests/test_auto_approve.py(+236 -0)📝
.github/cursor-review/tests/test_workflow_job_isolation.py(+1 -1)📝
.github/cursor-review/tests/test_workflow_ref_guard_parity.py(+1 -1)📝
.github/workflow-pins/tests/test_check_workflow_pins.py(+5 -2)📝
.github/workflows/cursor-review.yml(+204 -0)📝
docs/callers/cursor-review.md(+82 -0)📄 Description
ELI-5
The Cursor review bot can now approve a PR by itself, if a repo turns that on. Each repo picks how bad a finding can be and still get approved (
medium,lowornit). Anything worse gets "request changes" instead. If anything about the review looks unreliable, the bot does nothing and takes back any approval it gave earlier. When new commits are pushed, it also takes its earlier approval back.What changed
approve_max_severity(default''= off) and optional secretAPPROVER_TOKEN..github/cursor-review/auto-approve.pydecideruns as a new last step ofpost-review, the job that already holds the write token and checks out no PR code.continue-on-error, so a refused approval can't make the blocking gate readpost-reviewas "review did not land".post-review.py'srender_code_ref.dismiss-stale-approval: onsynchronize, it dismisses this identity's own auto-approve approvals that aren't on the new head. Rulesets withdismiss_stale_reviews_on_push: falsewould otherwise keep a stale approval valid. A request-changes is left alone: a push starts no new round under a label-triggered caller, so only the next round replaces it.gate-unresolved.py's thread query now also fetches the first commentbody, which is where the severity badge lives.docs/callers/cursor-review.md, plus an input row and a script-table row in the README.Trust model: the decision rests on model output over the PR's own diff, and for
pull_requestevents the input is read from the caller workflow at the PR head. So enabling it makes the approval no stronger than push access. The guide's new Trust model section says this explicitly. Whether to ship with that posture is the owner's call; the two review threads that raised it are still open.Who approves: only
APPROVER_TOKEN's user. There is no fallback to thebot_app_idApp orgithub-actions[bot], and nothing is submitted if the token is unset. Use a dedicated machine user in a code-owner team (on cloud,comfy-standard-approver) with a token scoped to that one repo. The dismiss job holds only that token, and its job token is read-only.Security (documented): a prompt-injected PR can get itself approved, and anyone with push access can enable the input from their own PR or read the token. Both are accepted risks for this feature.
Testing
tests/test_auto_approve.pycovers every rule: threshold validation, approve, request changes, unknown severity, degraded judge, incomplete panel, undelivered or body-only review, moved head, unreadable state, threshold-derived prior-thread gate, withdrawal on an untrusted round, the approvals-only dismissal filter, and markdown sanitising.Provenance
Authored by: agent-work loop
Verified:
python3 -m unittest discoverfor.github/cursor-review/tests(748 OK) and.github/workflow-pins/tests(502 OK, 29 skipped) at the current headcheck_workflow_pins.pyOK.check-org-repo-literals.shOK.check_agents_md.pypasses with 2 warnings.mainlocally: the same suites and lints still pass.Deviations:
dismiss-stale-approvalrobustness gaps (concurrency cancellation, disabled-input cleanup, required-gate wiring) are deferred to a follow-up.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.