Skip to content

ROX-33608: add EnsureVirtualMachineExists to VM v2 datastore#19551

Draft
dashrews78 wants to merge 1 commit intodashrews/vm-v2-converters-33608from
dashrews/virt-v2-ensure-33608
Draft

ROX-33608: add EnsureVirtualMachineExists to VM v2 datastore#19551
dashrews78 wants to merge 1 commit intodashrews/vm-v2-converters-33608from
dashrews/virt-v2-ensure-33608

Conversation

@dashrews78
Copy link
Contributor

The scan index pipeline needs to insert a minimal VM record before
upserting scan data to satisfy FK constraints (VirtualMachineScanV2.VmV2Id
→ VirtualMachineV2.Id). EnsureVirtualMachineExists checks if the VM row
exists; if not, it inserts a minimal placeholder with just id and
cluster_id, avoiding overwriting richer metadata from the VM pipeline.

Partially generated by AI.

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

Description

change me!

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

change me!

@dashrews78
Copy link
Contributor Author

dashrews78 commented Mar 23, 2026

@openshift-ci
Copy link

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

@rhacs-bot
Copy link
Contributor

rhacs-bot commented Mar 23, 2026

Images are ready for the commit at 13ce987.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-426-g13ce987898.

The scan index pipeline needs to insert a minimal VM record before
upserting scan data to satisfy FK constraints (VirtualMachineScanV2.VmV2Id
→ VirtualMachineV2.Id). EnsureVirtualMachineExists checks if the VM row
exists; if not, it inserts a minimal placeholder with just id and
cluster_id, avoiding overwriting richer metadata from the VM pipeline.

Partially generated by AI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dashrews78 dashrews78 force-pushed the dashrews/vm-v2-converters-33608 branch from 07beb4c to 3e3239d Compare March 24, 2026 13:28
@dashrews78 dashrews78 force-pushed the dashrews/virt-v2-ensure-33608 branch from ae3cb10 to 13ce987 Compare March 24, 2026 13:28
@codecov
Copy link

codecov bot commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 0% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.30%. Comparing base (3e3239d) to head (13ce987).

Files with missing lines Patch % Lines
...tral/virtualmachine/v2/datastore/datastore_impl.go 0.00% 17 Missing ⚠️
Additional details and impacted files
@@                       Coverage Diff                        @@
##           dashrews/vm-v2-converters-33608   #19551   +/-   ##
================================================================
  Coverage                            49.30%   49.30%           
================================================================
  Files                                 2729     2729           
  Lines                               206051   206068   +17     
================================================================
+ Hits                                101592   101602   +10     
- Misses                               96921    96931   +10     
+ Partials                              7538     7535    -3     
Flag Coverage Δ
go-unit-tests 49.30% <0.00%> (+<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