Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ROX-33207: Fix ImageV2 SearchListImages query#19084

Open
ajheflin wants to merge 2 commits intomasterstackrox/stackrox:masterfrom
ajheflin/fix-exclude-images-requeststackrox/stackrox:ajheflin/fix-exclude-images-requestCopy head branch name to clipboard
Open

ROX-33207: Fix ImageV2 SearchListImages query#19084
ajheflin wants to merge 2 commits intomasterstackrox/stackrox:masterfrom
ajheflin/fix-exclude-images-requeststackrox/stackrox:ajheflin/fix-exclude-images-requestCopy head branch name to clipboard

Conversation

@ajheflin
Copy link
Contributor

@ajheflin ajheflin commented Feb 18, 2026

Description

Fixes the ImageV2 SearchListImages query to not use a derived field and instead count a the component IDs using an aggregate function, and then adding the appropriate fields to the group by to make Postgres happy.

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

Ran TestSearchListImages for ImageV2 datastore with ROX_FLATTEN_IMAGE_DATA on and verified that the test passes.

@openshift-ci
Copy link

openshift-ci bot commented Feb 18, 2026

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

@ajheflin ajheflin marked this pull request as ready for review February 18, 2026 15:27
@ajheflin ajheflin requested a review from a team as a code owner February 18, 2026 15:27
@rhacs-bot
Copy link
Contributor

rhacs-bot commented Feb 18, 2026

Images are ready for the commit at 1321ad1.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-122-g1321ad1203.

@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 49.52%. Comparing base (733041a) to head (1321ad1).
⚠️ Report is 23 commits behind head on master.

Files with missing lines Patch % Lines
central/imagev2/datastore/store/postgres/store.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #19084      +/-   ##
==========================================
+ Coverage   49.49%   49.52%   +0.02%     
==========================================
  Files        2668     2671       +3     
  Lines      201435   201582     +147     
==========================================
+ Hits        99706    99839     +133     
- Misses      94281    94288       +7     
- Partials     7448     7455       +7     
Flag Coverage Δ
go-unit-tests 49.52% <0.00%> (+0.02%) ⬆️

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.

@ajheflin ajheflin force-pushed the ajheflin/fix-exclude-images-request branch from 6d6eb41 to d3da3d5 Compare February 18, 2026 17:31
@ajheflin ajheflin changed the title ROX-33207: fix derived field labels missing aggregate ROX-33207: Fix ImageV2 SearchListImages query Feb 18, 2026
Copy link
Contributor

Choose a reason for hiding this comment

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

You probably don't need an aggregate and group by here. image_v2.proto already has a regular field for Component Count. The search framework is not using that and trying to join with components table because Component Count is also a derived field in search options . Just rename the field in image_v2.proto to Image Component Count and add a regular search option for that and the query should use the cached field just like it does for CVECount and FixableCVECount.

int32 component_count = 1; // @gotags: search:"Component Count,hidden"

ComponentCount = newDerivedFieldLabel("Component Count", ComponentID, CountDerivationType)

@ajheflin ajheflin force-pushed the ajheflin/fix-exclude-images-request branch from 1f5289c to 1321ad1 Compare February 18, 2026 23:03
@openshift-ci
Copy link

openshift-ci bot commented Feb 19, 2026

@ajheflin: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/gke-operator-e2e-tests 1321ad1 link false /test gke-operator-e2e-tests
ci/prow/gke-scanner-v4-install-tests 1321ad1 link false /test gke-scanner-v4-install-tests
ci/prow/ocp-4-12-qa-e2e-tests 1321ad1 link false /test ocp-4-12-qa-e2e-tests
ci/prow/ocp-4-12-nongroovy-e2e-tests 1321ad1 link false /test ocp-4-12-nongroovy-e2e-tests
ci/prow/ocp-4-20-scanner-v4-install-tests 1321ad1 link false /test ocp-4-20-scanner-v4-install-tests
ci/prow/ocp-4-20-ui-e2e-tests 1321ad1 link false /test ocp-4-20-ui-e2e-tests
ci/prow/ocp-4-20-qa-e2e-tests 1321ad1 link false /test ocp-4-20-qa-e2e-tests
ci/prow/ocp-4-20-operator-e2e-tests 1321ad1 link false /test ocp-4-20-operator-e2e-tests
ci/prow/ocp-4-12-scanner-v4-install-tests 1321ad1 link false /test ocp-4-12-scanner-v4-install-tests
ci/prow/ocp-4-12-operator-e2e-tests 1321ad1 link false /test ocp-4-12-operator-e2e-tests
ci/prow/ocp-4-20-nongroovy-e2e-tests 1321ad1 link false /test ocp-4-20-nongroovy-e2e-tests

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Copy link
Contributor

@dashrews78 dashrews78 left a comment

Choose a reason for hiding this comment

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

LGTM, assuming you ran the datastore test with the image feature flag on.

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

Comments

Close sidebar
Morty Proxy This is a proxified and sanitized view of the page, visit original site.