fix: stop the plugin update guard firing on npm install artifacts - #267
Open
ankitranjan7 wants to merge 1 commit into
Open
fix: stop the plugin update guard firing on npm install artifacts#267ankitranjan7 wants to merge 1 commit into
ankitranjan7 wants to merge 1 commit into
Conversation
`plugin install` runs `npm install` in the checkout, so a plugin repo without a .gitignore reports node_modules/ and package-lock.json as untracked. The dirty-checkout guard then refused every update — blaming the user for work webcmd itself created, and leaving such plugins permanently un-updatable short of --force. getDirtyFiles now drops those paths (at any depth, covering monorepo sub-plugin installs) before the guard decides. Anything else untracked is still real user work and still blocks. Fixes the plugin-management E2E. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
🟢 No documentation gap found — medium confidenceThe automated review found no documentation gap in the supplied changes. This review is advisory and does not block merging. |
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.
Found while checking a failing test on #266 — unrelated to that PR, so it's on its own branch.
Problem
plugin installrunsnpm install --omit=dev --ignore-scriptsin the cloned checkout (src/plugin.ts). A plugin repo without a.gitignorethen reportsnode_modules/andpackage-lock.jsonas untracked, and the dirty-checkout guard refuses to update:The guard fires on webcmd's own output and blames the user for work they never did. Any such plugin is permanently un-updatable short of
--force, which is documented as "discard uncommitted changes" — a scary flag for a clean checkout.getDirtyFiles' doc comment assumedgit statuswould never surfacenode_modulesbecause it is gitignored; that only holds when the plugin repo ships a.gitignore.This is what fails
tests/e2e/plugin-management.test.ts > plugin update succeeds on an installed pluginon main.Change
getDirtyFilesdropsnode_modules/andpackage-lock.jsonat any depth — depth matters because monorepo installs runnpm installat the repo root and in each sub-plugin.dirtyEntryPath, shared withdescribeDirtyEntry.node_modules_notes.md) still blocks; there's a test for that.Not filtered: the
.jsfilestranspilePluginTsemits next to.tssources. Those are indistinguishable from hand-written user files, and failing closed is the right default there.Verification
npx vitest run→ 405 files, 4854 passed, 1 skipped, 0 failed (the E2E now passes).npm run typecheckclean. Also verified by hand: install → update against the real bookmyshow plugin now succeeds.🤖 Generated with Claude Code