fix(ci): allow omitted bundled dependencies in lockfile validation - #9908
Open
arhxam wants to merge 2 commits into
Open
fix(ci): allow omitted bundled dependencies in lockfile validation#9908arhxam wants to merge 2 commits into
arhxam wants to merge 2 commits into
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
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.
What / Why
npm cican reject a lockfile thatnpm installjust generated when a dependency tarball contains bundled packages that are not independently recorded in the lockfile.The ideal tree exposes those extracted nodes with
inBundle: true, butvalidateLockfilecurrently treats every ideal-tree node without a virtual-tree entry as missing. This reportsEUSAGEeven though the parent tarball supplies the node and a clean install can proceed without resolving it from the registry.Change
inBundle.Testing
node . run test -- test/lib/utils/validate-lockfile.js --no-coveragenode . run test@aws-amplify/data-construct@1.17.7sequence locally: twonpm installruns followed bynpm ci. The unpatched CLI reports four missing@opentelemetry/core@2.0.0entries; this branch completesnpm ciand installs 219 packages.References
Fixes #9821
AI assistance
This change was developed with AI assistance. I reproduced the issue against the current
latestbranch, reviewed the implementation and diff, and ran the checks above locally.