Skip to content

ROX-30352: add CVE detail and affected VMs endpoints#19667

Open
ajheflin wants to merge 3 commits intomasterfrom
aheflin/ROX-30352/vm-v2-cve-scoped-endpoints
Open

ROX-30352: add CVE detail and affected VMs endpoints#19667
ajheflin wants to merge 3 commits intomasterfrom
aheflin/ROX-30352/vm-v2-cve-scoped-endpoints

Conversation

@ajheflin
Copy link
Copy Markdown
Contributor

@ajheflin ajheflin commented Mar 27, 2026

Description

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

Adds 2 CVE-scoped endpoints:

  • GetVMCVEDetail (GET /v2/virtualmachines/cves/{id}) - single CVE detail with cross-VM severity aggregation, affected VM count, affected guest OS count, and top CVSS. Accepts the CVE identifier (e.g. "CVE-2024-1234") as the path parameter.
  • ListVMCVEAffectedVMs (GET /v2/virtualmachines/cves/{id}/vms) - VMs affected by a specific CVE with per-VM severity, fixability, and affected component count

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

Unit tests: TestGetVMCVEDetail (3 cases)

E2E validated on a cluster with 200 fake VMs:

  • GET /v2/virtualmachines/cves/CVE-2020-10134 returns detail with affected=197/200 guestOSes=9, severity counts, EPSS, and summary
  • GET /v2/virtualmachines/cves/CVE-2020-10134/vms returns 196 affected VMs with severity, fixability, and component counts

@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
Contributor

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: 0173aa80-6776-436d-87c8-cb0afdd1d55c

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-cve-scoped-endpoints

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.

@ajheflin
Copy link
Copy Markdown
Contributor Author

ajheflin commented Mar 27, 2026

@rhacs-bot
Copy link
Copy Markdown
Contributor

rhacs-bot commented Mar 27, 2026

Images are ready for the commit at 676d22b.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-533-g676d22b0a7.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 27, 2026

Codecov Report

❌ Patch coverage is 30.43478% with 80 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.66%. Comparing base (745a6ff) to head (8f411cd).

Files with missing lines Patch % Lines
central/virtualmachine/v2/service/service_impl.go 30.43% 75 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #19667      +/-   ##
==========================================
- Coverage   49.67%   49.66%   -0.02%     
==========================================
  Files        2765     2765              
  Lines      209039   209154     +115     
==========================================
+ Hits       103834   103869      +35     
- Misses      97527    97602      +75     
- Partials     7678     7683       +5     
Flag Coverage Δ
go-unit-tests 49.66% <30.43%> (-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.

@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-vm-scoped-endpoints branch from f331507 to b200b68 Compare March 30, 2026 13:28
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-cve-scoped-endpoints branch from 6729330 to cd38717 Compare March 30, 2026 13:28
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-vm-scoped-endpoints branch from b200b68 to 90e78c1 Compare April 1, 2026 14:14
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-cve-scoped-endpoints branch from cd38717 to 2266b11 Compare April 1, 2026 14:14
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-vm-scoped-endpoints branch from 90e78c1 to 7fd211d Compare April 1, 2026 15:55
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-cve-scoped-endpoints branch from 2266b11 to d8e4837 Compare April 1, 2026 15:55
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-vm-scoped-endpoints branch from 7fd211d to fd37ed6 Compare April 1, 2026 16:10
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-cve-scoped-endpoints branch from d8e4837 to 5977ea6 Compare April 1, 2026 16:10
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-vm-scoped-endpoints branch from fd37ed6 to 4d3f72a Compare April 2, 2026 14:28
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-cve-scoped-endpoints branch from 5977ea6 to 6de0f05 Compare April 2, 2026 14:28
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-vm-scoped-endpoints branch from 4d3f72a to f3b7899 Compare April 2, 2026 17:11
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-cve-scoped-endpoints branch 2 times, most recently from 5e58fde to 53f3fd3 Compare April 2, 2026 17:34
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-vm-scoped-endpoints branch from f3b7899 to 4fea4f7 Compare April 2, 2026 17:42
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-cve-scoped-endpoints branch from 53f3fd3 to 676d22b Compare April 2, 2026 17:42
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-vm-scoped-endpoints branch from 4fea4f7 to cd84093 Compare April 2, 2026 18:09
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-vm-scoped-endpoints branch from bcf35af to 31fe3ae Compare April 6, 2026 19:10
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-cve-scoped-endpoints branch from ac85252 to e0471f6 Compare April 6, 2026 19:10
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-vm-scoped-endpoints branch from 31fe3ae to 42314fd Compare April 7, 2026 17:48
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-cve-scoped-endpoints branch from e0471f6 to da2dcf9 Compare April 7, 2026 17:48
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-vm-scoped-endpoints branch from 42314fd to 4bb4cae Compare April 7, 2026 19:43
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-cve-scoped-endpoints branch from da2dcf9 to f29d7bb Compare April 7, 2026 19:44
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-vm-scoped-endpoints branch from 4bb4cae to 9f37f8d Compare April 8, 2026 13:14
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-cve-scoped-endpoints branch from f29d7bb to a40704a Compare April 8, 2026 13:14
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-vm-scoped-endpoints branch from 9f37f8d to a6e1bec Compare April 8, 2026 20:04
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-cve-scoped-endpoints branch from a40704a to fa40049 Compare April 8, 2026 20:04
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-vm-scoped-endpoints branch from a6e1bec to 23b50db Compare April 8, 2026 20:59
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-cve-scoped-endpoints branch from fa40049 to 7491811 Compare April 8, 2026 20:59
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-vm-scoped-endpoints branch from 23b50db to 3d75c53 Compare April 9, 2026 17:18
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-cve-scoped-endpoints branch from 7491811 to ec3a7fd Compare April 9, 2026 17:18
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-vm-scoped-endpoints branch from 3d75c53 to 026f97c Compare April 9, 2026 17:22
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-cve-scoped-endpoints branch from ec3a7fd to bb82d34 Compare April 9, 2026 17:22
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-vm-scoped-endpoints branch from 026f97c to 48c384d Compare April 9, 2026 20:06
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-cve-scoped-endpoints branch from bb82d34 to 1ee5d37 Compare April 9, 2026 20:06
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-vm-scoped-endpoints branch from 48c384d to ab272fa Compare April 10, 2026 15:19
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-cve-scoped-endpoints branch 3 times, most recently from 6ee3ace to 4c6dd35 Compare April 16, 2026 14:07
Base automatically changed from aheflin/ROX-30352/vm-v2-vm-scoped-endpoints to master April 16, 2026 16:33
ajheflin and others added 3 commits April 16, 2026 13:52
Add 2 CVE-scoped endpoints to VirtualMachineV2Service:
- GetVMCVEDetail (GET /v2/virtualmachines/cves/{id}) - single CVE detail
  with cross-VM severity aggregation, affected VM/guest OS counts
- ListVMCVEAffectedVMs (GET /v2/virtualmachines/cves/{id}/vms) - VMs
  affected by a specific CVE with per-VM severity and fixability

Partially generated by AI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add TestGetVMCVEDetail covering empty ID, CVE not found, and successful
detail with severity aggregation and guest OS counting.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ajheflin ajheflin marked this pull request as ready for review April 16, 2026 17:52
@ajheflin ajheflin force-pushed the aheflin/ROX-30352/vm-v2-cve-scoped-endpoints branch from 4c6dd35 to 8f411cd Compare April 16, 2026 17:53
@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 16, 2026

@ajheflin: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/gke-qa-e2e-tests 8f411cd link false /test gke-qa-e2e-tests

Full PR test history. Your PR dashboard.

Details

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

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