ROX-33404: Implement custom VM v2 store#19240
Draft
dashrews78 wants to merge 2 commits intodashrews/vm-v2-generic-storesfrom
Draft
ROX-33404: Implement custom VM v2 store#19240dashrews78 wants to merge 2 commits intodashrews/vm-v2-generic-storesfrom
dashrews78 wants to merge 2 commits intodashrews/vm-v2-generic-storesfrom
Conversation
Replace the generated VM v2 postgres store with a custom implementation that follows the image store pattern. The custom store: - Detects whether VM or scan data changed via hash comparison before writing - Performs timestamp-only updates when nothing changed (UpsertVM, UpsertScan) - Preserves the oldest CVE created_at across delete/re-insert cycles - Wraps all writes in a single database transaction with keyFence locking - Uses COPY FROM for batched component and CVE inserts The scan hash covers only content-meaningful fields (name, version, CVE identifier, severity, etc.) and excludes generated UUIDs, since scanners produce new IDs each run. Also registers missing VM v2 search field labels (Guest OS, Virtual Machine State, Virtual Machine Scan Time, Virtual Machine Top CVSS) in pkg/search/options.go. Prompt: implement the VM v2 custom store (store layer only) following the image store pattern with hash-based deduplication and CVE timestamp preservation. Partially generated by AI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Skipping CI for Draft Pull Request. |
Contributor
Author
|
This change is part of the following stack: Change managed by git-spice. |
This was referenced Feb 27, 2026
Contributor
|
Images are ready for the commit at 543b531. To use with deploy scripts, first |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dashrews/vm-v2-generic-stores #19240 +/- ##
================================================================
Coverage ? 49.60%
================================================================
Files ? 2683
Lines ? 202675
Branches ? 0
================================================================
Hits ? 100539
Misses ? 94633
Partials ? 7503
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:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement custom VM v2 store with hash-based change detection
Replace the generated VM v2 postgres store with a custom implementation
that follows the image store pattern. The custom store:
The scan hash covers only content-meaningful fields (name, version, CVE
identifier, severity, etc.) and excludes generated UUIDs, since scanners
produce new IDs each run.
Also registers missing VM v2 search field labels (Guest OS, Virtual Machine
State, Virtual Machine Scan Time, Virtual Machine Top CVSS) in
pkg/search/options.go.
Prompt: implement the VM v2 custom store (store layer only) following the
image store pattern with hash-based deduplication and CVE timestamp
preservation.
Partially generated by AI.
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
gen mocks
Description
change me!
User-facing documentation
Testing and quality
Automated testing
How I validated my change
change me!