Updates parsing of yarn.lock to use resolved URLs that are pulled from yarn and npm registries#926
Conversation
2cebe1e to
42c0c21
Compare
yarn.lock to be solely based on resolved URLsyarn.lock to be use resolved URLs that are pulled from registry.yarnpkg.com
yarn.lock to be use resolved URLs that are pulled from registry.yarnpkg.comyarn.lock to use resolved URLs that are pulled from registry.yarnpkg.com
…lock` is from `registry.yarnpkg.com` Signed-off-by: Miki <amoo_miki@yahoo.com>
yarn.lock to use resolved URLs that are pulled from registry.yarnpkg.comyarn.lock to use resolved URLs that are pulled from yarn and npm registries
wagoodman
left a comment
There was a problem hiding this comment.
Clever fix! 🙌
I think the only caveat I see is that using the resolved URL will only match in cases where there is a match with yarnpkg.com or npmjs.org which means that self-hosts/alternative hosting of packages won't be able to leverage the URL.
|
Question about conflicts, from the existing test fixture: What is the right value here for the package name? |
Correct. For them, it will simply fallback to the name inferred from the identifier. If we find another registry with standardized naming conventions, the regex can be updated.
While I haven't seen a spec doc for the naming convention used, all the resolved URLs I have seen from NPM and Yarn registries have Of course , short of a spec doc from the registries, my 4000 cases of validation are not proof enough that an NPM/Yarn URL with a different structure doesn't exist. However, I think it is a strong indication that we shouldn't expect to see them. We have 3 options here:
While I think option 1 is perfect because I don't care for "whatever", I think option 2 will not detract from it but option 3 will encourage feedback. PS, I will look into the unit test failure. |
|
Approved - I'm updating the unit tests on this now |
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
* main: (70 commits) fix: add php catalogers to all catalogers (anchore#1065) feat: add use-all-catalogers flag (anchore#1050) Updates parsing of `yarn.lock` to use `resolved` URLs that are pulled from yarn and npm registries (anchore#926) remove OSS Meetup message (anchore#1057) add pom.xml cataloger (anchore#1055) Add support for CBL-Mariner distroless images (anchore#1045) Add catalogers configuration (anchore#1038) add template output (anchore#1051) update stereoscope to latest version (anchore#1052) update zip_read_closer to incorporate zip64 support (anchore#1041) Add pacman (alpm) parser support (anchore#943) Update of README.md (anchore#1027) bump cosign to v1.9.0 to resolve reporting of GHSA-66x3-6cw3-v5gj (anchore#1025) add workflows to test new project automation (anchore#1023) improve LanguageByName and add unit tests (anchore#1034) Read Description from dpkg status files (anchore#996) Add announcement for Anchore OSS Virtual Meetup (anchore#1033) add main module field to go bin metadata (anchore#1026) Add filters to package cataloger (anchore#1021) change draft to false for release process (anchore#1016) ... Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
… from yarn and npm registries (anchore#926) Co-authored-by: Christopher Phillips <christopher.phillips@anchore.com>
… from yarn and npm registries (anchore#926) Co-authored-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Miki amoo_miki@yahoo.com
The changes include:
yarn.lockfilesTestYarnPackageLockDirectoryvalidate the results against the fixtureResolves
#925