ci: cancel superseded runs instead of banking one per commit - #496
Merged
Conversation
Push runs to dev/main/prod previously kept one CI and one build run per commit, because cancelling was unsafe: ci.yml classified a push by before..sha, so a cancelled run's files were checked by nothing, ever (two escapes reached dev that way), and a cancelled build left no sha- image. Make cancellation safe instead of avoiding it: a push now classifies as a change to everything, so a replacing run fully covers a superseded one, and ci.yml, build.yml and codeql.yml switch to newest-wins per ref (cancel-in-progress: true). The ref stays in every group so dev/main/prod — the same commit after a fast-forward release — never evict each other, and PRs group by their own merge ref. e2e.yml keeps queueing: two stacks would race the same loopback port. The cost accepted: a docs-only push now runs the full matrix (docs.yml remains the cheap path-filtered gate), and only the newest commit of a merge burst gets images — which is the commit anything would deploy. tests/test_deploy.py pins the pairing: newest-wins keying and classify-everything-on-push must move together. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0161etTkUPyRoUXnHQ8xgKUu
thedancingdeveloper
force-pushed
the
ci/cancel-superseded
branch
from
September 1, 2026 00:52
e99ae0d to
e15a6c8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge bursts previously banked one CI run and one image build per pushed commit on the small self-hosted pool. This makes cancellation safe and then switches to newest-wins:
ci.yml: pushes now classify as a change to everything (PRs keep merge-base classification), which restores the "a replacing run covers a superseded one" property that made cancelling unsafe before — thebefore..shagap that let two failures reachdevis documented in the concurrency comment. Group is per ref,cancel-in-progress: true.build.yml: newest-wins per ref. Only the newest commit of a burst gets images — the commit anything would deploy. Ref stays in the key so fast-forwardeddev/main/prodnever evict each other.codeql.yml: cancel on all events (was PR-only); a whole-tree scan is always covered by its replacement.e2e.ymlunchanged: runs queue because two stacks would race the same loopback port.tests/test_deploy.pypins the invariant pair: newest-wins keying and classify-everything-on-push must change together.Cost accepted: a docs-only push runs the full matrix (
docs.ymlremains the cheap gate), and superseded commits get nosha-image.Verification:
pytest tests/test_deploy.py(79 passed), ruff, YAML parse of all three workflows.🤖 Generated with Claude Code
https://claude.ai/code/session_0161etTkUPyRoUXnHQ8xgKUu