-
Notifications
You must be signed in to change notification settings - Fork 179
[ANE-2235] Fix PNPM v9 lockfile parsing issues with package names/versions #1531
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
Draft
ryanlink
wants to merge
13
commits into
master
Choose a base branch
from
pnpm-9-lockfile-fix
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
ccc9f49
to
e8d9005
Compare
…ce unsafe head, fix formatting
…ndefined with invalidDependency
9ae886c
to
67fd875
Compare
… for both real-world pnpm repo and test dependencies lockfiles
… unused imports, fix name shadowing warnings, update v6 lockfile test to expect correct dependencies, fixed formatting
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.
Overview
This PR fixes issues with PNPM v9 lockfile parsing, specifically addressing problems with incorrect package name and version handling.
Acceptance criteria
When analyzing a project with a PNPM v9 lockfile:
npm+package-name$version
[email protected]
Dependencies with special formats should be correctly handled:
@pnpm/[email protected]
) should appear asnpm+hosted-git-info$1.0.0
[email protected]
) should appear asnpm+safe-execa$0.1.2
Link references should be properly processed:
link:../cli-meta
) should not result in malformed locatorsThe FOSSA CLI should successfully build and run all PNPM-related unit tests
When analyzing the PNPM repository itself (or any large project using PNPM v9), all dependencies should be properly resolved with correctly formatted locators
Testing plan
Tested with a real PNPM v9 lockfile from the PNPM repository itself, which demonstrated correct dependency resolution with properly formatted FOSSA locators.
Risks
There is one dependency
safe-execa
in the test v9 lockfile that we're generating a malformed locator for:[email protected]
It should be:
[email protected]
.Metrics
References
ANE-2235: Support pnpm@9 and pnpm-lockfile v9
Checklist
docs/
.docs/README.ms
and gave consideration to how discoverable or not my documentation is.Changelog.md
. If this PR did not mark a release, I added my changes into an## Unreleased
section at the top..fossa.yml
orfossa-deps.{json.yml}
, I updateddocs/references/files/*.schema.json
AND I have updated example files used byfossa init
command. You may also need to update these if you have added/removed new dependency type (e.g.pip
) or analysis target type (e.g.poetry
).docs/references/subcommands/<subcommand>.md
.