Skip to content

fix(workspace): init-workspace upgrade hardening — git-diff preview, workflow scan scope, GITHUB_REPOSITORY ordering, pin stamp #916

Closed

Description

@c-vigo

Bundle of init-workspace.sh follow-ups found during 0.4.1-rc1 consumer-upgrade testing. All localized to assets/init-workspace.sh (+ its BATS tests).

  1. fix(workspace): scaffold upgrade replaces .pre-commit-config.yaml, silently clobbering repo-specific hook config #878 diff-preview box prints empty. The image has no diff/cmp, so the preserved-vs-template report the fix(workspace): scaffold upgrade replaces .pre-commit-config.yaml, silently clobbering repo-specific hook config #878 fix added is blank (line 582: diff: command not found). The image does ship git 2.54.0 → use git diff --no-index (and drop the diff -q gate for git diff --no-index --quiet). Reproduced in all five test upgrades. Refs: fix(workspace): scaffold upgrade replaces .pre-commit-config.yaml, silently clobbering repo-specific hook config #878

  2. fix(image): pre-commit binary dropped without a compat path — preserved consumer recipes and .githooks calling it break #881 pre-commit reference scan misses .github/workflows/. The scan only covers justfile.project and .githooks/. mat has a real uv run pre-commit run --all-files in .github/workflows/ci-container.yml:119 that went unflagged. Extend the scan scope to preserved consumer workflows. Refs: fix(image): pre-commit binary dropped without a compat path — preserved consumer recipes and .githooks calling it break #881

  3. --no-prompts half-applies before validating GITHUB_REPOSITORY. The origin-resolution check runs after the rsync copy but before placeholder substitution, so when the origin can't be derived it aborts (exit 1) leaving a half-scaffolded tree (files copied, {{GITHUB_REPOSITORY}} unsubstituted). Move the resolution/validation before any filesystem mutation so it fails clean.

  4. .vig-os pin not advanced on upgrade. The baked template .vig-os pins DEVCONTAINER_VERSION=0.4.0; init-workspace.sh only rewrites the pin when VIG_OS_VERSION is set (forwarded by install.sh, absent on a bare docker run … init-workspace.sh). A direct-run upgrade silently leaves the consumer on the old pin. Stamp the pin from the image's own version at scaffold time.

Lower-priority, include if clean:
5. --force clobbers a customized .gitignore with no warning (talys lost data-ignore patterns). Add a non-fatal diff/warning like #878, or preserve.
6. Template source stubs littered (src/<short_name>/__init__.py, tests/test_example.py) when upgrading an existing project whose package dir differs from SHORT_NAME. Skip source-stub scaffolding on --force upgrade of a populated workspace.

Refs: #877

Activity

  1. added this to the 0.4.1 milestone on Jul 7, 2026
  2. added
    bug
    priority:medium
    area:workspace
    effort:medium
    semver:patch
    on Jul 7, 2026
  3. c-vigo commented on Jul 8, 2026

    @c-vigo
    ContributorAuthor

    Implemented in 0.4.1 (released 2026-07-08) — see the ## [0.4.1] CHANGELOG entry. Closing as completed.

  4. added a commit that references this issue on Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:workspacebugeffort:mediumpriority:mediumsemver:patch

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions