Repository navigation
Description
Chore Type
CI / Build change
Description
The scaffolded ci.yml has no concurrency block. A force-push or rapid
follow-up push leaves the superseded run's jobs queued or running to
completion — every lane (lint, test, commit-checks, scaffold-drift, summary)
finishes for a commit that no longer matters.
On a hosted runner that is wasted billed minutes; on a self-hosted runner
with a small fixed slot pool it is worse — the stale run's jobs occupy slots
and the replacement run queues behind its own predecessor. Measured on a
3-slot self-hosted consumer, per-job queue times reach 120–250 s under exactly
this kind of burst contention.
The gap is scaffold-internal inconsistency as much as cost: consumers cannot
fix it themselves, because ci.yml is a managed file — a hand-added
concurrency block fails the scaffold-drift gate (#1295) on every PR. The
fix has to land here.
The summary gate is already prepared for it: since #1371, a needed job that
resolves without a verdict (explicitly including "concurrency cancel") trips
the gate red rather than passing silently, so cancel-in-progress on
superseded runs composes with the existing semantics instead of fighting them.
Proposed change
Add to assets/workspace/.github/workflows/ci.yml (and devkit's own copy, if
they are separate render paths):
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: trueNotes:
- Keying on
github.refgroups per-branch: a PR's superseded run is
cancelled,mainpushes cancel oldermainruns. If cancelling in-flight
mainruns is unwanted (e.g. a consumer gates deploys on the exact-commit
run), gate it:cancel-in-progress: ${{ github.event_name == 'pull_request' }}.
That conservative form is probably the right default for a scaffold that
cannot know its consumers'main-run semantics. workflow_dispatchre-runs of the same ref share the group; that is the
desired behaviour (a dispatched re-test supersedes the previous one).
Acceptance Criteria
- Scaffolded
ci.ymlcarries aconcurrencyblock; superseded
pull_requestruns are cancelled - In-flight runs for
mainpushes are NOT cancelled by a newer push
(deploy gates on exact-commit CI green must stay satisfiable) - A cancelled superseded run cannot green the summary gate ([BUG] CI Test Summary passes when a needed job is cancelled #1371
semantics unchanged) - Consumers pick it up via the normal adoption PR; no consumer-side edit
Implementation Notes
One block plus a scaffold test asserting its presence and the
pull_request-only cancel condition. check-style per-repo workflows outside
the scaffold already do this individually; this closes the gap for the managed
workflow every consumer shares.
Activity
test(ci): pin the CI concurrency group and cancel condition
ci: cancel superseded CI runs per ref
docs: record the CI concurrency change in the changelog
ci: cancel superseded CI runs per ref (#1604)
c-vigo commentedon Sep 2, 2026
Shipped to
devin #1604 (merge commit61416cad), TDD in three commits.Both
ci.ymlcopies now carry:Both, 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 here.
Acceptance criteria
ci.ymlcarries aconcurrencyblock; supersededpull_requestruns are cancelledmainpushes are NOT cancelled by a newer pushsemantics unchanged)
One deviation from the proposed change
The issue suggested gating the cancel as
cancel-in-progress: ${{ github.event_name == 'pull_request' }}, on thereasoning that a scaffold cannot know its consumers'
main-run semantics.That turned out to guard nothing: neither copy triggers on
pushat all —both run only on
pull_requestandworkflow_dispatch— so the thirdcriterion above is satisfied by construction, not by the condition. The
proposed form would have bought no protection while disabling the one case the
issue explicitly wants superseded ("a dispatched re-test supersedes the
previous one").
!= 'push'keepsworkflow_dispatchsupersession and still leaves the guardstanding if a
pushtrigger is ever added, so a deploy gating on theexact-commit CI run stays satisfiable.
Gate interactions, checked rather than assumed
Cancellation touches two existing gates, and neither needed changing:
if: always()and setsFAILED=trueoncancelledfor every needed job, in both copies. Acancelled superseded run therefore reports FAILURE, not green — the third
criterion holds without new code. Pinned in
tests/test_workflow_summary_gate.py.entries stay attached to the same head SHA and could refuse a branch that is
actually green. All six gate sites already group
statusCheckRollupby checkname and take
max_by(.startedAt), so the live run outranks the cancelledone. Pinned in
tests/test_ci_green_gate.py.Verification
New suite
tests/test_ci_concurrency.py, parametrized over both copies,pinning the group shape (per-workflow, per-ref) and the exact cancel condition.
RED first — 4/4 failing on
scaffold ci.yml must declare a workflow-level concurrency block (#1602)— then green. PR CI: 12/12 pass,mergeStateStatus: CLEAN.Reaches consumers through the normal
devkit-upgradeadoption PR once thislands in a release. Note the issue was not milestoned: there is currently no
open version milestone (only
Backlogand the closed1.13.0).chore: release 1.14.0 (#1612)