Repository navigation
fix: write registry allowScripts keys under install-strategy=linked - #10059
Open
github-actions[bot] wants to merge 1 commit into
Open
github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
…9941) Under `install-strategy=linked`, `npm install-scripts approve <pkg>` wrote verbose, duplicated `file:` entries pointing into `node_modules/.store` (one per incoming symlink depth) instead of `name@version` pins, and those store-path entries never matched at install time. There are two root causes. In `findNodesForArgs` (allow-scripts-cmd.js), positional args matched every `Link` pointing at the store package; each Link's relative `file:.store/...` resolved spec became its own policy key and could even strip the correct pin as stale. In `script-allowed.js`, a store package has no `edgesIn` (they land on its incoming Links), so `isRegistryNode` refused registry keys, and `ls`, the post-install advisory, and prune treated a correct `name@version` entry as matching nothing. The fix skips `Link` nodes when matching positional args, mirroring `collectUnreviewedScripts` and prune, so approvals key off the real package's trusted registry identity. `isRegistryNode` and `nameFromEdges` now delegate edge-based checks to a link target's incoming Links, which also covers `omit-lockfile-registry-resolved` (approve by name, like the hoisted #9558 path). `resolvedSourceSpecs` no longer fabricates `file:` specs from links into the store, so store packages are never keyed by store paths and prune cleans up the buggy entries while keeping the valid pin. ## References Fixes #9939 (cherry picked from commit b317f16)
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.
Backport of #9941 to
release/v11.