-
Notifications
You must be signed in to change notification settings - Fork 376
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
refactor: Licence matcher #1491
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1491 +/- ##
==========================================
+ Coverage 66.84% 66.95% +0.10%
==========================================
Files 198 198
Lines 18650 18652 +2
==========================================
+ Hits 12467 12488 +21
+ Misses 5498 5483 -15
+ Partials 685 681 -4 ☔ View full report in Codecov by Sentry. |
// DepsDevLicenseMatcher implements the LicenseMatcher interface with a deps.dev client. | ||
// It sends out requests for every package version and does not perform caching. | ||
type DepsDevLicenseMatcher struct { | ||
Client *datasource.DepsDevAPIClient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think clients in internal/resolution/datasource
meant to be used for dependency resolution. considering we are going to use DepsDevAPICleint
for license matching as well, shall we move resolution/datasource
to datasource
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah probably a good idea, I'll create an issue for it to keep track, we can do it in a followup PR.
I am attempting to split a big refactor PR into several small pieces, this is part 4, which just removes the need for the osv package from many places since we are replacing it with the osvdev package. This mostly means user agent need to be passed in via the client instead of being pulled from a global variable (this was already started in part 3: #1491 )
Also partially removes the global user agent variable to be specificly passed in for every client.
Majority of the code in licencematcher.go is migrated from the deleted license.go file.