Cancel superseded CI runs with a concurrency group - #23
Merged
Conversation
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.
Adds a
concurrencygroup tobuild.yml,docs.ymlandpr-checks.yml, andworkflow_dispatchto the first two. Mirrors howjax_fdmarranges the same workflows.Why
Triggers were already scoped correctly — both workflows fire on
pushtomainandpull_requestagainstmain, and no run in recent history came from a push to a feature branch. What was missing is cancellation of superseded runs.phase-2shows the cost: pushing to the branch while checks were running produced threebuildruns, threedocsruns and twoverify-pr-checklistruns, of which only the last of each mattered. With this, that becomes one of each.How
Pull request events share a group per branch, so a new push cancels the run it supersedes. Every other event gets a run-unique group via
github.run_idand never cancels, so a stuck run cannot hold up a push tomainor a release tag.pr-checks.ymlispull_request-only, so it takes the simpler unconditional form.Deliberately unchanged
The
dev-docsjob keeps its own job-levelconcurrency: {group: dev-docs, cancel-in-progress: false}. That one serialisesgh-pageswrites so two merges cannot race on the same branch, which is a different concern from cancelling superseded runs — the workflow-level group never cancels a push event anyway.No change to which events trigger CI.