Repository navigation
fix(workspace): preserve .typos.toml and harden init-workspace upgrades - #922
Merged
Merged
Conversation
The image ships git but no diff(1)/cmp(1), so the #878 preview printed 'diff: command not found' and an empty box in-container. Route the preview and its gate through git diff --no-index (long-flag --quiet gates; --no-index exits 1 on divergence, which is expected). Factor the preview into a shared helper for reuse by other preserved files. Refs: #916
Add .typos.toml to PRESERVE_FILES so a consumer's curated spell-check exceptions survive a --force upgrade, and print the template diff like the #878 handling. Since the typos tool also reads the legacy _typos.toml, skip shipping the template .typos.toml when a consumer carries _typos.toml and no .typos.toml, so two active configs never collide. Refs: #913
Move the GITHUB_REPOSITORY resolution/validation ahead of the rsync copy so a --no-prompts run with no derivable origin aborts while the workspace is still pristine, instead of leaving a half-scaffolded tree. The resolved value still feeds the later placeholder substitution. Refs: #916
…record The image exposes no independent runtime record of its own built tag: the only in-image version is the baked template .vig-os (repo-root pin at build), which the scaffold already copies, so stamping from it is a no-op and stays stale for RC images. Document that pinning the true built tag for RCs (when VIG_OS_VERSION is unset) requires baking an authoritative version record at build time. Refs: #916
…reserve-typos-init-hardening # Conflicts: # CHANGELOG.md # assets/workspace/.devcontainer/CHANGELOG.md
The #916 reorder moved resolve_github_repository ahead of the rsync so a --no-prompts run aborts before mutating the workspace. But the function also prompts interactively when no origin is derivable, so the move pushed that prompt ahead of the 'Copying files from' output, hanging the interactive integration flow. Guard the early call to --no-prompts only and restore the interactive resolution to its original post-copy call site. Refs: #916
…reserve-typos-init-hardening # Conflicts: # CHANGELOG.md # assets/workspace/.devcontainer/CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses #913 (fully) and four items of the #916 hardening bundle, all found during 0.4.1-rc1 consumer-upgrade testing. All changes are in
assets/init-workspace.shwith BATS coverage (TDD, test-then-fix per item).Changes
.typos.toml(fix(workspace): scaffold upgrade clobbers a customized .typos.toml (dual-config corruption) #913). Added toPRESERVE_FILESso a consumer's spell-check exceptions survive--force; prints the template diff like fix(workspace): scaffold upgrade replaces .pre-commit-config.yaml, silently clobbering repo-specific hook config #878. A consumer carrying the legacy_typos.tomlno longer also receives the template.typos.toml(no dual active config — the exact corruption seen on vault, wheretyposrewroteNd→Andin the scaffold's ownversion-check.sh).git diff --no-indexfor preserved-file previews (fix(workspace): init-workspace upgrade hardening — git-diff preview, workflow scan scope, GITHUB_REPOSITORY ordering, pin stamp #916). The image ships nodiff/cmp, so the fix(workspace): scaffold upgrade replaces .pre-commit-config.yaml, silently clobbering repo-specific hook config #878 preview box printedcommand not found; now usesgit..github/workflows/*.yml, flagging realpre-commitinvocations withfile:linewhile ignoring comments and stepname:descriptions.--no-prompts, an underivable origin now aborts before any files are copied, instead of leaving a half-scaffolded tree.Not included
.vig-ospin on baredocker run) cannot be fixed runtime-only — the image has no authoritative built-tag record. Split out to fix(image): bake an authoritative built-tag version record for init-workspace .vig-os stamping #921 (build-side); a NOTE was added at the stamping site. Theinstall.shpath is already correct..gitignoreclobber warning; source-stub skip) deferred — both are ambiguous/risky per the issue's "only if clean" guidance; recommend a dedicated issue if wanted.Verification
bats tests/bats/init-workspace.bats→ 84/84 (+9 new);tests/bats/init.bats→ 29/29.prek run --all-filesgreen locally (shellcheck, typos, agent-identity, sync-manifest).Closes #913. Refs #916, #921.