You move scripts/start.sh to tools/start.sh. VS Code updates the imports, the tests pass, you push. Then CI fails with COPY failed: file not found in build context, because the Dockerfile still says COPY scripts/start.sh.
Refactoring tools update paths in code. Paths in config files are plain strings, and nothing checks them until a build, a release or GitHub's review assignment finally uses them.
Where the stale strings hide
| File | Breaks as |
|---|---|
package.json main, bin, exports, files
|
A published package that points at nothing (reanimated#3026) |
Dockerfile COPY / ADD
|
COPY failed: file not found in build context (next.js #33338) |
Workflow run: / working-directory
|
No such file or directory in a step |
tsconfig.json extends / references
|
A type check that fails far from the rename |
CODEOWNERS |
Nothing fails: a moved folder just matches no files, so no one is asked to review |
The manual check
git grep -n "scripts/start.sh"
git grep -n "scripts/" -- '*.json' '*.yml' '*.yaml' 'Dockerfile*' CODEOWNERS
Then run docker build with the same context as CI and npm pack --dry-run. It works, but only for the string you remembered to search for.
Catch it in the editor
I built PathMend, a free VS Code extension that checks file paths in package.json, tsconfig, Dockerfiles, Compose, GitHub Actions, .gitlab-ci.yml, CODEOWNERS and launch.json, and underlines the exact string when the file is missing (rules PM001 - PM011).
- "Did you mean ...?" Quick Fix finds the moved file (same name in another folder) or a close spelling.
- Rename in VS Code and it asks: 3 config references still point to scripts - update all? with Update all, Preview and Ignore.
-
COPYsources are resolved against the Compose build context, and escapes out of it are flagged. - Skips
$VAR,${{ }},COPY --from, URLs and build output folders likedist/and your tsconfigoutDir.
No network, no telemetry, no child processes. It only checks whether paths exist inside the workspace, so it also works in untrusted workspaces. It does not read build contexts passed on the command line, does not apply .dockerignore, and a git mv in the terminal shows up as broken references rather than a rename prompt.
It gets its own activity bar icon with a badge, and a Broken References panel listing each broken path with a one-click fix.
code --install-extension jaytankdev.pathmend
Source (MIT): github.com/jay-tank/pathmend
Full write-up (every file and rule, the build context logic, limitations, FAQ): You renamed a file and CI broke
Top comments (0)