Repository navigation
ci: split Project Checks into parallel lanes - #1702
Merged
Merged
Conversation
Project Checks is a serial chain of independent blocks. Pin the target job layout before splitting it: - the summary aggregate's `needs:` set becomes the four `project-*` lanes instead of `project-checks`. The set is asserted exactly: under `if: always()` a lane missing from `needs:` is invisible to the aggregate, so a red lane could not block the merge. - the zizmor managed-set gate is read from the `test-project` composite's `runs.steps` (its new home) and the `project-flake` lane must exist to run it. Both fail on the current layout. Refs: #1692
The seven flake gates (Tier 0 nix-fast-build, flake output schema, dev-shell contracts, hooks fidelity + services, capability modules, downstream stub, zizmor audit) lived inline in ci.yml's project-checks job, which has the composite's only caller. Move them verbatim into the composite under a `flake` suite value (each body gains the `shell: bash` a composite step requires) and give the BATS and pytest blocks their own suite values too, so every block can be selected individually without duplicating its body. setup-env's `sync-dependencies` is now derived from the suite instead of being hardcoded: the bats block needs the flake toolchain but never the project venv, since no BATS test executes `uv`. Behaviour is unchanged: the single caller still passes the default `all`, which runs every block in the same order as before. Refs: #1692
Project Checks was the only job on the critical path and a serial chain of independent work: 9m59s on run 36108278820 while every other job finished by 8m37s. Nothing after `setup-env` consumed another block's output, so the chain was the sum of its blocks instead of the longest one. Split it into `project-lint`, `project-tests`, `project-bats` and `project-flake`, each calling the `test-project` composite with its own suite and each carrying the unchanged `workflow_dispatch` gate, so a dispatch of `project` still runs all four. Timeouts are sized per block (10/10/15/25) rather than for the old chain. The critical path becomes setup + the longest block — the BATS lane at ~3m11s plus its 44s setup. The `summary` aggregate fans in over the four lanes: with `if: always()` a job missing from `needs:` is invisible to it, so all four are listed there and each has its own failure/cancelled leg. `skipped` stays tolerated. The zizmor regression gate moved into the composite with the flake block, so WORKFLOW_SECURITY.md now names the lane that runs it. Refs: #1692
A lane that is observed by the summary aggregate but runs no block is green: `needs:` coverage alone does not prove work happened. Pin the static half of that gap — each lane passes the block it is named for, no two lanes pass the same block, and every block the composite guards (bar `all`) is some lane's suite, so a block cannot be implemented with no CI job running it. These pass on the current layout: they pin what the preceding commits built rather than driving it red-first. Mutation-checked instead — pointing `project-tests` at `lint` fails the per-lane pin and the distinctness pin. Refs: #1692
Every block is guarded on an exact `inputs.suite` match, so a typo in a lane
('flakes', 'tests') runs no block at all and the lane reports success — a
silent-pass mode the serial chain could not have. A first composite step now
validates the value and fails with a `::error::` annotation naming it.
Cheap and local: no checkout, no toolchain, so a bad suite fails in seconds
instead of after a dev-shell provision. Verified by running the case arm
directly for each accepted value, an unknown one, and the empty string.
Refs: #1692
10 minutes was sized on the blocks themselves (42s of prek, 1m18s of pytest). The cost the split multiplies is `setup-env`: a flake.lock change that misses Cachix builds the dev-shell in every lane rather than once, so the two short lanes get 15 minutes like the BATS lane. The flake lane keeps its 25. Refs: #1692
The baseline's header told a reader to look for the gate in .github/workflows/ci.yml, where the "Audit managed workflows" step no longer lives; it is in the test-project composite, run by the project-flake lane. The scaffolded copy carries the same change because it is not hand-edited: sync-manifest regenerates assets/workspace/zizmor.yml from this file and only prepends the managed banner, so the root text cannot be corrected without the mirror following. Comment-only, no rule change — consumers see one line of header drift on their next upgrade and no behavior difference. Refs: #1692
Contributor
Author
Verification of the PR's claims on the first CI runRun 36118110737, all 14 checks green,
One observation, not a defect: The AFTER column of the critical-path table in the description is filled from this run. |
This was referenced Sep 25, 2026
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
Project Checkswas the only job on CI's critical path and a serial chain ofindependent work: 9m59s on run
36108278820 while
every other job finished by 8m37s. Nothing after
setup-envconsumed anotherblock's output — prek, BATS, pytest and the nix gates each read the checkout and
the warm dev-shell and nothing else — so the job cost the sum of its blocks
rather than the longest one.
This splits it into four parallel lanes (
Project Lint,Project Tests,Project BATS,Project Flake Gates), each runningsetup-envonce and oneblock, with the
test-projectcomposite as the single source of truth for everyblock body. The critical path becomes setup + the longest block.
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
1. The composite owns every block (
.github/actions/test-project/action.yml).The seven flake gates (Tier 0
nix-fast-build, flake output schema, dev-shellcontracts, hooks fidelity + services, capability modules, downstream stub, zizmor
audit) lived inline in
ci.yml— in the composite's only caller. They moved intothe composite verbatim (each body gaining the
shell: basha composite steprequires) under a new
flakesuite value, and the BATS and pytest blocks gainedtheir own values.
suiteis now a single enum:all | lint | bats | pytest | flake, withallunchanged. Coverage summary + upload are guarded topytest(nothing else produces
coverage.xml) and the prek cache tolint.setup-env'ssync-dependenciesis derived from the suite(
inputs.suite == 'bats' && 'false' || 'true') rather than exposed as a callerinput: the environment a block needs is a property of the block. The bats block
needs the flake toolchain but never the project venv — verified:
init.batsonlyprobes
command -v uv, theuv syncstrings ininit-workspace.batsare heredocpayloads, and
just.bats/init-workspace.batsstub the binary.An unrecognized
suiteis refused by a first, toolchain-free step(
::error::unknown test-project suite '<value>'). Every block is guarded on anexact match, so a typo in a lane (
flakes,tests) would run nothing andreport the lane green — the one silent-pass mode a per-lane split introduces that
the serial chain could not have. The static half of the same gap is pinned in
tests/test_workflow_summary_gate.py: each lane passes the block it is namedfor, no two lanes pass the same block, and every block the composite guards (bar
all) is some lane's suite, so a block cannot be implemented with no job runningit.
I did not add the optional
bats-filesinput that would let a later matrixsplit the BATS lane without touching the composite: it costs a word-splitting
$BATS_FILESand ashellcheck disablefor a split the issue itself says tomeasure first. YAGNI — it is a two-line change when that measurement happens.
2. Four lanes (
.github/workflows/ci.yml).project-lint(15 min),project-tests(15),project-bats(15),project-flake(25 — it keeps the oldchain's budget for a cold-Cachix dev-shell rebuild). The short lanes are sized for
setup-env, not for their block: aflake.lockchange that misses Cachix buildsthe dev-shell in every lane rather than once, so 15 minutes buys that headroom
four times over. Each lane carries the
unchanged
workflow_dispatchgate(
inputs.test-suite == 'all' || … == 'project'), so a dispatch ofprojectstillruns all four, and each keeps its own checkout (a local
uses: ./…is resolvedfrom the workspace before the composite's own checkout runs).
3.
summaryfans in over all four.needs:, the four echo lines and fourfailure/cancelled legs.
skippedstays tolerated. This is load-bearing: withif: always()a lane left out ofneeds:is not merely unchecked, it isinvisible to the only required status check.
4. Docs.
docs/WORKFLOW_SECURITY.mdnamesproject-flakeas the job runningthe zizmor regression gate (that file is hand-written, not generated from
docs/templates/).zizmor.yml's own header pointed a reader at.github/workflows/ci.yml → "Audit managed workflows", where that step no longerlives; it now names the composite step and the
project-flakelane that runs it.That correction could not be confined to the root file:
assets/workspace/zizmor.ymlis not hand-edited —
sync-manifestregenerates it from the root copy and onlyprepends the managed banner, so the hook rewrites the mirror (and fails the commit)
the moment the root text changes. Both files therefore carry the same comment-only
edit; no rule changes, so a consumer sees one line of header drift on their next
upgrade and no behavior difference. Deferring the fix instead would have meant
leaving the pointer wrong in the file a maintainer actually reads.
Archival
docs/issues/*,docs/pull-requests/*and released CHANGELOG entriesthat mention "Project Checks" are left as the historical record they are.
Critical path
setup-envProject Lintjob 1m36sbats -j 4 tests/bats/Project BATSjob 4m08sProject Testsjob 2m14sProject Flake Gatesjob 4m49sProject Flake Gates); BATS lane 4m08s. Whole run 10m46s → 8m58s; the run's path is now build-image 1m49s → Security Scan 6m39s (#1701)Target from the issue: ≤ 5 min for the longest lane on a warm cache — met (4m49s) on run 36118110737.
Changelog Entry
No changelog needed — CI-internal. No consumer-visible artifact changes: nothing
under
assets/workspace/or the image is touched, and the issue's own ChangelogCategory is "No changelog needed".
Testing
just test)just testis left unticked deliberately: it runs the whole oftests/,including
test_image.py/test_integration.py, which need a freshly builtimage and podman and fail off a stale local
:devimage. What ran instead is theselection the
project-testslane itself runs, plus the workflow-shape suites —below.
Manual Testing Details
nix develop --command actionlint— rc 0 over all workflows.nix run nixpkgs#zizmor -- --offline .github/workflows/ci.yml .github/actions/test-project/action.yml— 1 medium, 0 high, same as
dev(the knownartipackedon the composite'sown checkout). The three new lanes only add findings that are already
ignored/suppressed: 42 findings (8 ignored, 33 suppressed) on
dev→ 57(11 ignored, 45 suppressed), identical severity profile.
run:body of the composite shellchecked by hand (shellcheck -x, GHexpressions neutralised) — actionlint does not lint composite-action shells.
All seven moved bodies clean; the only finding is the pre-existing, deliberate
SC2086on$TEST_ARGS.project-testsruns (tests/minusthe 9 heavy Nix/image modules, plus
packages/vig-utils/tests): 1591 passed.tests/test_workflow_*.py): 312 passed.the empty string: rc 0 / rc 1 with the annotation, as intended.
project-testsatlintfails theper-lane pin and the distinctness pin.
nix develop --command prek run --all-files: all hooks Passed, exit 0, treestill clean.
fills the table above.
Checklist
docs/templates/, then runjust docs)CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
Two of the issue's acceptance criteria need correcting.
Rulesets: the criterion assumes a ruleset names
Project Checks. It does not.gh api repos/vig-os/devkit/rulesetsshows Dev protection and Release protectionrequiring only
Test Summary, and Main protection requiringTest Summary+CodeQL Analysis (actions)+CodeQL Analysis (python). The aggregate absorbsthe rename, so no
org-configchange is needed and no aggregate job has to bekept for the check name.
Scope: the criterion says only
.github/**changes. This PR also touchestests/test_workflow_summary_gate.py(the exactneeds:set — deliberately notrelaxed to a subset),
tests/test_workflow_zizmor_baseline.py(the zizmor gatenow lives in the composite) and one line of
docs/WORKFLOW_SECURITY.md. All threeare consequences of the rename, none is a consumer artifact.
Lane: this targets
dev, not the release-neutral lane (#1676) —maindoes notyet carry the
bats -jwrapper from #1690, so the drvPath-identity guard has nomatching base there. It ships with the next train.
Three prose comments still say "project-checks" where the lane is now named —
flake.nix:1221,tests/test_utils.py:459andtests/test_install_script.py:5(the complete live set;
grep -rn project-checksover non-archival files finds noothers). All three read correctly as generic descriptions of "the cheap project
lane", none is a path or a job reference a tool resolves, so they are left out of
this diff rather than widening it further.
Follow-up the issue predicted:
Security Scanis now the whole-run bottleneck(build-image 1m57s → security-scan 6m28s = 8m25s on the same run). Filed as #1701.
Refs: #1692