Repository navigation
feat(ci): run a rendered-consumer variant matrix in PR CI - #1803
Merged
Merged
Conversation
The serial loop took 221 s and put the job level with the BATS and flake lanes on the critical path. Also defuse the language-guard cell's expected ::error:: lines so they no longer surface as PR annotations. Refs: #1762
6 tasks done
c-vigo
enabled auto-merge
October 1, 2026 16:36
c-vigo
added a commit
that referenced
this pull request
Oct 1, 2026
…1807) ## Description **Part 2 of 2 for #1762.** This PR is stacked on #1803 (part 1) and targets `feature/1762-consumer-matrix`. **It will be retargeted to `dev` once #1803 merges.** It adds language cells and a flake-evaluation cell to the `Consumer Matrix` job from part 1. **Expected reds:** only the #1800/#1801 cells, as on #1803, until those fixes land on `dev`. **`rust` is a strict expected-fail on #1496.** A scaffolded Rust consumer gets the stock Python `justfile.project`, so `just test` exits 0 without compiling anything. The cell still runs every gate, and is accepted only when: - `test` is its sole failed gate, and - that gate failed with the silent-no-op signal ("`just test` exited 0 but the rust fixture suite never ran"). If the cell passes, it fails ("rust now passes — remove the #1496 expected-fail marker"). If it fails in any other way, it fails. The marker is one entry, `EXPECTED_FAIL[rust]="test #1496"`, next to the cell list, and the summary shows `expected-fail (#1496)`. #1496 now has a comment saying this cell is its acceptance test and that its fix must remove the marker. CI run: https://github.com/vig-os/devkit/actions/runs/36880846330. The only failing cells are `devcontainer`, `trunk`, `ci-runner`, `tag-prefix`, `language-guard` and `features-disabled` (#1801 `exceeds 500 KB`, plus #1800 `too many blank lines` on `features-disabled`). `rust` is `expected-fail (#1496)`. `direnv`, `bare`, `python`, `node` and `direnv-flake` pass. Every other job is green. An earlier run, https://github.com/vig-os/devkit/actions/runs/36878543444, gave the same verdicts. ## Type of Change - [x] `feat` -- New feature - [x] `test` -- Adding or updating tests - [x] `ci` -- CI/CD pipeline changes ## Changes Made - **Fixtures** in `tests/fixtures/consumer/{python,node,rust}/`: a zero-dependency hello world plus one test each. Python uses pytest from a `dev` dependency group. Node uses `node --test` and ships a dependency-free `package-lock.json` so `npm ci` works. Rust uses a `#[test]` in `src/lib.rs`. Each test writes `$CONSUMER_MATRIX_SENTINEL` when it is set. - **Language cells** `python`, `node`, `rust`: - The fixture is copied in as the marker files, then rendered in `bare` mode with `--force`. That is the adoption path for an existing project: no `.vig-os` yet, so nothing is upgraded, and without `--force` init-workspace.sh refuses a non-empty directory. `bare` ships the scaffolded hook config with no mode-specific files, so the result reflects the language and not the mode. - New gates `sync` (`just sync`) and `test` (`just test`), as the consumer's CI runs them. These apply to every cell. - A fixture cell's `test` gate fails if the sentinel was not written. `seed` also checks that the scaffold detected the language into `DEVKIT_LANGUAGES`. - **`direnv-flake` cell:** - `nix flake check` on the rendered flake with `--override-input vigos "path:$ROOT"` (same approach as test-project's "Check downstream flake stub") and `--no-write-lock-file`. - It then builds the dev shell into a profile, and every later gate runs inside it. The shell hook installs the flake-generated `.pre-commit-config.yaml`, so `first-commit` and `precommit` exercise the direnv hooks for the first time. The plain `direnv` cell still skips them. - **Toolchains:** - uv and npm come from the devkit dev shell. - Python is fetched by uv, the same way setup-env provides it. - nix comes from setup-env. - cargo is not in the devkit dev shell, and the rendered Rust recipe never calls it (#1496). Stubbing cargo would hide the defect. - `pyproject.toml`: added `fixtures` to `norecursedirs` so devkit's own pytest does not collect the fixture suite. ## Changelog Entry Two sub-bullets added to the existing `Consumer matrix in devkit PR CI` entry under Added: ``` - Language cells for python, node and rust adopt a zero-dependency hello world (`tests/fixtures/consumer/`) and run `just sync` and `just test`; the fixture test must prove it ran, so a `just test` that silently skips fails - A `direnv-flake` cell runs `nix flake check` on the rendered flake against the PR's own devkit and runs the direnv cell's gates inside its dev shell, so the flake-generated hooks are exercised too ``` ## Testing - [x] TDD: `tests/bats/consumer-matrix.bats` extended first (later also the strict expected-fail verdict: exact match accepted, a passing cell refused, any other failure refused) (cell list, fixture detection, node npm-mapped recipes, the sentinel contract, direnv-flake render shape). It was committed red, then made green by the implementation. - [x] `just precommit` green. - [x] Local run: `python` 6 s, `node` 6 s and `direnv-flake` 22 s, all passing. `rust` red on #1496. ### CI timing Each cell's summary now lists the time of every gate, because the cells run concurrently and their logs are printed afterwards. | | part 1 (#1803, 8 cells) | this PR (12 cells) | | --- | --- | --- | | setup-env | 44 s | 35 s | | cells step | 130 s | 176 s | | Consumer Matrix job | 182 s | 219 s | | slowest other lane | 267 s (BATS) | 284 s (Flake Gates) | | run wall clock | 5m39s | 5m14s | The job still finishes about 65 s before the slowest lane, so **the critical path does not change**, and the flake cell stays in the same job (no separate job is needed). Per-cell times under 12-way concurrency on the 4-vCPU runner: `direnv-flake` 163 s, the both-mode cells 163–176 s, `python`/`node`/`rust` 67–70 s, `bare` 65 s, `direnv` 5 s. The flake cell is not the outlier: the `nix flake check` and dev-shell build reuse the closure setup-env already pulled. Locally, with a warm store and no contention, it takes 22 s. Refs: #1762
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
render_actionlint_optout(assets/init-workspace.sh) deletes the# >>> devkit:actionlint…# <<< devkit:actionlintrange from a rendered.pre-commit-config.yamlwhenDEVKIT_FEATURES_DISABLED=actionlint, but leftthe blank lines flanking the block in place. The two now-adjacent blanks fail
the scaffold's own yamllint (
empty-lines: max: 1) withtoo many blank lines (2 > 1).Type of Change
fix-- Bug fixChanges Made
render_actionlint_optoutnow does the range-delete viaawkinstead ofsed, deferring each blank line's print by one line so it can drop the oneimmediately before the opening sentinel instead of emitting it. Blank-line
runs elsewhere in the file pass through unchanged -- this is scoped to the
one seam the excision creates, not a file-wide collapse. Still a no-op when
the sentinels are absent (the existing
grepguard is unchanged) andidempotent. The temp-file-then-
catwrite preserves the consumer file'smode/inode, same as
splice_lines.grep '# >>> devkit:'):render_release_optout(.devcontainer/justfile.gh) is the only other one,and it already drops its trailing blank line with a dedicated
sed -i '${/^$/d}'pass -- it does not share this defect. No change neededthere.
render is not repaired by a later upgrade. The excision is gated on the
sentinels still being present (
grep -q '# >>> devkit:actionlint'), and analready-excised file has none left, so there is nothing for a later run to
act on. This is noted here rather than pinned by a test: a test asserting
"not repaired" would pin the gap itself as a contract, turning red the day
someone closes it. No fold machinery added for a cosmetic blank-line defect
(unlike Upgrade can't fold hook fixes into a preserved .pre-commit-config.yaml — warn on the pre-#1170 jackdewinter/pymarkdown block #1652's structural folds) -- if you already hit the bug, delete the
one extra blank line by hand; there is nothing else to clean up.
Changelog Entry
Fixed
(#1800)
DEVKIT_FEATURES_DISABLED=actionlintexcised the# >>> devkit:actionlint…
# <<< devkit:actionlintblock from a rendered.pre-commit-config.yamlbut left the blank lines flanking it, so the two ends met as two adjacent
blank lines —
too many blank lines (2 > 1)under the scaffold's own.yamllint(empty-lines: max: 1). The excision now also drops the blankline immediately before the block, scoped to that one seam
later upgrade: the excision is sentinel-gated and the sentinels are
already gone from an already-excised file, so there is nothing new to
trigger on. Fixing the double blank line by hand (or re-adding the hook
and re-running the opt-out) clears it
Testing
tests/bats/init-workspace.bats, run by name --never the full
tests/bats/directory orworktree.bats, per repoconvention)
Manual Testing Details
the actionlint opt-out leaves no double blank line behind (#1800)totests/bats/init-workspace.bats; confirmed it failed againstthe pre-fix code (
bats --filter '#1800' tests/bats/init-workspace.bats).#1660actionlint-opt-out suite (7 tests) and the entiretests/bats/init-workspace.batsfile (313 tests) pass.also runs
yamllint -c "$ws/.yamllint" "$ws/.pre-commit-config.yaml"opportunistically when
yamllinthappens to be onPATH-- it is aprek-managed hook (fetched into prek's own cache), not part of the devkit
dev shell, so it was not available in this run and that branch did not
execute. The blank-line-shape assertion directly encodes the rule
yamllint's
empty-lines: max: 1enforces.just precommit(prek run --all-files) is green end to end.Checklist
docs/templates/, then runjust docs) -- no doc describes this internal rendering detailCHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
None.
Refs: #1800