Repository navigation
fix(workspace): never migrate scaffold-committed or template gitignore lines - #1146
Merged
Merged
Conversation
…leaks Pin two migrate_root_gitignore defects observed live on the sync-issues-action 1.3.0 deploy (vig-os/sync-issues-action#106, PR #108): a scaffold-committed .envrc entry migrated into .gitignore.project shadows the committed file and breaks direnv onboarding, and lines from a NON-detected language fragment (old Python template junk on a Node repo) migrate as if consumer-authored. Refs: #1145
…e lines migrate_root_gitignore (#1111) had two defects, observed live on the sync-issues-action 1.3.0 deploy (vig-os/sync-issues-action#106, PR #108): 1. It migrated entries that shadow scaffold-COMMITTED files: the old Python-template .gitignore shipped .envrc, and since .gitignore.project is appended to the regenerated root .gitignore (#1092), the migrated entry kept the scaffolded .envrc (#640) untracked and broke direnv onboarding on every clone. A never-migrate denylist of scaffold-committed file names (.envrc, .gitignore.project, flake.nix, flake.lock, justfile, justfile.project, .vig-os) now guards these; literal file names, so a plain literal line match suffices. 2. It treated stale devkit language-template lines as consumer-authored: the managed set covered only the DETECTED languages' fragments, so a repo that switched language templates inherited ~90 lines of cross-language junk in its consumer-owned file. The managed set is now built from ALL gitignore.d fragments — any line found in any devkit fragment is template material, never migrated. Order, dedup, idempotency, and append-only behavior are unchanged. Refs: #1145
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
The #1111 gitignore migration (
migrate_root_gitignore()inassets/init-workspace.sh) copied consumer lines from the old root.gitignoreinto.gitignore.projectwith two defects, both observed live on the sync-issues-action 1.3.0 deploy (field report: vig-os/sync-issues-action#106, PR vig-os/sync-issues-action#108):.gitignoreshipped.envrc; in direnv mode.envrcis scaffold-committed for nix-direnv onboarding (T4.2 — Downstream pattern: minimal flake stub (non-overwriting) +nix2containerproduction builder #640). Because.gitignore.projectis appended to the regenerated root.gitignore([BUG] Managed .gitignore rewrite (#1024) drops consumer-required ignores with no durable committed extension point for repo-root paths #1092), the migrated entry silently kept the scaffolded.envrcuntracked and broke direnv onboarding on every clone.managedset was built from the template base plus the DETECTED languages' fragments only, so a repo that switched language templates (old Python-flavored managed.gitignore, now a Node repo) got ~90 lines of__pycache__//.tox/-style template material dumped into its consumer-owned file.Fix (two never-migrate rules)
.envrc,.gitignore.project,flake.nix,flake.lock,justfile,justfile.project,.vig-os. These are literal file names, not glob patterns, so a plain literal line match suffices (commented in the code).managedset now iterates everygitignore.d/*.gitignorefragment instead of only the detected languages'. The OLD root.gitignorewas a devkit-managed template for whatever language set applied back then, so any line found in ANY devkit fragment is template material, never consumer-authored.Order, dedup, idempotency, and append-only behavior are unchanged; the function's header comment documents both rules.
Test evidence (strict TDD)
tests/bats/init-workspace.bats, [BUG] #1111 gitignore migration leaks scaffold-committed files (.envrc) and language-template junk into .gitignore.project #1145 section) failed on the pre-fix code exactly at the leak assertions (.envrcand__pycache__/found in.gitignore.project), committed first..envrcalso verified untracked viagit check-ignore.tests/bats/init-workspace.batsfile passes — 208/208 tests, including all [BUG] #1092 seam: upgrade drops prior hand-added root ignores instead of migrating them into the empty-seeded .gitignore.project #1111 / [BUG] Managed .gitignore rewrite (#1024) drops consumer-required ignores with no durable committed extension point for repo-root paths #1092 / #1092 pre-commit-ignore auto-seed misses direnv-mode (containerized) upgrades; scaffold clobbers the flake-hooks symlink #1117 gitignore tests.prek run --all-files: all hooks green.Notes
Closes #1145
Note:
Closes #Ndoes not auto-close on dev-targeted merges in this repo (main-only) — close #1145 manually on merge.Refs: #1145