improvement(ci): promote superseded first-attempt runs forward#5713
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview That fixes the case where commit A passes the gate but was superseded by B, and B fails—previously neither run moved deploy tags; now A can promote forward. Re-runs ( Reviewed by Cursor Bugbot for commit 80c5dbd. Configure here. |
Greptile SummaryThis PR changes how CI promotes mutable deployment tags when a run is superseded. The main changes are:
Confidence Score: 5/5No additional blocking issue was found for this follow-up.
Important Files Changed
Reviews (3): Last reviewed commit: "fix(ci): grant contents:read to create-g..." | Re-trigger Greptile |
The stale-promotion guard skipped any run whose commit was no longer the branch head. If commit A passed its gate but was superseded mid-run by commit B, and B then failed tests, A's promotion was skipped and the deploy tags stayed on pre-A code with no automatic recovery (Cursor finding on #5712). A first-attempt run promoting an ancestor of the branch head is always a forward deploy — runs on a ref are serialized by the concurrency group, so nothing newer can have promoted first. Only re-runs of superseded commits (a rollback attempt) and force-pushed-away commits are skipped. Same semantics applied to the GHCR latest-tag guard.
291b052 to
6271781
Compare
|
@cursor review |
…-API guard Job-level permissions replace the workflow defaults, so packages:write alone left the guard's compare call 403ing — STATUS=unknown would have silently skipped the GHCR latest tags on every main push.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 80c5dbd. Configure here.
Problem
Cursor Bugbot finding on #5712 (discussion): the stale-promotion guard skips moving deploy tags whenever the run's commit is no longer the branch head, assuming the newer run will promote. But if commit A passes its gate and was superseded mid-run by commit B, and B then fails lint/tests/migrate, B never promotes — and A was skipped too.
latest/stagingstay on pre-A code with no automatic recovery until another push.Fix
Sharpen the guard from "head only" to "monotonic forward":
ci-<ref>concurrency group serializes runs per branch, so a superseded first-attempt run executes before its successor — nothing newer can have promoted first.run_attempt > 1) of a superseded commit → skip with a warning. This is the actual rollback hazard the guard exists for: re-running an old run must not retag deploy tags back to stale code.Same semantics applied to both guards (
promote-imagesECR deploy tags,create-ghcr-manifestsGHCR latest tags). Immutable sha/version tags remain ungated by the guard, as before.Failure-mode table