Skip to content

[BUG] #1111 gitignore migration leaks scaffold-committed files (.envrc) and language-template junk into .gitignore.project #1145

Closed

Description

@c-vigo

Description

The #1111 migration ("Migrated from the managed root .gitignore on upgrade") copies every entry from the consumer's old root .gitignore that is not in the regenerated managed base into .gitignore.project — verbatim, with no filtering. Observed on the sync-issues-action 1.3.0 deploy (vig-os/sync-issues-action#106, PR #108), where the old file was the pre-1.3.0 Python-template .gitignore:

  1. It migrated .envrc — the old Python template ignored it, but in direnv mode .envrc is a scaffold-COMMITTED file ("committed for nix-direnv onboarding", T4.2 — Downstream pattern: minimal flake stub (non-overwriting) + nix2container production builder #640). Since .gitignore.project is appended to the regenerated root .gitignore, the migrated entry silently shadows the scaffold's intent: the fresh .envrc stays untracked and direnv onboarding breaks for every other clone. git check-ignore -v .envrc confirmed the appended block won.
  2. ~90 lines of Python-template noise (__pycache__/, .tox/, celerybeat-schedule, marimo/, …) landed in a Node repo's consumer-owned file, obscuring the handful of real repo-specific entries (dist/* un-ignore set, test_output).

Hand-fixed in sync-issues-action PR #108 by rewriting .gitignore.project; every future migrated consumer hits the same thing.

Steps to Reproduce

  1. Take a consumer whose root .gitignore is a pre-1.3.0 managed template (Python-flavored) — or any old .gitignore containing .envrc.
  2. Run install.sh --version 1.3.0 --mode direnv --force.
  3. Inspect .gitignore.project → contains .envrc and the old template entries; git check-ignore .envrc → ignored.

Expected Behavior

The migration should at minimum drop entries that shadow files the scaffold itself commits (.envrc; consider .gitignore.project, justfile, flake.nix for robustness). Ideally it should also skip entries that belong to a devkit language template (old or current) rather than treating them as repo-specific — the point of the migration is to preserve CONSUMER-authored ignores, not stale template bodies.

Additional Context

Found during the sync-issues-action deployment 2026-07-15. Related: #1111 (original migration), #640 (.envrc committed contract), #1092 (append mechanism).

Activity

  1. added
    bug
    priority:medium
    area:workspace
    effort:small
    semver:patch
    on Jul 16, 2026
  2. c-vigo commented on Jul 16, 2026

    @c-vigo
    ContributorAuthor

    Fixed by #1146 (merged to dev). migrate_root_gitignore() now (1) never migrates entries shadowing scaffold-committed files (.envrc, flake.nix/flake.lock, justfile/justfile.project, .vig-os, .gitignore.project) and (2) builds the managed-entry filter from ALL gitignore.d fragments, so stale cross-language template lines no longer migrate as consumer entries. Covered by two new bats tests (incl. a git check-ignore assertion that the scaffolded .envrc stays committable); full init-workspace suite 208/208. Closing manually — dev merges don't auto-close. Ships to consumers with the next devkit release.

  3. added a commit that references this issue on Jul 17, 2026
  4. added a commit that references this issue on Jul 17, 2026
  5. added a commit that references this issue on Jul 17, 2026
  6. added 3 commits that reference this issue on Jul 17, 2026
    38e5550
    f93c159
    c5f3ac6
  7. added a commit that references this issue on Aug 5, 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:smallpriority:mediumsemver:patch

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions