Skip to content

ROX-32714: Update graphQL postgres tests to work with imageV2 model#19477

Open
charmik-redhat wants to merge 3 commits intomasterfrom
ROX-32714/update-graphQL-postgres-tests
Open

ROX-32714: Update graphQL postgres tests to work with imageV2 model#19477
charmik-redhat wants to merge 3 commits intomasterfrom
ROX-32714/update-graphQL-postgres-tests

Conversation

@charmik-redhat
Copy link
Contributor

@charmik-redhat charmik-redhat commented Mar 18, 2026

Description

This PR updates graphql resolvers tests to work with imageV2 model enabled.

These changes were assisted by Cursor

User-facing documentation

  • CHANGELOG update is not needed
  • documentation is not needed

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

Ran the updated tests with ROX_FLATTEN_IMAGE_DATA enabled and disabled.

@rhacs-bot
Copy link
Contributor

rhacs-bot commented Mar 18, 2026

Images are ready for the commit at c7a4430.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-362-gc7a443004f.

@charmik-redhat charmik-redhat requested a review from a team as a code owner March 18, 2026 09:12
@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

❌ Patch coverage is 9.09091% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.25%. Comparing base (c405ffd) to head (c7a4430).
⚠️ Report is 12 commits behind head on master.

Files with missing lines Patch % Lines
central/graphql/resolvers/test_utils.go 0.00% 9 Missing ⚠️
central/graphql/resolvers/test_setup_utils.go 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #19477      +/-   ##
==========================================
- Coverage   49.32%   49.25%   -0.08%     
==========================================
  Files        2724     2725       +1     
  Lines      205227   205609     +382     
==========================================
+ Hits       101231   101264      +33     
- Misses      96459    96804     +345     
- Partials     7537     7541       +4     
Flag Coverage Δ
go-unit-tests 49.25% <9.09%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

imageWithScanQuery = `
query getImages($query: String, $pagination: Pagination) {
images(query: $query, pagination: $pagination) {
images(query: $query, pagination: $pagination) {
Copy link
Contributor

Choose a reason for hiding this comment

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

these trailing spaces are probably your style issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, cursor adds those for some reason

imageDataStore := imageMocks.NewMockDataStore(ctrl)
imageV2DataStore := imageV2Mocks.NewMockDataStore(ctrl)
cveMatcher, err := matcher.NewCVEMatcher(clusterDataStore, nsDataStore, imageDataStore, imageV2DataStore)
cveMatcher, err := matcher.NewCVEMatcher(clusterDataStore, nsDataStore, imageDataStore, nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the deal with this one? Would we not need to use image v2 with this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, we should use imageV2 there. I cherry-picked the changes from an older PR which just set imageV2Datastore to nil.
Removed this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants