Repository navigation
ci(setup): unify CI on flake provisioning, drop the ad-hoc uv pin - #801
Conversation
The setup-env composite action carried two provisioning paths behind a provision-via-flake toggle: a flake path (used by the image/test jobs) and an ad-hoc path (astral-sh/setup-uv + setup-python + curl-taplo + just + bats) used by the lightweight security and release-orchestration jobs. The ad-hoc path hardcoded a second uv version (0.11.23) that had to be kept in lockstep with the flake's overlaid pkgs.uv.version — the drift #720 was filed to guard. Resolve it by deletion rather than by automating a sync: make setup-env flake-only (always install Nix + Cachix and enter the dev-shell), so CI and local `nix develop` run the identical toolchain from a single source (flake.lock). The provisioned uv version now flows solely from the flake; the literal pin is gone. - setup-env: remove the provision-via-flake toggle and the ad-hoc install steps; drop the now-dead install-python/python-version/install-just/ install-taplo/install-bats inputs and the unused uv-version output; keep the host-integration steps (podman, Node.js, devcontainer CLI). - Convert every remaining ad-hoc caller (ci.yml security jobs, prepare-/ promote-/release orchestration) to the shared action and wire the warm vig-os Cachix cache (vars.CACHIX_CACHE / secrets.CACHIX_AUTH_TOKEN). - security-scan.yml scan-nix-image: drop its duplicate direct Nix/Cachix setup and route provisioning through setup-env (no double install). - Docs/CHANGELOG updated. Non-testable CI config: no unit test; validated with yamllint + check-action-pins and verified green in CI. Refs: #720
CI performance cost — measured, and why we're not optimizing furtherComparing this PR (flake provisioning) against the same
The cost is a flat ~+45s per converted job, entirely in the
Two costs, and they diverge:
All numbers are warm-cache. A cold cache (e.g. right after a "Lighter CI shell" option — evaluated and declinedThe 41s pulls the full 27-tool dev-shell ( Not pursuing it. It's a billing optimization (not wall-clock), and it would re-add a |
Summary
Closes the version-drift #720 was filed for — but by deletion rather than by automating a sync.
Investigation showed CI already provisioned the toolchain from the flake for the image/test jobs (
setup-env'sprovision-via-flakemode). The drift lived only in the other mode: the ad-hoc path hardcoded a seconduvversion (0.11.23) that had to be kept in lockstep with the flake's overlaidpkgs.uv.version. (Concretely, they had already drifted — the flake currently resolvesuv 0.11.19.)This makes
setup-envflake-only: every job installs Nix + Cachix and enters the dev-shell, so CI and localnix developrun the identical toolchain from a single source (flake.lock). The literal pin is gone; theuvversion now flows solely from the flake.Changes
setup-envaction — remove theprovision-via-flaketoggle and the ad-hoc install steps (astral-sh/setup-uv×2 with the0.11.23pin,actions/setup-python,taiki-e/install-actionfor just, the taplo curl,bats-action); drop the now-deadinstall-python/python-version/install-just/install-taplo/install-batsinputs and the unuseduv-versionoutput. Keep the host-integration steps (podman setuid, Node.js, devcontainer CLI) and theUV_PYTHON_DOWNLOADS_JSON_URLforwarding that pre-commit's manylinux hooks depend on.provision-via-flake/tool flags now provided by the flake; the lightweight ad-hoc callers (ci.ymlsecurity jobs,prepare-/promote-/release.ymlorchestration) are wired to the warmvig-osCachix cache.security-scan.ymlscan-nix-image— drops its duplicate direct Nix/Cachix setup and routes provisioning throughsetup-env(no double install; DRY).NIX.md) + CHANGELOG updated.Net
+71 / −227.Trade-off (accepted)
The lightweight security/release jobs now pull the warm Cachix closure instead of a ~5 s
uvdownload, and the release-orchestration pipeline gains a dependency on Nix + the Cachix cache (mitigated: the closure is already warmed bynix-cachix.yml/build jobs, andcache.nixos.orgis a fallback substituter).Verification
grepfor0.11.23/provision-via-flake/ removed inputs → clean across.github.pre-commitgreen on changed files (yamllint,check-action-pins,pymarkdown, agent-identity).ci.ymljobs (python-security,security-scan,dependency-review) — confirm they hit the warm cache.prepare-/promote-/release.ymllegs are event-gated (tags/release/dispatch) and cannot run on a feature-branch PR; they are verified structurally (identical shared action + YAML) and should be watched on the next release.release.ymlvulnix-gateuses the same flake path already proven inbuild-and-test.Notes
Non-testable CI config (no unit test; noted per the TDD standard). Downstream follow-up: #779 (flake-checks as CI Tier 0) is the natural next step once #791 lands.
Refs: #720