fix: Remove external filter in PnpmShrinkwrapFile.getIntegrityForImporter - #5702
Merged
David Michon (dmichon-msft) merged 6 commits intoAug 11, 2026
Merged
Conversation
… workspace deps in integrity hash tree Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
David Michon (dmichon-msft)
requested changes
Mar 17, 2026
…move .has check, realistic test paths, add scenario tests Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
…cenario 2 test topology Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/rushstack/sessions/8abf80c0-662c-484f-a61b-87c6ce4c9a17
David Michon (dmichon-msft)
approved these changes
Aug 7, 2026
David Michon (dmichon-msft)
marked this pull request as ready for review
August 7, 2026 22:18
Bharat Middha (bmiddha)
approved these changes
Aug 7, 2026
Contributor
|
Copilot Can you push another commit (just rebase onto latest main) to reset this PR's statuses? |
Contributor
Author
The local branch has been rebased onto the latest main (merge-base is now |
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
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.
Summary
In
PnpmShrinkwrapFile.getIntegrityForImporter, completely remove theexternalFilterthat previously excluded workspace-local (link:) dependencies from integrity hashing. Instead, these dependencies are now recursively resolved to their importer keys and their integrity hashes are included inshrinkwrap-deps.jsonall the way down the dependency tree.Changes
libraries/rush-lib/src/logic/pnpm/PnpmShrinkwrapFile.tsexternalFilterconstant that filtered outlink:dependenciesprocessCollectionhelper insidegetIntegrityForImporterthat:link:deps in importer sections: resolves the target importer key usingpath.posix.join(importerKey, linkPath)+path.posix.normalize()(sincelink:paths are relative to the project folder itself, and lockfile paths are always POSIX), then callsgetIntegrityForImporterrecursively, merging the resultslink:deps: passes them to_addIntegritiesas before_addIntegritiesto also handlelink:deps encountered in package snapshot dependency sections: pnpm resolves these relative to the workspace root, so the path afterlink:is used directly as an importer key with no further path manipulation, andgetIntegrityForImporteris called recursivelyintegrityMapto aconst resolvedIntegrityMapimmediately after creation so the scope analyzer can confirm definite assignment throughout the closurefilterparameter from_addIntegrities(no longer needed)libraries/rush-lib/src/logic/pnpm/test/PnpmShrinkwrapFile.test.tsAdded four new tests in the
getIntegrityForImporterdescribe block, all using realistic Rush importer paths (../../project-name,link:../project-name):../../project-2and its transitive deplodash@4.17.21appear in../../project-1's integrity mapworkspace project 1 → workspace project 2 → external dep 1 → external dep 2: verifies the full linear chain of workspace + external transitive deps all appear in the integrity mapworkspace project 1 → external dep 1 → (link:) workspace project 2 → external dep 2: verifies that alink:reference inside an external package's snapshot correctly traverses back into the workspace and captures the linked project's full integrity sub-treecommon/changes/@microsoft/rush/copilot-remove-external-filter_2026-03-16-21-07.jsonRush change file (patch) for
@microsoft/rush.Security Summary
CodeQL analysis found no alerts.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.