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

feat(V2 Clients): Client refactor #1470

Merged
merged 16 commits into from
Jan 6, 2025
Merged

Conversation

another-rex
Copy link
Collaborator

@another-rex another-rex commented Dec 31, 2024

Second step of the client refactor after #1464

Changes:

  • vulnerability client interface as described in the design doc, this no longer performs paging by itself.
  • "Matchers" as implementations to the vulnerability interface
    • osvmatcher: Matcher that takes in a osv.dev client and gets/hydrates the vulns. This also performs paging.
    • localmatcher: Replacement/migrated version of the local package.

Commented out Local client in resolve package to be completed in the followup.

Followup: Decide and implement the VulnClients in resolution.

@codecov-commenter
Copy link

codecov-commenter commented Dec 31, 2024

Codecov Report

Attention: Patch coverage is 58.97436% with 144 lines in your changes missing coverage. Please review.

Project coverage is 67.02%. Comparing base (8685ceb) to head (68f51c7).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ternal/clients/clientimpl/osvmatcher/osvmatcher.go 57.63% 53 Missing and 8 partials ⚠️
internal/resolution/client/osv_offline_client.go 0.00% 34 Missing ⚠️
...al/clients/clientimpl/localmatcher/localmatcher.go 67.02% 25 Missing and 6 partials ⚠️
pkg/osvscanner/osvscanner.go 68.57% 8 Missing and 3 partials ⚠️
internal/clients/clientimpl/osvmatcher/errors.go 0.00% 4 Missing ⚠️
internal/clients/clientimpl/localmatcher/zip.go 92.00% 2 Missing ⚠️
internal/osvdev/osvdev.go 87.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1470      +/-   ##
==========================================
- Coverage   67.33%   67.02%   -0.32%     
==========================================
  Files         194      196       +2     
  Lines       18361    18478     +117     
==========================================
+ Hits        12363    12384      +21     
- Misses       5327     5416      +89     
- Partials      671      678       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@cuixq cuixq left a comment

Choose a reason for hiding this comment

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

Generally LGTM, just one question regarding the file structure: shall we put implementation the same folder as the interface?
when we have more interfaces and implementation in the future, it will be tricky to track which interface an implementation implements.

@another-rex
Copy link
Collaborator Author

shall we put implementation the same folder as the interface?

I'm thinking that the interfaces will be moved to osv-scalibr at some point, so we shouldn't couple them in the same package. They are already under the same parent directory of clients, I think that's probably as close as I can get them?

@another-rex
Copy link
Collaborator Author

Paging impl has been extracted and moved to the matcher rather than the client.

@another-rex another-rex enabled auto-merge (squash) January 6, 2025 05:18
@another-rex another-rex merged commit b5983bd into google:main Jan 6, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants