ci: cancel superseded CI runs on the same PR/branch - #35
Merged
Conversation
Adds a concurrency group to ci.yml keyed on PR number (or ref for pushes) with cancel-in-progress so rapid successive pushes to a PR don't burn runner minutes on commits that are already superseded. Live run history showed 4 full CI runs (97-241s each) within 7 minutes on the same PR with none cancelled.
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.
What
Adds a
concurrencygroup toci.yml, keyed on PR number (or ref for pushes), withcancel-in-progress: true.Why
Live run history (
gh run list) showed 4 fullCIruns (97s–241s each) within a 7-minute window on the same PR, with none of them cancelled — each rapid push re-ranlint+test+integration-test(the dominant job at ~178s) to completion even though only the last run's result mattered.No workflow in this repo currently defines
concurrency, so this is pure waste on any PR that receives quick follow-up commits (fixups, CI-driven iterations, etc.).Scope
Only added to
ci.yml, the top-level caller —lint.yml,test.yml, andcheck-version.ymlrun as jobs within that same run viaworkflow_call, so cancelling the parent run cancels them too.Not included (checked, didn't qualify)
integration-testahead oftest— it intentionally gates onneeds: testas a fail-fast measure before paying for the expensive sudo/user-creation job; removing that trades cost for latency.Analyze (actions), ~36s) — this is a repo security setting, not a workflow file, so it's out of scope for this change.Validation
yaml.safe_loadconfirms the edited file parses correctly.