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

enrichers: Load enrichments from jsonblob storage #1166

Merged
merged 2 commits into from
Jan 11, 2024
Merged

Conversation

jvdm
Copy link
Contributor

@jvdm jvdm commented Dec 1, 2023

A patch to fix the following BUG:

// BUG(hank) The [Loader] type does not handle Enrichments.

@jvdm jvdm requested a review from a team as a code owner December 1, 2023 00:50
@jvdm jvdm requested review from hdonnay and removed request for a team December 1, 2023 00:50
@daynewlee daynewlee requested a review from crozzy December 1, 2023 22:26
Copy link

codecov bot commented Dec 2, 2023

Codecov Report

Attention: 17 lines in your changes are missing coverage. Please review.

Comparison is base (5f8f0e0) 52.20% compared to head (2ce795c) 52.43%.

Files Patch % Lines
libvuln/updates.go 0.00% 9 Missing ⚠️
libvuln/jsonblob/jsonblob.go 46.66% 6 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1166      +/-   ##
==========================================
+ Coverage   52.20%   52.43%   +0.22%     
==========================================
  Files         221      221              
  Lines       16883    16893      +10     
==========================================
+ Hits         8813     8857      +44     
+ Misses       7259     7224      -35     
- Partials      811      812       +1     

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

Comment on lines +52 to +61
var ref uuid.UUID
if e.Enrichment != nil {
if ref, err = s.UpdateEnrichments(ctx, e.Updater, e.Fingerprint, e.Enrichment); err != nil {
return fmt.Errorf("updating enrichements: %w", err)
}
}
if e.Vuln != nil {
if ref, err = s.UpdateVulnerabilities(ctx, e.Updater, e.Fingerprint, e.Vuln); err != nil {
return fmt.Errorf("updating vulnerabilities: %w", err)
}
Copy link
Member

Choose a reason for hiding this comment

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

I think this makes it technically possible to have both Vulnerabilites and Enrichments in the same UpdateOperation. Nothing in-tree would produce output that way, so I don't think this is a big deal.

Copy link
Member

@hdonnay hdonnay left a comment

Choose a reason for hiding this comment

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

LGTM pending rebase

@jvdm jvdm merged commit 7247afe into quay:main Jan 11, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants