Skip to content

refactor(ci): collapse per-mode ci.yml overlays into one mode-aware workflow - #1005

Merged
c-vigo merged 4 commits into
feature/988-mode-aware-scaffoldfrom
feature/991-ci-mode-aware
Jul 13, 2026
Merged

c-vigo merged 4 commits into
feature/988-mode-aware-scaffoldfrom
feature/991-ci-mode-aware

Conversation

@c-vigo

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

Copy link
Copy Markdown
Contributor

Summary

Part A of #991: collapse the three per-mode ci.yml overlays (container /
direnv / bare) into one mode-aware workflow, built on the composites
merged in #1002 and the Option A verdict of
docs/rfcs/ADR-conditional-container-toolchain.md.

A leading resolve-toolchain job reads .vig-os and outputs the delivery
mode, container image, and image-tag. Every downstream job declares
container: image: ${{ needs.resolve-toolchain.outputs.image }} — the
devcontainer image in container-ish modes, an empty string in direnv/bare
that makes the job run on the host runner (proven by the #992 spike) — carries
the GHCR credentials: block unconditionally (inert on the host), and calls the
setup-devkit-toolchain composite as its first step. After that preamble, plain
just sync|precommit|test runs identically in every mode (no nix develop -c
prefixes).

The former per-mode overlay trees assets/workspace-direnv/ and
assets/workspace-bare/ and their init-workspace.sh deployment blocks are
removed. The rendered ci.yml is now byte-identical across all four modes.

Design notes

  • Removed from the jobs what the composite now owns: the job-level env:
    (PREK_HOME / UV_PROJECT_ENVIRONMENT), the "Fix git safe.directory" step,
    and the inline prek version-skew guard step.
  • Kept: triggers, permissions (incl. packages: read for container mode),
    the test-suite dispatch gating if:s, the image-tag dispatch override
    (threaded into resolve-toolchain), and the summary job (restored to
    needs: [resolve-toolchain, lint, test] with a resolve-toolchain.result
    check like the container variant).
  • Timeouts: the more generous of the variants where they differed —
    resolve-toolchain 2, lint 15 (was direnv's 15), test 20 (direnv's 20),
    summary 5.
  • Header comment rewritten to describe the mode-aware design, referencing the
    ADR and CI + release workflows hard-coupled to the container image regardless of DEVKIT_MODE #991.

Files

  • assets/workspace/.github/workflows/ci.yml — new single mode-aware workflow.
  • assets/workspace-direnv/, assets/workspace-bare/ — deleted.
  • assets/init-workspace.sh — overlay-deployment blocks removed.
  • docs/MIGRATION.md — mode descriptions + the renamed "Mode-aware CI" section
    (ci.yml only; the release-workflow supported-boundary prose is left for the
    release-set conversion / Part B).
  • CHANGELOG.md (+ synced .devcontainer/CHANGELOG.md) — Unreleased Changed
    entry.
  • tests/bats/init-workspace.bats — reworked render assertions (see Evidence).

Tests

Reworked the #854/#885 per-mode ci.yml assertions into a single loop over all
four modes asserting the rendered ci.yml: wires ./.github/actions/resolve-toolchain
and ./.github/actions/setup-devkit-toolchain; selects the container via the
needs.resolve-toolchain.outputs.image expression; carries no hardcoded
ghcr.io/vig-os/devcontainer literal, no resolve-image, no inline nix develop
/ container-only env / prek guard; every external uses: SHA-pinned (local ./
refs exempt, matching check-action-pins). Added an assertion that
init-workspace.sh no longer references the overlay dirs, and updated the bare
upgrade test. Dropped the now-obsolete overlay-specific tests. The #995
actionlint fixtures and #994 composite tests stay green over the new tree.

Evidence (local — no automated CI on epic-branch PRs)

nix develop -c bats tests/bats/init-workspace.bats   # 1..146, 0 failures
nix develop -c bats tests/bats/install.bats          # 1..89,  0 failures
nix develop -c prek run --all-files                  # ALL HOOKS GREEN

actionlint passes over the rendered devcontainer / direnv / bare / both trees
(tests 132-135) — the new resolve-toolchain + setup-devkit-toolchain wiring
validates cleanly.

Notes for Part B (release/automation set)

  • docs/MIGRATION.md: I renamed ### direnv-mode CI → ### Mode-aware CI and
    rewrote its first paragraph (ci.yml) only. The "Supported boundary"
    paragraph that follows (the release-workflow / devcontainer-mode-only
    sentences) is left untouched for you to rewrite — clean seam right after "…no
    per-mode overlay." The mode-description bullets now link to #mode-aware-ci.
  • CHANGELOG: my Changed bullet is scoped to ci.yml; add the release-set
    bullet separately (both coexist under ### Changed).
  • The test(ci): prepare-release.yml uses the shared resolve-image action bats
    test is left intact — it is release-workflow territory.
  • Consumption pattern confirmed working end-to-end via actionlint: container:
    with the resolved-image expression + unconditional credentials: +
    setup-devkit-toolchain first step is valid; reuse it for the release jobs.

Refs: #991

c-vigo added 4 commits July 13, 2026 10:11
Rework the per-mode ci.yml render assertions (#854/#885) for the
collapsed, mode-aware ci.yml: every mode's rendered ci.yml wires both
the resolve-toolchain and setup-devkit-toolchain composites, selects its
container via the resolved-image expression, carries no hardcoded
devcontainer image literal, and delegates provisioning to the composite
(no inline nix develop, container-only env, or prek skew guard). Drop the
now-obsolete overlay-specific tests and assert the overlay dirs are no
longer deployed by init-workspace.

Refs: #991
…orkflow

Replace the container-based ci.yml plus the direnv and bare per-mode
overlays with a single mode-aware workflow (ADR Option A). A leading
resolve-toolchain job reads .vig-os and outputs the delivery mode +
container image (empty for direnv/bare, so the job runs on the host);
every job declares container: image via that output with an
unconditional-but-inert GHCR credentials block, and calls the
setup-devkit-toolchain composite as its first step to provision the
toolchain for its mode. Plain just sync|precommit|test then runs
identically in every mode.

Remove the workspace-direnv and workspace-bare overlay trees and the
init-workspace.sh overlay-deployment blocks that applied them.

Refs: #991
The rendered-ci.yml assertion greps for a literal GitHub Actions
expression; annotate the intentional single-quoted string so shellcheck
(SC2016) stays green.

Refs: #991
Update the delivery-mode descriptions and rename the direnv-mode CI
section to 'Mode-aware CI', describing how one ci.yml serves every mode
via resolve-toolchain + setup-devkit-toolchain. Add the Unreleased
Changed entry for collapsing the per-mode overlays. The release-workflow
supported-boundary prose is left for the release-set conversion.

Refs: #991
@c-vigo
c-vigo merged commit 7fc8314 into feature/988-mode-aware-scaffold Jul 13, 2026
2 checks passed
@c-vigo
c-vigo deleted the feature/991-ci-mode-aware branch July 13, 2026 08:26
c-vigo added a commit that referenced this pull request Jul 13, 2026
…997)

One release choreography, mode-aware toolchain provisioning: resolve-toolchain + setup-devkit-toolchain composites (ADR Option A), single mode-aware ci.yml, all release/automation workflows container-free in direnv/bare, opt-in .devcontainer/ prune, vig-utils host-side, actionlint. Sub-PRs: #998 #999 #1000 #1001 #1002 #1005 #1006 #1007.

Refs: #988
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