Skip to content
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

Adding the ability to retrieve remote licenses for yarn.lock #2338

Merged
merged 7 commits into from
Dec 5, 2023

Conversation

coheigea
Copy link
Contributor

Retrieve remote licenses from https://registry.npmjs.com for packages defined in yarn.lock.

It's very slow when enabled so maybe there is some caching mechanism that could be employed...

@coheigea coheigea force-pushed the coheigea/yarn-licenses branch 3 times, most recently from e6c5ae9 to 74b36ba Compare November 20, 2023 07:29
Signed-off-by: Colm O hEigeartaigh <coheigea@apache.org>
@coheigea coheigea force-pushed the coheigea/yarn-licenses branch from 74b36ba to bf33ac8 Compare November 20, 2023 07:42
@spiffcs
Copy link
Contributor

spiffcs commented Nov 29, 2023

👋 sorry @coheigea I can take a look at this today - thanks for all the support on the license gaps! I really appreciate the PR for this. I'll also try and carve out some time for the two other license PR that are on syft right now

@spiffcs
Copy link
Contributor

spiffcs commented Nov 29, 2023

This is so far a 👍 from me! I've got a few more things to wrap up for the day, but will take more time tonight to write tests for this and clean up the conflicts

* main: (40 commits)
  chore(deps): bump anchore/sbom-action from 0.15.0 to 0.15.1 (anchore#2392)
  Retrieve remote licenses using pom.properties when there is no pom.xml (anchore#2315)
  fix(java): improve identification for org.apache.tapestry artifacts (anchore#2384)
  fix(java): improve identification for io.ratpack artifacts (anchore#2379)
  fix(java): improve identification for org.apache.cassandra artifacts (anchore#2386)
  fix(java): improve identification for org.neo4j.procedure artifacts (anchore#2388)
  fix: bump fangs for ptr summarize fix (anchore#2387)
  fix(java): improve identification for org.elasticsearch artifacts (anchore#2383)
  fix(java): improve identification for org.apache.geode artifacts (anchore#2382)
  fix(java): improve identification for org.apache.tomcat.embed artifacts (anchore#2381)
  fix(java): improve identification for io.projectreactor.netty artifacts (anchore#2378)
  fix(java): improve identification for org.eclipse.platform artifacts (anchore#2349)
  Generalize UI events for cataloging tasks (anchore#2369)
  chore(deps): update tools to latest versions (anchore#2376)
  chore(deps): bump github.com/google/go-containerregistry (anchore#2377)
  chore: fix tests failing due to Mac Rosetta cache (anchore#2374)
  fix: improve dotnet portable executable identification (anchore#2133)
  fix file metadata cataloger to use resolved locations (anchore#2370)
  fix: logging level for parsing potential PE files (anchore#2367)
  only remove breaking-change label when there are schema changes (anchore#2371)
  ...

Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
@spiffcs
Copy link
Contributor

spiffcs commented Dec 5, 2023

Merged and fixed conflicts with some of the recent plumbing changes in how catalogers work. I made the new yarn config optional for this merge commit and hard coded the online to false to just get everything square. Taking another pass now with updating tests and cataloger architecture to match the latest and greatest. Thanks again for all the contributions @coheigea!

Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
@spiffcs
Copy link
Contributor

spiffcs commented Dec 5, 2023

Just rewiring the cataloger a little now to make it easier to test the network call now like we did the archive parser for maven. This means adding a new baseURL for the config where users who host packages at other registries can set that up. It also allows us to do dependency injection for the internal servemux URL that get's setup during the test

Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Comment on lines 13 to 19
// NewCatalogerOpts create a NewCatalogerOpts with default options, which includes:
// - searchRemoteLicenses is false
func NewCatalogerOpts() CatalogerConfig {
g := CatalogerConfig{}

return g
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this function should get removed in favor of consumers using the DefaultCatalogerConfig() below, which is consistent with the other cataloger configs, e.g. javaCataloger.DefaultArchiveCatalogerConfig() and golangCataloger.DefaultCatalogerConfig()

Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Copy link
Contributor

@kzantow kzantow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@spiffcs spiffcs merged commit 16dee41 into anchore:main Dec 5, 2023
10 checks passed
@spiffcs spiffcs self-assigned this Dec 5, 2023
@coheigea coheigea deleted the coheigea/yarn-licenses branch December 6, 2023 06:54
@willmurphyscode willmurphyscode added the enhancement New feature or request label Dec 21, 2023
GijsCalis pushed a commit to GijsCalis/syft that referenced this pull request Feb 19, 2024
…2338)

---------

Signed-off-by: Colm O hEigeartaigh <coheigea@apache.org>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Co-authored-by: Christopher Phillips <christopher.phillips@anchore.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants