Skip to content

ROX-33608: hook VM pipelines to V2 datastores#19441

Draft
dashrews78 wants to merge 3 commits intomasterfrom
dashrews/vm-v2-pipelines-33608
Draft

ROX-33608: hook VM pipelines to V2 datastores#19441
dashrews78 wants to merge 3 commits intomasterfrom
dashrews/vm-v2-pipelines-33608

Conversation

@dashrews78
Copy link
Contributor

@dashrews78 dashrews78 commented Mar 16, 2026

Description

When the feature flag is OFF, both virtualmachines and virtualmachineindex
pipelines write to the v1 datastore (unchanged behavior). When ON, they
write exclusively to the v2 datastore using normalized scan parts.

Adds internaltostorage.VirtualMachineV2() conversion for sensor VM events,
and v1tov2storage.ScanPartsFromV1Scan() to split embedded v1 scans into
normalized v2 records (scan, components, CVEs) with CVSS/NVD extraction.

The v2 datastore singleton returns nil when the flag is off, so the
pipelines branch on whether the v2 store is non-nil rather than checking
the flag directly.

Partially generated by AI.

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

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

change me!

@dashrews78
Copy link
Contributor Author

dashrews78 commented Mar 16, 2026

@openshift-ci
Copy link

openshift-ci bot commented Mar 16, 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

@dashrews78 dashrews78 force-pushed the dashrews/vm-v2-scan-datastore-33385 branch from 829b61a to b2cc202 Compare March 16, 2026 16:52
@dashrews78 dashrews78 mentioned this pull request Mar 16, 2026
9 tasks
@rhacs-bot
Copy link
Contributor

rhacs-bot commented Mar 16, 2026

Images are ready for the commit at 45d1b7a.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-355-g45d1b7aee4.

@codecov
Copy link

codecov bot commented Mar 16, 2026

Codecov Report

❌ Patch coverage is 97.71689% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.37%. Comparing base (6d875de) to head (45d1b7a).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
central/convert/v1tov2storage/vm_scan_parts.go 97.20% 3 Missing and 1 partial ⚠️
...ensor/service/pipeline/virtualmachines/pipeline.go 97.14% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #19441      +/-   ##
==========================================
+ Coverage   49.31%   49.37%   +0.05%     
==========================================
  Files        2722     2724       +2     
  Lines      205171   205385     +214     
==========================================
+ Hits       101190   101407     +217     
+ Misses      96446    96444       -2     
+ Partials     7535     7534       -1     
Flag Coverage Δ
go-unit-tests 49.37% <97.71%> (+0.05%) ⬆️

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.

Base automatically changed from dashrews/vm-v2-scan-datastore-33385 to master March 17, 2026 10:23
@dashrews78 dashrews78 force-pushed the dashrews/vm-v2-pipelines-33608 branch from da73d8d to 14b0d81 Compare March 17, 2026 13:15
dashrews78 and others added 3 commits March 17, 2026 13:16
When the feature flag is OFF, both virtualmachines and virtualmachineindex
pipelines write to the v1 datastore (unchanged behavior). When ON, they
write exclusively to the v2 datastore using normalized scan parts.

Adds internaltostorage.VirtualMachineV2() conversion for sensor VM events,
and v1tov2storage.ScanPartsFromV1Scan() to split embedded v1 scans into
normalized v2 records (scan, components, CVEs) with CVSS/NVD extraction.

The v2 datastore singleton returns nil when the flag is off, so the
pipelines branch on whether the v2 store is non-nil rather than checking
the flag directly.

Partially generated by AI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace assert.Equal with protoassert.SlicesEqual when comparing
proto message slices to satisfy the golangci-lint proto comparison check.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dashrews78 dashrews78 force-pushed the dashrews/vm-v2-pipelines-33608 branch from 14b0d81 to 45d1b7a Compare March 17, 2026 17:44
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.

2 participants