feat(db): add indexed CVE column to ImageCVEInfo table#18822
feat(db): add indexed CVE column to ImageCVEInfo table#18822
Conversation
Add a dedicated `cve` column with btree index to ImageCVEInfo table to enable efficient lookups by CVE name without parsing the composite ID. This allows queries like: SELECT min(first_system_occurrence) FROM image_cve_infos WHERE cve=$1; Previously, the CVE was only stored as part of the composite primary key (cve#package#datasource), requiring string parsing for CVE lookups. Changes: - Add cve field (field #4) to ImageCVEInfo proto with btree index - Populate Cve field in both image datastore implementations - Update tests to include the new field - Regenerate postgres schema and proto bindings Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Skipping CI for Draft Pull Request. |
|
Should check with @charmik-redhat to make sure that search tag won't cause us issues with the join logic. I'm pretty sure this is OK because the image info schema doesn't reference any other schema so the search framework should not find any random joins. |
|
Images are ready for the commit at 7cb5c33. To use with deploy scripts, first |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #18822 +/- ##
==========================================
+ Coverage 49.38% 49.40% +0.01%
==========================================
Files 2659 2659
Lines 200749 200615 -134
==========================================
- Hits 99139 99106 -33
+ Misses 94169 94092 -77
+ Partials 7441 7417 -24
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I asked you the same thing in another comment lol The getJoinsAndFields func needs a root schema and this table isn't related to any other tables. So it shouldn't select this table to join with others. |
The previous commit had alignment padding in the proto-generated file that differs from what the CI protoc version produces. Regenerated to fix the check-generated-files CI failure. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
@ajheflin: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
/retest |
|
The backport to To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release-4.10 release-4.10
# Navigate to the new working tree
cd .worktrees/backport-release-4.10
# Create a new branch
git switch --create backport-18822-to-release-4.10
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 20cfa42f68facbae0370a14055b232308f9577f9
# Push it to GitHub
git push --set-upstream origin backport-18822-to-release-4.10
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release-4.10Then, create a pull request where the |
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> (cherry picked from commit 20cfa42)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> (cherry picked from commit 20cfa42)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> (cherry picked from commit 20cfa42)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Description
Add a dedicated
cvecolumn with btree index to theImageCVEInfotable to enable efficient lookups by CVE name without parsing the composite ID.This allows queries like:
Previously, the CVE was only stored as part of the composite primary key (
cve#package#datasource), requiring string parsing for CVE lookups.Changes:
cvefield (field 4) toImageCVEInfoproto with btree indexCvefield in both image datastore implementationsUser-facing documentation
Testing and quality
Automated testing
How I validated my change
sql_integrationbuild tag🤖 Generated with Claude Code