ROX-30352: add GetVM endpoint and replace V1 VirtualMachineService#19668
ROX-30352: add GetVM endpoint and replace V1 VirtualMachineService#19668ajheflin wants to merge 1 commit intoaheflin/ROX-30352/vm-v2-cve-scoped-endpointsfrom
Conversation
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>
|
This change is part of the following stack:
Change managed by git-spice. |
|
Skipping CI for Draft Pull Request. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Images are ready for the commit at e3282c4. To use with deploy scripts, first |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 V1GetVirtualMachineroute on the same path.Updates
central/main.goto conditionally register V1 OR V2:VirtualMachinesEnhancedDataModelis enabled: the V2 service is registered (includes all 10 endpoints includingGetVM)VirtualMachineServiceis usedThis 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
Automated testing
Service tests to be added in a follow-up.
How I validated my change
go build ./central/...compiles cleanlycentral/main.go: V1 and V2 are mutually exclusive based on feature flag