Skip to content

feat(manifest): dual-key DEVKIT_VERSION pin parser with legacy fallback - #968

Merged
c-vigo merged 2 commits into
devfrom
feature/781-dual-key-version-parser
Jul 10, 2026
Merged

c-vigo merged 2 commits into
devfrom
feature/781-dual-key-version-parser

Conversation

@c-vigo

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

Copy link
Copy Markdown
Contributor

Summary

First slice of the devcontainer → devkit rename (#781): make every .vig-os
version-pin reader accept the renamed DEVKIT_VERSION key, falling back to the legacy
DEVCONTAINER_VERSION when it is absent.

This is the load-bearing first step — landing it makes every later rename slice
(image ref, dispatch targets, pin-key writeback) non-breaking for consumers: a repo whose
.vig-os still says DEVCONTAINER_VERSION keeps resolving, and one re-scaffolded to
DEVKIT_VERSION resolves too. Soft cutover, per the approved plan.

Behaviour

  • Reads prefer DEVKIT_VERSION; fall back to DEVCONTAINER_VERSION when the new key is absent.
  • Both keys are captured and preferred after the read, so DEVKIT_VERSION wins regardless
    of line order
    (not "first match wins").
  • A legacy-only manifest resolves exactly as before (byte-identical) — no regression.

Read sites updated (all five)

Site Consumer
.github/actions/resolve-image/action.yml CI image-tag resolution
assets/workspace/.github/actions/resolve-image/action.yml scaffold mirror (sync target)
assets/workspace/.devcontainer/scripts/initialize.sh writes compose .env pin
assets/workspace/.devcontainer/scripts/version-check.sh in-container version report
flake.nix Nix image build tag

Out of scope for this slice (later PRs): the image ref ghcr.io/vig-os/devcontainer, the
written .env / compose var name, and the written pin key (init-workspace.sh / release.yml
finalize still write DEVCONTAINER_VERSION). install.sh does not read the version pin from
.vig-os, so it is untouched here.

Testing

TDD (RED → GREEN):

  • tests/test_resolve_image_manifest.py — new DEVKIT_VERSION-only + dual-key precedence
    (both orders) cases. 4 passed.
  • tests/bats/manifest-parsers.bats — new DEVKIT_VERSION read + precedence cases for
    initialize.sh and version-check.sh, with the four legacy #885 regression tests intact.
    8 passed.
  • just precommit (full suite, incl. shellcheck/actionlint/nixfmt/sync-manifest) — green.

Refs: #781

c-vigo added 2 commits July 10, 2026 13:00
Assert the .vig-os version-pin parsers read the renamed DEVKIT_VERSION key,
prefer it over the legacy DEVCONTAINER_VERSION regardless of file order, and
still resolve a legacy-only manifest. Covers the resolve-image composite action
(pytest) and the initialize.sh / version-check.sh scaffold parsers (bats).
Fails against the current DEVCONTAINER_VERSION-only parsers.

Refs: #781
…(GREEN)

Every .vig-os version-pin reader now prefers a DEVKIT_VERSION key and falls back
to the legacy DEVCONTAINER_VERSION when absent, so un-migrated consumer pins keep
resolving during the devcontainer -> devkit rename (soft cutover). Both keys are
captured and preferred after the read, so DEVKIT_VERSION wins regardless of line
order. Updates the resolve-image composite action (root + scaffold mirror), the
scaffold initialize.sh / version-check.sh parsers, and the Nix image build tag
resolution. The written .env / compose var name is unchanged in this slice.

Refs: #781
@c-vigo
c-vigo enabled auto-merge July 10, 2026 11:08
@c-vigo
c-vigo merged commit 5719ce0 into dev Jul 10, 2026
15 checks passed
@c-vigo
c-vigo deleted the feature/781-dual-key-version-parser branch July 10, 2026 11:14
c-vigo added a commit that referenced this pull request Jul 10, 2026
## Summary

Stage 1 slice of **#781**: flip the version-pin **write** path to the
renamed
`DEVKIT_VERSION` key. Builds on the merged dual-key reader (#968), so
this is a
**soft cutover** — readers still accept the legacy
`DEVCONTAINER_VERSION`.

## Changes
- **Template `assets/workspace/.vig-os`** —
`DEVKIT_VERSION={{IMAGE_TAG}}`.
- **`init-workspace.sh`** — writeback sed rewrites either key →
`DEVKIT_VERSION`
  (migrates a stray legacy line); header comment updated.
- **`release.yml` finalize** — writes `DEVKIT_VERSION` to the repo-root
`.vig-os`.
- **Repo-root `.vig-os`** — now `DEVKIT_VERSION=0.5.1` (dogfoods the new
key).
- **`justfile.devc` `devc-upgrade`** — **reader missed by the initial
parser sweep**
(it reads the pin via `awk`, not `sed/grep/case`); now dual-keyed,
preferring
  `DEVKIT_VERSION` with the legacy fallback.
- **`flake.nix`** — comment only (the `{{IMAGE_TAG}}` substitution is
key-agnostic).
- Scaffold `ci.yml` / `prepare-release.yml` — user-facing pin-key
mentions updated.

## Migration behaviour
`.vig-os` is **not** in `PRESERVE_FILES`, so a `--force` upgrade
overwrites it from
the template (now `DEVKIT_VERSION`) and the stale legacy key naturally
drops. New
bats test `init-workspace migrates a legacy DEVCONTAINER_VERSION pin to
DEVKIT_VERSION (#781)` covers this end to end.

## Out of scope (later slices)
The docker-compose **`.env` interpolation variable** stays
`DEVCONTAINER_VERSION`
(it's the compose var, not the pin) — its rename rides the image-ref
cutover (PR 2).

## Testing
- `tests/bats/init-workspace.bats` — 7 version-pin tests green (incl.
migration); full file 127 green. TDD RED→GREEN.
- `tests/bats/just.bats` — `devc-upgrade` reads `DEVKIT_VERSION`, still
honors legacy. Green.
- `tests/test_integration.py` — scaffolded-`.vig-os` assertions flipped
to `DEVKIT_VERSION` (container tests run in CI).
- `just precommit` (full suite) — green.

Refs: #781
c-vigo added a commit that referenced this pull request Jul 10, 2026
…973)

## Summary

The final Stage-1 slice of **#781**: move the container image to the
**new GHCR
package `ghcr.io/vig-os/devkit`** and rename the flake output attributes
to match.
The new package is already seeded (`0.5.1` + `latest`, multi-arch,
public), so CI
resolves against it.

Two commits:
1. `refactor(flake)` — attribute rename `devcontainerImage` →
`devkitImage`,
`devcontainerImageEnv` → `devkitImageEnv`, `devcontainer-bootstrap` →
`devkit-bootstrap`
(+ all call sites and the flake-services / workflow-cachix test
anchors).
2. `feat(image)!` — image **ref** `ghcr.io/vig-os/devcontainer` →
`ghcr.io/vig-os/devkit`
across the flake, CI/release workflows, `install.sh`, the scaffold
template
(compose + workflows + actions), and docs (README/TESTING regenerated
from templates).

## Breaking change
Consumers pulling `ghcr.io/vig-os/devcontainer` must move to
`ghcr.io/vig-os/devkit`.
The old package is **frozen at `0.5.1` and stays pullable**; the
soft-cutover pin parser
(#968) + `install.sh --force` re-scaffold migrate consumers without a
hard break.

## Intentionally NOT changed (verified)
- **Released `CHANGELOG` entries**, the **`MIGRATION.md` note** that the
old package stays pullable, and the **historical ADR** — all still cite
`ghcr.io/vig-os/devcontainer` on purpose.
- **OCI `source` label** and **cosign `--certificate-identity-regexp`**
— these are `github.com` *repo* paths and follow the **Stage 3**
repository rename, not the image ref.
- **docker-compose `${DEVCONTAINER_VERSION}`** interpolation var —
deferred (it's the compose var, not the image ref or pin key).

## Verification
- `nix eval .#devkitImage.imageName` → `ghcr.io/vig-os/devkit` ✅
- `test_flake_services` (evaluates the flake) + `test_workflow_cachix` —
green (attr rename).
- `install.bats` / `clean.bats` / `just.bats` / `test_install_script`
(unit) — green; caught + fixed a regex-escaped ref (`ghcr\.io/…`) the
bulk sed missed.
- `just precommit` full suite — green (README/TESTING regenerated,
actionlint, sync-manifest).
- Container/integration image tests run in CI against the seeded
`devkit` package.

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