indexer: align affectedManifests call with matcher definitions#1514
indexer: align affectedManifests call with matcher definitions#1514github-actions[bot] merged 5 commits intoquay:mainfrom
Conversation
5a04fb9 to
8e13b8b
Compare
8e13b8b to
8974b60
Compare
be269df to
1d486b5
Compare
c8d5d0b to
aff1b5f
Compare
|
Execution Time not representative as it's from a small instance, but the output is still useful |
aff1b5f to
2821073
Compare
f20042c to
6b8bff1
Compare
|
What's the thinking on splitting the tests across two different packages? |
The idea is that any tests that call "meta" code should be at the root level |
6b8bff1 to
4e00e99
Compare
b577698 to
146e1ce
Compare
146e1ce to
37e57d9
Compare
|
|
||
| // AffectedManifests mocks base method. | ||
| func (m *MockStore) AffectedManifests(arg0 context.Context, arg1 claircore.Vulnerability, arg2 claircore.CheckVulnernableFunc) ([]claircore.Digest, error) { | ||
| func (m *MockStore) AffectedManifests(ctx context.Context, v claircore.Vulnerability) ([]claircore.Digest, error) { |
There was a problem hiding this comment.
This signature has also changed
There was a problem hiding this comment.
Which IIRC is why the mocks were recreated
0e5ded5 to
bf6c227
Compare
hdonnay
left a comment
There was a problem hiding this comment.
LGTM
One comment about the metrics, just to make sure it's on purpose.
This change attempts to make the matching process consistent across both the vulnerability matching and the manifest matching that is performed by the affectedManifests logic. It reduces the number of queries to 1 per matcher per vulnerability. Note: the metric indexer.affectedmanifests_duration_seconds is now called datastore.getaffectedmanifests_duration_seconds and indexer.affectedmanifests_total is now called datastore.getaffectedmanifests_total. indexer.protorecord_total and indexer.protorecord_duration_seconds are removed. Signed-off-by: crozzy <joseph.crosland@gmail.com>
Update mocks to align with AffectedManifest() changes. This is also using a newer version of mockgen. Signed-off-by: crozzy <joseph.crosland@gmail.com>
Tests that do integration like behaviour should be in the root /test directory. Signed-off-by: crozzy <joseph.crosland@gmail.com>
Tests that do integration like behaviour should be in the root /test directory. Signed-off-by: crozzy <joseph.crosland@gmail.com>
Incidental import formats. Signed-off-by: crozzy <joseph.crosland@gmail.com>
bf6c227 to
91c124f
Compare
|
/fast-forward |
This change attempts to make the matching process consistent across both the vulnerability matching and the manifest matching that is performed by the affectedManifests logic. It reduces the number of queries to 1 per matcher per vulnerability.