Skip to content

ROX-31173: do not embed component in resolver context#17154

Merged
dashrews78 merged 14 commits intomasterfrom
dashrews/eliminate-query-time-embedded-component-conversion-31173
Oct 15, 2025
Merged

ROX-31173: do not embed component in resolver context#17154
dashrews78 merged 14 commits intomasterfrom
dashrews/eliminate-query-time-embedded-component-conversion-31173

Conversation

@dashrews78
Copy link
Contributor

@dashrews78 dashrews78 commented Oct 6, 2025

Description

Embedding the the EmbeddedScan Object into the image scan resolver caused us to have to convert between EmbeddedScanComponent objects and ImageComponent Objects needlessly. This is why we had to have the ID to get a deterministic ID. Without that requirement we can eliminate the hashing function in #17200. The reason it was embedded in this resolver to begin with was for performance, but that performance tradeoff is too much and was rarely used. Additionally the usage of that resolver in general is to populate deprecated dashboards and thus we don't get much value by caching that data.

Provided the UI and testing updates to no longer use the previously deprecated imageScan->Components and imageScan->components->vulns in favor of the ones in the new model.

Cursor assisted with the UI changes.

User-facing documentation

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

Worked through and openshift cluster making sure hopping the various screens worked. Also updated tests and such.

image image image image image

@dashrews78
Copy link
Contributor Author

dashrews78 commented Oct 6, 2025

This change is part of the following stack:

Change managed by git-spice.

@openshift-ci
Copy link

openshift-ci bot commented Oct 6, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@rhacs-bot
Copy link
Contributor

rhacs-bot commented Oct 6, 2025

Images are ready for the commit at 502f883.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.10.x-42-g502f883522.

@dashrews78 dashrews78 force-pushed the dashrews/eliminate-query-time-embedded-component-conversion-31173 branch from 02548fc to 75928a0 Compare October 8, 2025 19:04
@codecov
Copy link

codecov bot commented Oct 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.87%. Comparing base (c6cf33f) to head (502f883).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #17154      +/-   ##
==========================================
+ Coverage   48.86%   48.87%   +0.01%     
==========================================
  Files        2720     2720              
  Lines      203374   203193     -181     
==========================================
- Hits        99371    99305      -66     
+ Misses      96178    96093      -85     
+ Partials     7825     7795      -30     
Flag Coverage Δ
go-unit-tests 48.87% <100.00%> (+0.01%) ⬆️

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.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location> `central/graphql/resolvers/image_scan_test.go:106-110` </location>
<code_context>
 		return nil, err
 	}
 	if features.FlattenCVEData.Enabled() {
-		return getImageComponentV2Resolvers(resolver.ctx, resolver.root, resolver.data, query)
+		return resolver.root.ImageComponents(resolver.ctx, args)
 	}
 	return getImageComponentResolvers(resolver.ctx, resolver.root, resolver.data, query)
 }
</code_context>

<issue_to_address>
**suggestion (testing):** Missing negative test for FlattenCVEData feature flag disabled.

Please add a test case with FlattenCVEData disabled to verify correct behavior when the feature flag is off.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@dashrews78 dashrews78 marked this pull request as ready for review October 9, 2025 21:10
@dashrews78 dashrews78 changed the title ROX-31173: do not embed component in resolver context [WIP DO NOT REVIEW] ROX-31173: do not embed component in resolver context Oct 10, 2025
@dashrews78 dashrews78 requested review from a team and janisz as code owners October 10, 2025 00:07
@dashrews78 dashrews78 force-pushed the dashrews/eliminate-query-time-embedded-component-conversion-31173 branch from c58a45a to 718d07d Compare October 13, 2025 14:20
@dashrews78 dashrews78 changed the title [WIP DO NOT REVIEW] ROX-31173: do not embed component in resolver context ROX-31173: do not embed component in resolver context Oct 13, 2025
@dashrews78 dashrews78 requested a review from a team October 13, 2025 19:16
@dashrews78 dashrews78 force-pushed the dashrews/eliminate-query-time-embedded-component-conversion-31173 branch from 3e0ae95 to a8e3bf3 Compare October 14, 2025 10:23
@dvail dvail self-requested a review October 14, 2025 14:01
@dashrews78 dashrews78 force-pushed the dashrews/eliminate-query-time-embedded-component-conversion-31173 branch from a8e3bf3 to 4cda588 Compare October 14, 2025 15:33
Copy link
Contributor

@charmik-redhat charmik-redhat left a comment

Choose a reason for hiding this comment

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

Backend looks good. Wait for someone on the UI to approve too

Copy link
Contributor

@dvail dvail left a comment

Choose a reason for hiding this comment

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

UI side LGTM.

One comment that would be nice to change, but not super pressing due to it being in a deprecated section.

@dashrews78 dashrews78 force-pushed the dashrews/eliminate-query-time-embedded-component-conversion-31173 branch from 4cda588 to 3bbf294 Compare October 15, 2025 10:09
@dvail
Copy link
Contributor

dvail commented Oct 15, 2025

@dashrews78 The gke-ui-e2e-tests failures are almost definitely related to this. If you check out the video you can see that the images page in config mgmt is crashing.

@dashrews78
Copy link
Contributor Author

/test gke-upgrade-tests

@dashrews78 dashrews78 merged commit 18e65fa into master Oct 15, 2025
93 checks passed
@dashrews78 dashrews78 deleted the dashrews/eliminate-query-time-embedded-component-conversion-31173 branch October 15, 2025 18:54
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.

4 participants