Skip to content

ROX-30352: add GetVM endpoint and replace V1 VirtualMachineService#19668

Draft
ajheflin wants to merge 1 commit intoaheflin/ROX-30352/vm-v2-cve-scoped-endpointsfrom
aheflin/ROX-30352/vm-v2-replace-v1-service
Draft

ROX-30352: add GetVM endpoint and replace V1 VirtualMachineService#19668
ajheflin wants to merge 1 commit intoaheflin/ROX-30352/vm-v2-cve-scoped-endpointsfrom
aheflin/ROX-30352/vm-v2-replace-v1-service

Conversation

@ajheflin
Copy link
Copy Markdown
Contributor

@ajheflin ajheflin commented Mar 27, 2026

Description

Part 6/6 of the VirtualMachineV2Service API stack (ROX-30352). This is the overlap PR that must merge last.

Adds the final endpoint GetVM (GET /v2/virtualmachines/{id}) which conflicts with the existing V1 GetVirtualMachine route on the same path.

Updates central/main.go to conditionally register V1 OR V2:

  • When VirtualMachinesEnhancedDataModel is enabled: the V2 service is registered (includes all 10 endpoints including GetVM)
  • When the flag is off: the existing V1 VirtualMachineService is used

This ensures no route conflicts and no broken releases. The V1 service files remain in tree for use when the enhanced data model flag is off.

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
  • Verified conditional registration logic in central/main.go: V1 and V2 are mutually exclusive based on feature flag

Add the final endpoint GetVM (GET /v2/virtualmachines/{id}) which
conflicts with the existing V1 GetVirtualMachine route.

Update central/main.go to conditionally register V1 OR V2 service:
when VirtualMachinesEnhancedDataModel is enabled, the V2 service is
registered (which includes GetVM); otherwise the V1 service is used.
This ensures no route conflicts and no broken releases.

The V1 service files remain in tree for use when the enhanced data
model flag is off.

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: 2694f7f6-660a-4759-a891-4d049c6f9bfc

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-replace-v1-service

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

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-477-ge3282c4e32.

@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.35%. Comparing base (6729330) to head (e3282c4).

Additional details and impacted files
@@                              Coverage Diff                              @@
##           aheflin/ROX-30352/vm-v2-cve-scoped-endpoints   #19668   +/-   ##
=============================================================================
  Coverage                                         49.35%   49.35%           
=============================================================================
  Files                                              2744     2744           
  Lines                                            207123   207123           
=============================================================================
+ Hits                                             102217   102226    +9     
+ Misses                                            97323    97315    -8     
+ Partials                                           7583     7582    -1     
Flag Coverage Δ
go-unit-tests 49.35% <ø> (+<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