Repository navigation
Closed
Labels
area:workspaceWorkspace tooling, justfile, templateseffort:medium1-4 hoursfeatureNew feature or requestsemver:minorNew feature, backward-compatible
Milestone
Description
Description
Introduce a committed key=value config file (.vig-os) at the project root that becomes the single source of truth for the devcontainer image version. Today, the version is baked into docker-compose.yml at build time via the {{IMAGE_TAG}} placeholder; downstream consumers (version-check, CI, smoke tests) must grep-parse docker-compose.yml to discover it.
Problem Statement
- Fragile version detection --
version-check.shextracts the version by grep-parsing theimage:line indocker-compose.yml. Any format change breaks it. - No single source of truth -- the version lives inside a generated line of
docker-compose.yml. Nothing else can reference it without parsing that file. - Smoke-test CI can't discover the RC tag --
ci-container.ymldefaults tolateston PR triggers because there is no input. A config file would let CI read the intended tag. initialize.shalready writes.devcontainer/.envfor docker-compose interpolation (CONTAINER_SOCKET_PATH), so the infrastructure for env-var-based image tags already exists.
Proposed Solution
Add .vig-os (key=value format) to assets/workspace/ as a template file:
# vig-os devcontainer configuration
DEVCONTAINER_VERSION={{IMAGE_TAG}}
Data flow:
.vig-os (committed, project root)
│
├── initialize.sh sources it on host
│ └── writes DEVCONTAINER_VERSION to .devcontainer/.env
│ └── docker-compose.yml: image: ...${DEVCONTAINER_VERSION:-latest}
│
├── version-check.sh reads it directly (replaces grep-parsing)
│
└── CI / smoke-test reads it directly
Key design choice: key=value format -- initialize.sh runs on the host before the container starts. The host may not have Python, ruling out TOML. Key=value is shell-sourceable, docker-compose-friendly, and trivially readable by CI.
Files to change:
- New:
assets/workspace/.vig-os-- template withDEVCONTAINER_VERSION={{IMAGE_TAG}} - Modify:
assets/workspace/.devcontainer/docker-compose.yml--{{IMAGE_TAG}}→${DEVCONTAINER_VERSION:-latest} - Modify:
assets/workspace/.devcontainer/scripts/initialize.sh-- source.vig-os, write to.env - Modify:
assets/workspace/.devcontainer/scripts/version-check.sh-- read from.vig-osinstead of grep - No change:
scripts/prepare-build.sh-- existing{{IMAGE_TAG}}loop catches.vig-osautomatically - Tests: update
test_integration.py,test_install_script.py,test_image.pyassertions
Alternatives Considered
- TOML (
.vig-os.toml) -- more structured, Python-native (tomllib), butinitialize.shruns on the host where Python may not be available. Shell parsing of TOML is fragile. - Extend
.devcontainer/.env--.envis gitignored and generated at runtime. A committed config requires a separate file. pyproject.toml [tool.vig-os]-- requires Python to parse; same host portability problem.
Additional Context
- Related to [FEATURE] Smoke-test repository to validate shipped CI/CD workflows #169 (smoke-test repo). The
.vig-osfile enables the smoke-test deploy workflow to write the RC tag to a known location. initialize.shalready writesCONTAINER_SOCKET_PATHto.devcontainer/.env-- addingDEVCONTAINER_VERSIONfollows the same pattern.- The
.vig-osfile is extensible for future config (e.g., registry URL, org name) without changing the mechanism.
Impact
- Who benefits: All downstream projects using the devcontainer template. Version detection becomes reliable and centralized.
- Compatibility: Backward compatible. Existing workspaces without
.vig-osfall back tolatestvia the${DEVCONTAINER_VERSION:-latest}default.
Changelog Category
Added
Metadata
Metadata
Assignees
Labels
area:workspaceWorkspace tooling, justfile, templateseffort:medium1-4 hoursfeatureNew feature or requestsemver:minorNew feature, backward-compatible
Activity
c-vigo commentedon Mar 11, 2026
Implementation Plan
1. Add
.vig-ostemplate fileCreate
assets/workspace/.vig-os:The
{{IMAGE_TAG}}placeholder is replaced at build time byprepare-build.sh(the existing replacement loop catches all files inassets/workspace/automatically -- no change toprepare-build.shneeded).2. Switch
docker-compose.ymlto env-var interpolationIn
assets/workspace/.devcontainer/docker-compose.yml, change:Docker-compose reads
DEVCONTAINER_VERSIONfrom.devcontainer/.env(populated byinitialize.shin step 3).3. Update
initialize.shto source.vig-osIn
assets/workspace/.devcontainer/scripts/initialize.sh, add beforeconfigure_socket_path:This follows the existing pattern:
initialize.shalready writesCONTAINER_SOCKET_PATHto.devcontainer/.env.4. Update
version-check.shReplace the fragile
grep -oparsing ofdocker-compose.yml(lines 194-210) with:5. Update tests
test_integration.py(TestDevContainerDockerCompose): theimagefield is nowghcr.io/vig-os/devcontainer:${DEVCONTAINER_VERSION:-latest}, not a concrete version. Adjust the assertion to check for${DEVCONTAINER_VERSIONinstead of a pinned tag. Also verify.vig-oscontains the concrete version.test_install_script.py(test_install_replaces_image_tag_placeholder): verify.vig-oshas the concrete version anddocker-compose.ymlno longer has{{IMAGE_TAG}}.test_image.py(test_image_tag_replaced): verify.vig-osis replaced.docker-compose.ymlnow has${DEVCONTAINER_VERSION}(no placeholder to replace).Files unchanged (confirmed)
scripts/prepare-build.sh-- existing{{IMAGE_TAG}}loop handles.vig-osautomaticallyscripts/manifest.toml--.vig-osis a template file, not a synced file.gitignore--.vig-osis a different name from.env, not gitignoredOpen questions
.vig-osis missing (e.g., older workspace not yet upgraded),docker-compose.ymldefaults tolatestvia${DEVCONTAINER_VERSION:-latest}. Acceptable?Containerfilemanifest generation: thegrep -rlin the Containerfile that buildsmanifest.tomlalready searches for{{IMAGE_TAG}}--.vig-oswill be included. No change needed.test(setup): add vig-os version flow test coverage
feat(setup): add .vig-os as devcontainer version source of truth
docs(setup): record vig-os version source in changelog
test(setup): add vig-os version flow test coverage
feat(setup): add .vig-os as devcontainer version source of truth
docs(setup): record vig-os version source in changelog
feat(setup): add .vig-os as devcontainer version source of truth (#259)
chore: release 0.3.0 (#270)