mirror of
https://github.com/Comfy-Org/github-workflows.git
synced 2026-11-05 00:17:37 +00:00
[PR #346] [MERGED] fix(cursor-review): announce a degraded live-head read in dismiss-stale #348
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#348
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/346
Author: @mattmillerai
Created: 10/6/2026
Status: ✅ Merged
Merged: 10/7/2026
Merged by: @mattmillerai
Base:
main← Head:matt/dismiss-stale-live-head📝 Commits (9)
e28d1bafix(cursor-review): announce a degraded live-head read in dismiss-stale648c540Merge origin/main into matt/dismiss-stale-live-head41d497dfix(cursor-review): guard and announce an empty live base too7d4b467fix(cursor-review): make every dismiss-stale annotation mode-accurate9767d4dfix(cursor-review): no payload shape reaches a caller as a traceback7b9e77dMerge origin/main (#345) into matt/dismiss-stale-live-headb2706b7fix(cursor-review): single-line cmd_decide errors; keep a headless read's baseedb1fdefix(cursor-review): treat an edited auto-approval as stale (#347)dc73a0cfix(cursor-review): close the remaining payload-shape escapes in auto-approve📊 Changes
2 files changed (+848 additions, -65 deletions)
View changed files
📝
.github/cursor-review/auto-approve.py(+325 -43)📝
.github/cursor-review/tests/test_auto_approve.py(+523 -22)📄 Description
ELI5
A robot reviewer can approve a pull request, and a separate job withdraws that approval whenever new code is pushed. To decide, that job asks GitHub what the newest commit is — and if the question fails, it quietly falls back to a possibly older answer it was handed, which can withdraw an approval that was perfectly valid. The job still finishes green either way, so nobody could tell. Now it says so out loud.
Motivation
cmd_dismiss_stalewas changed in #342 — fix(cursor-review): judge auto-approval staleness by the reviewed SHA — to compare against the live head rather thangithub.event.pull_request.head.sha, because a queued or redeliveredsynchronizereplays an older head and would withdraw an approval valid for the current one. That change kept a deliberate fallback to the event head when the live read fails, which is the right call: degrading the comparison beats skipping the scan. What it did not do is say anything when that happens. A dismissal on the degraded path succeeds, so the job exits green, and the only two signals a reader gets — a green check and a "dismissed N stale review(s)" line — are identical whether the comparison used the real head or a replayed one. A review thread on #342 raised the underlying asymmetry; this closes the remaining half of it.Provenance
python3 -m unittest discover -s .github/cursor-review/tests -p 'test_*.py'(whattest-cursor-review-scripts.ymlruns): 884 tests OK at the current headcheck_workflow_pins.py,check-org-repo-literals.shandcheck_agents_md.pyare cleanmainReviewer context
--base-reffallback or a fail-closed decision.withdraw_own_approvalshas no unactionable-approval gate after an identity rotation. And a round cap that labelsneeds-human-reviewdoes not withdraw an approval already standing on the same head (the cap path is from #345).lastEditedAt, and an edited approval is always treated as stale.Summary
cmd_dismiss_stalenames both degraded live-head cases: a raisedRuntimeError/ValueError, and a read that returns no head. On either it prints a::warning::with the cause, the repo and PR, the head actually compared against, and whether the base check ran. Both still fall back toargs.head_sha. A read that succeeded but had no head keeps the base it did return.--all-approvals) with no readable head and no event head still withdraws everything rather than going red, and its warning does not claim a head comparison.Noneand announced.""matches no recorded base, so before this it silently withdrew every approval that had recorded one.read_pr,pr_head_base,has_label,list_reviewsand_paginateeither coerce a malformed payload to the empty value the announced fallbacks already handle, or raiseValueErrorinto the caller's error path. A malformed review node now raises instead of being silently dropped. Before this, those shapes escaped everyexceptas a traceback.approve_gateuntrusted, own approvals withdrawn, red.round_reviewsrecognises the "reviewed nothing" banners in a CRLF-stored body.annotation_causeturns every interpolated exception inauto-approve.py's dismiss and withdraw paths into a single-line,%-escaped cause, clamped to 500 characters. That includes the twocmd_decidesites, soDISMISS_PERMISSION_HINTstays inside the annotation.Test plan
unittest + shellcheckjob green on this PRsynchronizewith a readable head produces no warning and dismisses as before🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.