snyk / nodejs-lockfile-parser

Generate a Snyk dependency tree from package-lock.json or yarn.lock file
Other
59 stars 28 forks source link

feat: allow deeply out of sync lockfile #119

Closed lili2311 closed 2 years ago

lili2311 commented 3 years ago

What this does

Yarn workspaces introduces complexity where local packages are mentioned as required dependency but are not present on the lockfile this means that the lockfile is considered deeply out of sync by the plugin.

Allow to skip the check if user is calling with StrictOutOfSync=false not just for top level dependencies but also the transitives as a package can rely on another local workspace which lists a workspace as a dep.

Notes for the reviewer

We already allow skipping out of sync check/error but we still had a place where it is deeper than the top level dependencies that would also throw. Unfortunately Yarn Workspace is indeed hitting this error.

The changes allow us to successfully scan https://github.com/RoadieHQ/backstage-plugin-travis-ci which previously failed

More information

Screenshots

Before

CleanShot 2021-08-10 at 12 12 44@2x

After

CleanShot 2021-08-10 at 12 47 14@2x
snyksec commented 2 years ago

:tada: This PR is included in version 1.37.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: