feat: add support for PNPM v9 lockfiles#934
Merged
oliverchang merged 13 commits intogoogle:mainfrom Apr 30, 2024
Merged
Conversation
cuixq
approved these changes
Apr 19, 2024
Contributor
There was a problem hiding this comment.
since there are same codes among the tests, shall we factor out the common parts? only the file path and expected packages details are different
Collaborator
Author
There was a problem hiding this comment.
if this wasn't Go I'd be more inclined to say "yes", but I think trying to refactor this would just be very messy and so it's probably best to just leave it for now given I've already written out the tests and we're not expecting them to change.
oliverchang
approved these changes
Apr 23, 2024
Collaborator
oliverchang
left a comment
There was a problem hiding this comment.
LGTM with just one nit, thanks!
oliverchang
approved these changes
Apr 30, 2024
3 tasks
josieang
pushed a commit
to josieang/osv-scanner
that referenced
this pull request
Jun 6, 2024
This adds support for v9 PNPM lockfiles which has a different structure that looks to be similar to Yarn v2+ lockfiles. I can't find a lot of clear detail on the actual changes so I've started with just a "best effort" approach - most notably this means dev grouping is lost because that detail is not represented in the new format; we could probably successfully determine it by checking in `snapshots` but that would be a lot more work so I'm leaving that as a follow up. The good news is it seems like going forward the lockfile version should match the major verison of PNPM (pnpm/pnpm#7861) which should make it easier to track these, and we can probably drop explicit support for older versions in v2. Resolves google#931
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.
This adds support for v9 PNPM lockfiles which has a different structure that looks to be similar to Yarn v2+ lockfiles.
I can't find a lot of clear detail on the actual changes so I've started with just a "best effort" approach - most notably this means dev grouping is lost because that detail is not represented in the new format; we could probably successfully determine it by checking in
snapshotsbut that would be a lot more work so I'm leaving that as a follow up.The good news is it seems like going forward the lockfile version should match the major verison of PNPM (pnpm/pnpm#7861) which should make it easier to track these, and we can probably drop explicit support for older versions in v2.
Resolves #931