Skip to content

feat(workspace): nix-direct direnv CI lane + version-skew hardening - #923

Merged
c-vigo merged 2 commits into
devfrom
feature/854-nix-direct-ci-lane
Jul 7, 2026
Merged

c-vigo merged 2 commits into
devfrom
feature/854-nix-direct-ci-lane

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Description

Closes #854 — the last issue of milestone 0.5. Delivers Part A (a nix-direct
CI lane for direnv-mode consumers) and the live Part B version-skew hardening
items from the CI-glue audit, with a documented boundary for the deferred work.

Type of Change

  • feat -- New feature
  • fix -- Bug fix
  • docs -- Documentation only
  • test -- Adding or updating tests

Changes Made

Part A — nix-direct CI lane (direnv mode)

  • New assets/workspace-direnv/.github/workflows/ci.yml overlay: host runner,
    install-nix + vig-os Cachix substituter (SHA-pinned actions reused from this
    repo's own lane), then nix develop -c just sync|precommit|test. No
    resolve-image, no container: jobs; container-only PREK_HOME /
    UV_PROJECT_ENVIRONMENT env dropped.
  • init-workspace.sh deploys the overlay when DEVKIT_MODE=direnv, mirroring
    the existing bare-mode overlay (managed file, re-applied on upgrade).
  • Documented boundary (docs/MIGRATION.md → "direnv-mode CI"): only ci.yml
    is converted for direnv; prepare-release, promote-release, release*,
    sync-issues, renovate-changelog-build, sync-main-to-dev stay
    container-based and devcontainer-mode-only until the full 13-workflow audit
    rides the devkit rename ([CHORE] Rename devcontainer → devkit (after publish-cutover #639) #781). Container-independent workflows (codeql,
    scorecard, renovate-changelog-commit, release-extension) work in every
    mode.

Part B — version-skew hardening

# Item Status
1 CI-wired prek skew guard Fixed — container ci.yml + direnv ci.yml lint jobs fail fast with an actionable ::error::
2 prepare-release.yml forked awk resolver + silent latest fallback Fixed — unified onto the shared resolve-image action (hard-fail)
3 Old-scaffold + new-image MIGRATION callout Residual closed — CI skew guard tied into the pre-commit→prek upgrade step (bulk already covered by #881/#897)
4 devc-upgrade curls install.sh from main regardless of pin Fixed — reads DEVCONTAINER_VERSION from .vig-os, upgrades to that ref + --version
5 set shell pipefail only in justfile.devc Fixed — moved to the root justfile (SSoT), applies in all modes
6 Stale bandit / pre-commit doc Fixed — docs/container-ci-quirks.md
7 init-precommit.sh hard-codes /workspace/{{SHORT_NAME}} Fixed — derives root from script location
8 Private-image consumers (unauth probe + no credentials:) Documented + deferred — loud limitation note in container-ci-quirks.md; first-class fix filed as #920 (Backlog)

Changelog Entry

Added

  • Nix-direct CI lane for direnv-mode consumers (#854)

Fixed

  • Version-skew hardening for the shipped CI glue (#854)

(Full sub-bullets in CHANGELOG.md; mirror auto-synced to
assets/workspace/.devcontainer/CHANGELOG.md.)

Testing

  • Tests pass locally
  • Manual testing performed (describe below)

Manual Testing Details

  • New bats: direnv/container overlay shape, prek guards, prepare-release
    resolver, devc-upgrade pin honoring, root-justfile pipefail move,
    init-precommit path derivation (RED→GREEN for the script-level changes).
  • Full suites green: init-workspace.bats (108), install.bats (87),
    just.bats (43), init-precommit.bats (4); whole tests/bats/*.bats run
    exit 0 (358 ok, ~10 skipped, 0 failures).
  • just precommit — full hook suite green (exit 0), including shellcheck,
    yamllint, check-action-pins, sync-manifest.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have updated the documentation accordingly
  • I have updated CHANGELOG.md in the [Unreleased] section
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Additional Notes

Deferred item 8 (private-image support) is split to #920 rather than
half-implemented, per the issue's "don't gold-plate" guidance; the limitation is
documented loudly for consumers who pin a private devkit image today.

Refs: #854

c-vigo added 2 commits July 7, 2026 18:02
Part A — nix-direct CI lane for direnv-mode consumers:
- Add assets/workspace-direnv/ overlay with a host-native ci.yml (no
  resolve-image, no container jobs): install-nix + vig-os Cachix substituter
  then `nix develop -c just sync|precommit|test`, reusing this repo's own
  SHA-pinned install-nix/cachix actions and dropping the container-only
  PREK_HOME/UV_PROJECT_ENVIRONMENT env.
- Wire the overlay into init-workspace.sh keyed off DEVKIT_MODE=direnv, same
  managed-file semantics as the bare overlay.
- Document the supported boundary in docs/MIGRATION.md: only ci.yml is
  converted for direnv; the other shipped workflows stay container-based and
  devcontainer-mode-only until the full audit rides the devkit rename (#781).

Part B — version-skew hardening from the CI-glue audit:
1. CI-wired skew guard: container ci.yml and the direnv ci.yml lint jobs fail
   fast with an actionable error when prek is absent.
2. prepare-release.yml resolver unified onto the shared resolve-image action
   (hard-fail) instead of the forked inline awk with a silent `latest`
   fallback.
4. devc-upgrade honors the consumer's pinned .vig-os DEVCONTAINER_VERSION
   (script ref + --version) instead of always curling install.sh from main.
5. `set shell := [...pipefail...]` moved from justfile.devc to the root
   justfile (SSoT) so direnv/bare recipes also get pipefail.
6. docs/container-ci-quirks.md: fix the stale `uv run bandit` pre-commit hook
   reference (prek, not the removed pre-commit binary).
7. init-precommit.sh derives PROJECT_ROOT from the script location instead of
   a hard-coded /workspace/{{SHORT_NAME}}.
3/8. MIGRATION callout ties the CI skew guard into the pre-commit→prek upgrade
   step; the private-image limitation (unauthenticated resolve-image probe +
   missing container credentials) is documented, first-class fix tracked in
   #920.

Tests: bats coverage for the direnv/container overlays, the prepare-release
resolver, devc-upgrade pin honoring, the root-justfile pipefail move, and
init-precommit path derivation.

Refs: #854
nix develop -c runs an executable, not a shell builtin, so
'nix develop -c command -v prek' would always fail; invoke it through
bash -c so the guard detects prek correctly.

Refs: #854
@c-vigo
c-vigo enabled auto-merge July 7, 2026 16:09
@c-vigo
c-vigo merged commit dd0b1f1 into dev Jul 7, 2026
13 checks passed
@c-vigo
c-vigo deleted the feature/854-nix-direct-ci-lane branch July 7, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant