Repository navigation
ci(cachix): make image-closure Cachix push first-class and blocking - #789
Merged
Merged
Conversation
Make the devcontainer image-closure push to the vig-os Cachix cache first-class and blocking on the trusted paths so published images are guaranteed cache-backed and consumers substitute the closure instead of rebuilding from source. - build-image composite: new opt-in `push-image-closure` input (default false) plus a blocking `nix path-info --recursive | cachix push` step, guarded on the input and a non-empty auth token so per-PR CI stays pull-only and fork PRs (no secret) never fail. - release build-and-test opts in (`push-image-closure: 'true'`) so released images are cache-backed; the vulnix-gate now also pushes the `devcontainerImageEnv` scan-target closure. - nix-image discovery build pushes the per-arch image closure as a blocking step (distinct from the non-blocking GHCR tag push). Refs: #776
State that published images are guaranteed cache-backed via the blocking image-closure push on the trusted paths: a new "Image closures are cache-backed too" section in docs/NIX.md, a note on the reproducibility principle in docs/CONTAINER_SECURITY.md, and a CHANGELOG entry. Refs: #776
This was referenced Jul 1, 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.
Summary
Makes the devcontainer image closure push to the
vig-osCachix cachefirst-class and blocking on the trusted paths (push to
devand releases),so published images are guaranteed cache-backed and consumers substitute the
pinned closure instead of rebuilding it from source. Previously the image
closure only reached the cache incidentally (a non-blocking, discovery-only side
effect of
cachix-action).Changes
.github/actions/build-image/action.yml— new opt-inpush-image-closureinput (default
false) plus a blockingnix path-info --recursive ./result | cachix pushstep, guarded on the flag and a non-empty auth token, soper-PR CI stays pull-only and fork PRs (no secret) never fail.
.github/workflows/release.yml—build-and-testopts in(
push-image-closure: 'true') so released images are cache-backed; thevulnix-gatenow also pushes thedevcontainerImageEnvscan-target closure..github/workflows/nix-image.yml— the discovery build pushes each per-archimage closure as a blocking step (distinct from the still-non-blocking GHCR
discovery tag push).
docs/NIX.md,docs/CONTAINER_SECURITY.md,CHANGELOG.md— document thecache-backed-published-image guarantee.
tests/test_workflow_cachix.py— YAML-shape tests asserting the closurepush exists, is blocking (no
continue-on-error) on the trusted paths, and isopt-in (so per-PR CI stays pull-only). TDD: added RED first, then GREEN.
Push-gating decision
Gated the new explicit push on an opt-in
push-image-closureinput (plus atoken-presence guard), rather than on token presence alone. Token-presence alone
would make internal-branch PR CI push on every run (internal PRs carry the
secret), violating "keep per-PR CI pull-only"; the explicit flag gives precise
control — only the trusted callers opt in. The token guard is belt-and-suspenders
so a trusted path without a token (or a fork) never fails.
Verification
pytest tests/test_workflow_cachix.py— 4 passed.pre-commitran on every commit (yamllint, ruff, pymarkdown, action-pin check,agent-identity guard, manifest sync) — all passed.
guarantee is asserted structurally by the new tests and by yamllint/action-pin
checks.
actionlintis not wired into this repo's pre-commit, so it was not run.Refs: #776