-
Notifications
You must be signed in to change notification settings - Fork 653
[rush-lib] Hash full shrinkwrap entry to detect sub-dependency resolution changes #5468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+141
−51
Conversation
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
…hanges The logic in _getIntegrityForPackage and _addDependencyRecursive was using resolution.integrity when available, which does not capture changes to sub-dependency resolutions. This change ensures the entire shrinkwrap entry is hashed, including the dependencies field which reflects resolved versions. Co-authored-by: dmichon-msft <[email protected]>
Copilot
AI
changed the title
[WIP] Fix integrity hash generation for dependency resolution changes
[rush-lib] Hash full shrinkwrap entry to detect sub-dependency resolution changes
Nov 25, 2025
Copilot finished work on behalf of
dmichon-msft
November 25, 2025 20:24
Contributor
|
@copilot Run |
Co-authored-by: dmichon-msft <[email protected]>
Contributor
Author
Copilot finished work on behalf of
dmichon-msft
November 25, 2025 21:30
bmiddha
approved these changes
Nov 25, 2025
D4N14L
approved these changes
Nov 25, 2025
common/changes/@microsoft/rush/copilot-fix-resolutions-dependency-hash_2025-11-25-21-27.json
Show resolved
Hide resolved
Co-authored-by: dmichon-msft <[email protected]>
Copilot finished work on behalf of
dmichon-msft
November 25, 2025 23:49
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
Fixed the issue where
_getIntegrityForPackageand_addDependencyRecursivewere usingresolution.integritywhen available, which doesn't capture changes to sub-dependency resolutions. Now the full shrinkwrap entry is always hashed, ensuring any change to dependency resolution is detected by build orchestrators.Details
Changed both
_getIntegrityForPackage(workspace path) and_addDependencyRecursive(legacy path) to always hash the fullshrinkwrapEntryobject instead of usingresolution.integritydirectly:dependencies,optionalDependencies, andresolution, capturing any resolution changesbase64inPnpmShrinkwrapFile.ts,hexinPnpmProjectShrinkwrapFile.ts) for backward compatibilityCode Review Notes:
Two pre-existing concerns were identified:
PnpmShrinkwrapFile.tsusesbase64whilePnpmProjectShrinkwrapFile.tsuseshex. This inconsistency existed before this change and was preserved for backward compatibility.How it was tested
Impacted documentation
None
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.