Skip to content

ROX-30352: add vmcve view layer for severity aggregations#19664

Draft
ajheflin wants to merge 1 commit intoaheflin/ROX-30352/vm-v2-service-protofrom
aheflin/ROX-30352/vm-v2-vmcve-view
Draft

ROX-30352: add vmcve view layer for severity aggregations#19664
ajheflin wants to merge 1 commit intoaheflin/ROX-30352/vm-v2-service-protofrom
aheflin/ROX-30352/vm-v2-vmcve-view

Conversation

@ajheflin
Copy link
Copy Markdown
Contributor

@ajheflin ajheflin commented Mar 27, 2026

Description

Part 2/6 of the VirtualMachineV2Service API stack (ROX-30352).

Adds a SQL view layer at central/views/vmcve/ following the established imagecve/nodecve pattern. Provides Count, CountBySeverity, Get, and GetVMIDs methods that aggregate CVE data across VMs using the VirtualMachineCVEV2 schema.

The direct vm_v2_id FK on the CVE table enables efficient VM-scoped queries without joining through scans/components. Multiple service endpoints in follow-up PRs depend on this view for severity-by-fixability aggregations.

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

Integration tests (sql_integration) to be added in a follow-up. View layer follows the same pattern as imagecve and nodecve which have comprehensive test coverage.

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

  • go build ./central/views/vmcve/... compiles cleanly
  • Mock generation via go generate succeeds

Add a SQL view layer for VM CVE data following the imagecve/nodecve
pattern. Provides Count, CountBySeverity, Get, and GetVMIDs methods
that aggregate CVE data across VMs using the VirtualMachineCVEV2 schema.

The direct vm_v2_id FK on the CVE table enables efficient VM-scoped
queries without joining through scans/components.

Partially generated by AI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@openshift-ci
Copy link
Copy Markdown

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 27, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a5169027-6b83-4b17-82f8-20e620533b1b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch aheflin/ROX-30352/vm-v2-vmcve-view

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@rhacs-bot
Copy link
Copy Markdown
Contributor

Images are ready for the commit at d5aaca5.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-473-gd5aaca5673.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.37%. Comparing base (faf5bbe) to head (d5aaca5).

Additional details and impacted files
@@                            Coverage Diff                            @@
##           aheflin/ROX-30352/vm-v2-service-proto   #19664      +/-   ##
=========================================================================
- Coverage                                  49.38%   49.37%   -0.01%     
=========================================================================
  Files                                       2743     2743              
  Lines                                     207037   207020      -17     
=========================================================================
- Hits                                      102235   102224      -11     
+ Misses                                     97219    97214       -5     
+ Partials                                    7583     7582       -1     
Flag Coverage Δ
go-unit-tests 49.37% <ø> (-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.

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