Skip to content

feat(workspace): opt-in .devcontainer/ prune on container-less mode upgrade - #1000

Merged
c-vigo merged 4 commits into
feature/988-mode-aware-scaffoldfrom
feature/990-prune-devcontainer
Jul 13, 2026
Merged

c-vigo merged 4 commits into
feature/988-mode-aware-scaffoldfrom
feature/990-prune-devcontainer

Conversation

@c-vigo

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

Copy link
Copy Markdown
Contributor

What

Add an opt-in --prune-devcontainer flag to assets/init-workspace.sh (forwarded
by install.sh) that removes a pre-existing .devcontainer/ when
(re)scaffolding in a container-less mode (direnv or bare).

Why

Mode switching is deliberately non-destructive toward a pre-existing
.devcontainer/ (#738), which is correct for coexistence but strands a stale,
broken container on a real container → direnv migration (concrete case:
vig-os/commit-action's old apt/Debian .devcontainer/). This gives operators a
supported, explicit way to prune it while keeping the #738 default intact.

Behavior

  • --prune-devcontainer (direnv/bare only): a populated pre-existing
    .devcontainer/ is removed. Without it, [BUG] install.sh --mode direnv --force overwrites populated consumer files (pyproject.toml, .devcontainer/) #738 behavior is unchanged (preserved).
  • Rejected loudly in devcontainer/both modes:
    Error: --prune-devcontainer only applies to direnv/bare modes (got: <mode>),
    exit 1 — same failure shape as an invalid --mode.
  • Interactive runs (no --no-prompts) prompt once when a populated
    pre-existing .devcontainer/ is detected in a container-less mode:
    Prune existing .devcontainer/? (y/N), default No = preserve. Skipped under
    --no-prompts and --preview (preview decides purely from the flag and stays
    side-effect-free).
  • --preview: with the flag the .devcontainer/ moves from the PRESERVED
    listing to the DELETED listing; the tree is not touched.
  • install.sh forwards the flag (parse → CMD array), documented in --help.
  • docs/MIGRATION.md: new "Migrating a devcontainer/both repo to direnv/bare"
    subsection with the preview-then-apply runbook.

Test evidence

bats tests/bats/init-workspace.bats tests/bats/install.bats → 224 passed, 0 failed
(no automated CI on PRs into the epic branch — local evidence).

New tests (all green):

Full prek run --all-files green (sync-manifest mirrored the CHANGELOG entry into
assets/workspace/.devcontainer/CHANGELOG.md; re-staged and re-run clean).

Refs: #990

@c-vigo
c-vigo merged commit d5204b2 into feature/988-mode-aware-scaffold Jul 13, 2026
2 checks passed
@c-vigo
c-vigo deleted the feature/990-prune-devcontainer branch July 13, 2026 07:44
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