mirror of
https://github.com/Comfy-Org/github-workflows.git
synced 2026-11-05 00:17:37 +00:00
[PR #440] [MERGED] fix(cursor-review): pass Panel integrity on a cancelled run only when a push superseded it #440
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#440
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/440
Author: @mattmillerai
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @mattmillerai
Base:
main← Head:cursor/panel-integrity-skip-cancelled-run-c60d📝 Commits (2)
061a2cafix(cursor-review): skip Panel integrity when the run is cancelled4c51389fix(cursor-review): keep Panel integrity on always(), pass a cancel only after the head moved📊 Changes
5 files changed (+285 additions, -41 deletions)
View changed files
📝
.github/cursor-review/README.md(+12 -2)📝
.github/cursor-review/tests/test_workflow_panel_integrity.py(+187 -15)📝
.github/workflows/cursor-review.yml(+64 -15)📝
README.md(+1 -1)📝
docs/callers/cursor-review.md(+21 -8)📄 Description
ELI5
When a code-review run gets cancelled because someone pushed newer code, the review check no longer shows a confusing red "re-run the failed job". A run cancelled for any other reason, such as a manual cancel, still fails. A required check can't quietly go green when nobody finished the review.
Before
Panel integrityusedif: always() && (…).always()still starts the job aftercancel-in-progresscancels the run. The decision jobs (gate,round-cap,diff-size,preflight,ledger) then reportcancelled, notfailure, and the guard failed the check:That is a false failure when the run was superseded by a newer push. The same red happened when a cancel landed mid-panel, because
consolidate/post-reviewcome backcancelled.After
The job stays on
always(). Skipping it with!cancelled()(this PR's first revision) would be a fail-open:cancelled()is true for every workflow cancel. A manual cancel has no replacement run, and a same-SHA replacement can decline to review. A skipped required check passes, so that skip would hand the head a green completeness gate over an unfinished panel.Instead, a new first step,
Judge a cancelled run, runs only when the run was cancelled and re-reads the PR's live head:superseded. The guard and report steps stand down, so the check is green on a head nobody can merge any more, and required checks are read on the new head.The job's permissions go from
{}topull-requests: readfor that one API read.Fail-closed is unchanged for a run that was not cancelled
failurestill satisfies!= 'success', and the guard still exits 1.timeout-minutesfails closed whichever way GitHub reportscancelled()for it. Either the guard reads itscancelledresult, or the head check finds the head unmoved.max_rounds, over the diff-size cap) still skip.A same-SHA re-trigger under
cancel-in-progress(re-applying the label while a panel runs) still paints the cancelled run red on that SHA, which is the fail-closed side. The replacement run's later result is the one to read. The Blocking gate is untouched and still usesalways().Not in this PR
Two runs a few seconds apart for one event is the caller (or the app delivery) starting the workflow twice. This reusable's concurrency group already cancels the earlier one, which is what stops both panels from posting. Collapsing the duplicate trigger is not something the reusable can do safely; letting both runs finish would post two reviews.
Provenance
Verified:
python3 -m unittest discover -s .github/cursor-review/tests -p 'test_*.py': 1740 tests OK, including the newCancelledRunTest, which runs the step against a stubgh(head moved / unmoved / unreadable / no PR head)check_workflow_pins.pyOKcheck_agents_md.pypassed, shellcheck on the new step's script OK, workflow YAML parsesDeviations:
!cancelled()job skip with an in-job head-moved check, per the review panel's High finding (raised by all six reviewers) that the skip was a fail-open on a manual or same-SHA cancelpull-requests: readinstead of no permissions🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.