From 37288e3dec91a48c57727e2d58c2133c0d0e0966 Mon Sep 17 00:00:00 2001 From: Lily Shen <115414357+lilyshen0722@users.noreply.github.com> Date: Wed, 5 Aug 2026 20:10:35 -0700 Subject: [PATCH] fix(repo): untrack node_modules symlinks that dodged the dir-only ignore pattern MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit backend/node_modules (#818) and frontend/node_modules (#867) are committed SYMLINKS pointing at an absolute path inside one operator worktree. They got past .gitignore because 'node_modules/' (trailing slash) matches only directories — a symlink named node_modules sails through 'git add -A'. Measured blast radius before this fix: - docker builds: SAFE. .dockerignore patterns are filepath.Clean'd, so 'node_modules/' excludes the symlink from the context (verified empirically with positive+negative controls; the live backend image at e55f0c21 was already built from a symlink-carrying tree and succeeded). - CI: SAFE. npm ci removes the symlink before installing; PR checks on both carrier PRs passed. - every other checkout: NOT safe. 'git pull' exits 0 and silently replaces a real, populated node_modules directory with the dangling symlink (ignored files are expendable to checkout — reproduced in a scratch repo). On the one machine where the target resolves, everything silently uses a May-24 worktree's dependencies instead of the tree's own: version skew with no error anywhere. Fix: untrack both symlinks (git rm --cached — the author's local links are untouched) and drop the trailing slash so the pattern matches the symlink form too. Co-Authored-By: Claude Fable 5 --- .gitignore | 3 ++- backend/node_modules | 1 - frontend/node_modules | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) delete mode 120000 backend/node_modules delete mode 120000 frontend/node_modules diff --git a/.gitignore b/.gitignore index 054eede55..d8000e002 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,8 @@ .DS_Store npm-debug.log -node_modules/ +# no trailing slash: the dir-only form let node_modules SYMLINKS get committed (#818, #867) +node_modules .env diff --git a/backend/node_modules b/backend/node_modules deleted file mode 120000 index e8b72f38d..000000000 --- a/backend/node_modules +++ /dev/null @@ -1 +0,0 @@ -/Users/xcjsam/Documents/workspace/commonly/.claude/worktrees/sprint-2026-05-24-installable-projection/backend/node_modules \ No newline at end of file diff --git a/frontend/node_modules b/frontend/node_modules deleted file mode 120000 index 65985ca71..000000000 --- a/frontend/node_modules +++ /dev/null @@ -1 +0,0 @@ -/Users/xcjsam/Documents/workspace/commonly/.claude/worktrees/sprint-2026-05-24-installable-projection/frontend/node_modules \ No newline at end of file