Repository navigation
ci: cancel superseded CI runs per ref - #1604
Merged
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.
Description
The scaffolded
ci.ymlhad noconcurrencyblock, so a force-push or a rapidfollow-up push left the superseded run's every lane — lint, test,
commit-checks, scaffold-drift, summary — running to completion for a commit
that no longer matters. On a hosted runner that is wasted billed minutes; on a
self-hosted consumer with a small fixed slot pool it is worse: the stale run
holds the slots and the replacement run queues behind its own predecessor
(measured 120–250 s per-job queue times on a 3-slot consumer).
Consumers could not fix this themselves —
ci.ymlis a managed file, so ahand-added block fails the
scaffold-driftgate (#1295) on every PR. The fixhas to land here.
Both copies get the block, because they are separate render paths: devkit's own
image-building CI and the mode-aware scaffold consumers receive. #1414 is the
standing proof that a fix landing in one copy only is the likely failure mode.
Type of Change
feat-- New featurefix-- Bug fixdocs-- Documentation onlychore-- Maintenance task (deps, config, etc.)refactor-- Code restructuring (no behavior change)test-- Adding or updating testsci-- CI/CD pipeline changesbuild-- Build system or dependency changesrevert-- Reverts a previous commitstyle-- Code style (formatting, whitespace)Modifiers
!) -- This change breaks backward compatibilityChanges Made
.github/workflows/ci.ymlandassets/workspace/.github/workflows/ci.yml—a workflow-level
concurrencyblock betweenon:andpermissions:(the placement
sync-main-to-dev.yml,release-core.ymlandabandon-release.ymlalready use):tests/test_ci_concurrency.py— new suite, parametrized over both copies,pinning the group shape (per-workflow, per-ref) and the exact cancel
condition.
CHANGELOG.md(+ synced mirror) —Changedentry.Two decisions worth a reviewer's attention
!= 'push', not the== 'pull_request'the issue suggested. Neithercopy triggers on
pushat all — both run only onpull_requestandworkflow_dispatch— so the acceptance criterion "in-flightmainpushruns are not cancelled" is satisfied by construction today. The issue's
conservative form would therefore guard nothing while disabling the one case
the issue explicitly wants cancelled ("a dispatched re-test supersedes the
previous one").
!= 'push'keeps dispatch supersession and still leaves thepush guard standing if a push trigger is ever added.
Existing gate semantics are untouched, and were checked rather than
assumed. A cancelled superseded run cannot green the required check: the
summary job is
if: always()and trips oncancelledfor every needed job([BUG] CI Test Summary passes when a needed job is cancelled #1371/Scaffold ci.yml summary gate does not fail on cancelled required checks #1414). And it cannot refuse a green branch either: all six release-PR
CI gate sites evaluate only the latest run per check name ([FEATURE] release.yml validate: count only the latest check run per name in the CI-green gate #1522), so a
superseded run's entries are outranked. No changes were needed to either.
Changelog Entry
Testing
just test)Manual Testing Details
N/A — the change is a declarative workflow key; GitHub evaluates it, so shape
assertions are the testable surface (the same treatment
nix-image.yml'sconcurrency block gets in
test_workflow_cachix.py). Its live effect isobservable on this PR itself: pushing a follow-up commit should cancel the
run started by the previous one.
Evidence from the local run:
scaffold ci.yml must declare a workflow-level concurrency block (#1602).tests/test_ci_concurrency.py,tests/test_workflow_summary_gate.py,tests/test_ci_green_gate.pyandtests/test_ci_runner.py— 188 passed.identically on a clean
origin/devworktree and are local-environmentartifacts, not regressions:
test_image.py::test_manifest_files— the locally cachedghcr.io/vig-os/devcontainerimage is the 1.13.0 release, so its baked.pymarkdownno longer matches dev's.test_integration.py::test_github_cli_authentication— the hostghconfig needs a keyring;
dbus-launchis absent in the container.test_transforms.py::test_mirror_is_the_source_plus_the_transforms— thechangelog mirror was stale until
sync-manifestregenerated it; greenafterwards, and the regenerated mirror is committed.
just precommitgreen over all files (actionlintandyamllintincluded, both workflows).Checklist
docs/templates/, then runjust docs)CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
arrives through the normal
devkit-upgradeadoption PR.1.14.0milestone yet (onlyBacklogand the closed1.13.0). Worth assigning before merge.Refs: #1602