Repository navigation
fix(ci): run scaffold drift through nix in direnv mode - #1870
Merged
Merged
Conversation
gerchowl
added a commit
that referenced
this pull request
Oct 12, 2026
…1873) ## Summary In direnv mode `install.sh` (fresh scaffold and `--force` upgrade) and `devkit-upgrade.yml` no longer need docker/podman. `install.sh` skips runtime detection and runs the pinned `init-workspace.sh` on the host from the devkit flake source (`nix flake metadata` -> `assets/`, image bake steps replayed, scratch dir removed) — the same replay as the #1870 drift check. `devkit-upgrade.yml` drops `--docker` when `.vig-os` says `DEVKIT_MODE=direnv`. devcontainer/both/bare keep the image path unchanged. - direnv mode is taken from `--mode direnv` or the persisted `DEVKIT_MODE`; it requires an exact `--version <tag>` (`latest` is refused) and nix, jq and rsync on PATH. - Files are created as the invoking user, so the ownership-repair container step is skipped. - Known limitation: the installer comes from the target release tag, so a repo's automated upgrade becomes container-free once its target release ships this `install.sh`. ## Proof Container-free run with docker/podman absent from PATH, in a scratch repo with `DEVKIT_MODE=direnv`: `install.sh --version 1.18.0` scaffolded the workspace; after committing, `--force` left `git status` clean. Tests: `tests/test_install_direnv_host.py` (dry-run plans, container modes unchanged, executed scaffold + upgrade with docker/podman stubs that fail on any call, `latest` refusal) and `tests/test_workflow_devkit_upgrade.py`. Refs: #1871 ## Cost and coverage notes - `nix develop` of the pinned release adds about 3.8 s warm (1.18.0, store populated; measured once). A cold run additionally fetches the dev-shell closure from the binary cache and was not measured. - The direnv smoke lane now installs Nix before the scaffold, so the release gate no longer runs the toolchain composite's install-nix branch; consumer CI on hosted runners still does.
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
In
DEVKIT_MODE=direnv,Scaffold Driftdiddocker login/pull/run, so a strictly direnv-only repo still needed a container runtime. Now the job (direnv only) provisions nix via the shared toolchain preamble, fetches the pinned devkit flake source (nix flake metadata), replays the image's two bake steps ({{IMAGE_TAG}}stamp, VERSION file), runsbash init-workspace.sh --force --no-promptsagainst a scratch clone underRUNNER_TEMP(removed on exit; no container, no root-owned files) and diffs exactly as before. devcontainer/both/bare keep the container path unchanged.rsyncis added to the dev-shell tools.Deviation from the brief:
nix run …#installcannot be used —install.shitselfdocker|podman runs the image, so it is not container-free. The scaffold is run directly from the flake source instead.Parity (local, darwin, GNU tools): scratch clone of gerchowl/claude-config @ dev (6d6ef67, devkit 1.18.0, direnv): exit 0 "No scaffold drift detected"; after committing a hand edit to SECURITY.md: exit 1 "Scaffold drift detected" with the diff; scratch dir removed both times.
Docker/container audit of rendered workflows:
container:jobs use the resolved image (empty in direnv, so inert); resolve-toolchain's docker login/manifest probe only runs when an image is resolved (container modes);setup-devkit-toolchainonly filters podman out of PATH. Still docker in direnv mode:devkit-upgrade.yml(install.sh --docker) — not changed here, needs its own issue.Type of Change
fixChangelog Entry
Fixed
Testing
tests/test_scaffold_drift.py: gating/no-docker pins plus an executed clean→drift behavior test (nix stubbed to this repo); 17 passed.
Refs: #1861
Known limitation: the drift step relies on
rsyncfrom the consumer's dev shell; a consumer whoseflake.lockpredates this change on a NixOS runner getsrsync: not founduntil it upgrades.