Skip to content

ROX-30352: add V2 VM service with list and dashboard endpoints#19665

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

ROX-30352: add V2 VM service with list and dashboard endpoints#19665
ajheflin wants to merge 1 commit intoaheflin/ROX-30352/vm-v2-vmcve-viewfrom
aheflin/ROX-30352/vm-v2-service-scaffold

Conversation

@ajheflin
Copy link
Copy Markdown
Contributor

@ajheflin ajheflin commented Mar 27, 2026

Description

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

Adds the VirtualMachineV2Service scaffold with the first 3 non-conflicting endpoints:

  • ListVMs (GET /v2/virtualmachines/vms) - paginated VM list with per-VM severity counts and component scan counts
  • ListVMCVEs (GET /v2/virtualmachines/cves) - paginated CVE list across all VMs with severity aggregation
  • GetVMDashboardCounts (GET /v2/virtualmachines/summary) - total VM and CVE counts for dashboard tabs

The service is registered in central/main.go gated by the VirtualMachinesEnhancedDataModel feature flag. Unimplemented RPCs return Unimplemented via the embedded UnimplementedServer stub.

Includes conversion functions (central/convert/storagetov2/virtual_machine_v2.go) for storage V2 types to API response types and severity count aggregation helpers.

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

Service tests to be added in a follow-up.

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

How I validated my change

  • go build ./central/... compiles cleanly
  • Service registration verified in central/main.go

Add VirtualMachineV2Service scaffold with 3 non-conflicting endpoints:
- ListVMs (GET /v2/virtualmachines/vms) - paginated VM list with severity counts
- ListVMCVEs (GET /v2/virtualmachines/cves) - paginated CVE list across VMs
- GetVMDashboardCounts (GET /v2/virtualmachines/summary) - VM and CVE counts

The service is registered in central/main.go gated by the
VirtualMachinesEnhancedDataModel feature flag. Unimplemented RPCs
return Unimplemented via the embedded UnimplementedServer stub.

Includes conversion functions for storage V2 -> API V2 types and
severity count aggregation helpers.

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: 89766d2c-2aee-436c-90d7-b7a2d5fa5ea4

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-service-scaffold

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 c55c117.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-474-gc55c11724b.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 27, 2026

Codecov Report

❌ Patch coverage is 0% with 62 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.36%. Comparing base (d5aaca5) to head (c55c117).

Files with missing lines Patch % Lines
central/convert/storagetov2/virtual_machine_v2.go 0.00% 62 Missing ⚠️
Additional details and impacted files
@@                          Coverage Diff                           @@
##           aheflin/ROX-30352/vm-v2-vmcve-view   #19665      +/-   ##
======================================================================
- Coverage                               49.37%   49.36%   -0.02%     
======================================================================
  Files                                    2743     2744       +1     
  Lines                                  207020   207082      +62     
======================================================================
+ Hits                                   102224   102228       +4     
- Misses                                  97214    97272      +58     
  Partials                                 7582     7582              
Flag Coverage Δ
go-unit-tests 49.36% <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.

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