Skip to content

feat: add volume name policy to VM clone and restore classes#2709

Open
vsibirsk wants to merge 1 commit intoRedHatQE:mainfrom
vsibirsk:vk-volumenamepolicy
Open

feat: add volume name policy to VM clone and restore classes#2709
vsibirsk wants to merge 1 commit intoRedHatQE:mainfrom
vsibirsk:vk-volumenamepolicy

Conversation

@vsibirsk
Copy link
Copy Markdown
Contributor

@vsibirsk vsibirsk commented May 5, 2026

Short description:

Updated VirtualMachineRestore and VirtualMachineClone

More details:
What this PR does / why we need it:
Which issue(s) this PR fixes:
Special notes for reviewer:
Bug:

Summary by CodeRabbit

  • New Features
    • Added support for configurable volume_name_policy in Virtual Machine Clone operations
    • Added support for configurable volume_name_policy in Virtual Machine Restore operations

Updated VirtualMachineRestore and VirtualMachineClone

Signed-off-by: vsibirsk <vsibirsk@redhat.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2ef2b5a6-6022-4772-9009-e2d356bc5d47

📥 Commits

Reviewing files that changed from the base of the PR and between caee4d8 and ff6b975.

📒 Files selected for processing (2)
  • ocp_resources/virtual_machine_clone.py
  • ocp_resources/virtual_machine_restore.py

Walkthrough

Two virtual machine resource classes (VirtualMachineClone and VirtualMachineRestore) each gain support for an optional volume_name_policy parameter, stored as an instance attribute and conditionally emitted in the spec when serialized to a Kubernetes CRD.

Changes

Volume Name Policy Support for VM Operations

Layer / File(s) Summary
Constructor & Storage
ocp_resources/virtual_machine_clone.py, ocp_resources/virtual_machine_restore.py
Both classes accept an optional volume_name_policy=None parameter in __init__ and store it as an instance attribute.
CRD Serialization
ocp_resources/virtual_machine_clone.py, ocp_resources/virtual_machine_restore.py
Both classes conditionally emit spec["volumeNamePolicy"] from self.volume_name_policy in to_dict(). Clone also simplifies source.kind assignment to self.source_kind or VirtualMachine.kind.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is significantly incomplete. While it mentions the updated classes, it lacks essential details about why the change is needed, what problems it solves, related issues, and guidance for reviewers. Complete the description by explaining the rationale for adding volume name policy, referencing any related issues, and providing context for reviewers about the impact and testing considerations.
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: add volume name policy to VM clone and restore classes' clearly and concisely describes the main change: adding volume name policy support to two VM-related classes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@rh-bot-1
Copy link
Copy Markdown

rh-bot-1 commented May 5, 2026

Report bugs in Issues

Welcome! 🎉

This pull request will be automatically processed with the following features:

🔄 Automatic Actions

  • Reviewer Assignment: Reviewers are automatically assigned based on the OWNERS file in the repository root
  • Size Labeling: PR size labels (XS, S, M, L, XL, XXL) are automatically applied based on changes
  • Issue Creation: Disabled for this repository
  • Branch Labeling: Branch-specific labels are applied to track the target branch
  • Auto-verification: Auto-verified users have their PRs automatically marked as verified
  • Labels: All label categories are enabled (default configuration)

📋 Available Commands

PR Status Management

  • /wip - Mark PR as work in progress (adds WIP: prefix to title)
  • /wip cancel - Remove work in progress status
  • /hold - Block PR merging (approvers only)
  • /hold cancel - Unblock PR merging
  • /verified - Mark PR as verified
  • /verified cancel - Remove verification status
  • /reprocess - Trigger complete PR workflow reprocessing (useful if webhook failed or configuration changed)
  • /regenerate-welcome - Regenerate this welcome message

Review & Approval

  • /lgtm - Approve changes (looks good to me)
  • /approve - Approve PR (approvers only)
  • /automerge - Enable automatic merging when all requirements are met (maintainers and approvers only)
  • /assign-reviewers - Assign reviewers based on OWNERS file
  • /assign-reviewer @username - Assign specific reviewer
  • /check-can-merge - Check if PR meets merge requirements

Testing & Validation

  • /retest tox - Run Python test suite with tox
  • /retest python-module-install - Test Python package installation
  • /retest conventional-title - Validate commit message format
  • /retest all - Run all available tests

Cherry-pick Operations

  • /cherry-pick <branch> - Schedule cherry-pick to target branch when PR is merged
    • Multiple branches: /cherry-pick branch1 branch2 branch3

Label Management

  • /<label-name> - Add a label to the PR
  • /<label-name> cancel - Remove a label from the PR

✅ Merge Requirements

This PR will be automatically approved when the following conditions are met:

  1. Approval: /approve from at least one approver
  2. Status Checks: All required status checks must pass
  3. No Blockers: No wip, hold, has-conflicts labels and PR must be mergeable (no conflicts)
  4. Verified: PR must be marked as verified

📊 Review Process

Approvers and Reviewers

Approvers:

  • myakove
  • rnetser

Reviewers:

  • myakove
  • rnetser
Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve
  • automerge
AI Features
  • Conventional Title: Mode: fix (claude/claude-opus-4-6[1m])
  • Cherry-Pick Conflict Resolution: Enabled (claude/claude-opus-4-6[1m])

💡 Tips

  • WIP Status: Use /wip when your PR is not ready for review
  • Verification: The verified label is removed on new commits unless the push is detected as a clean rebase
  • Cherry-picking: Cherry-pick labels are processed when the PR is merged
  • Permission Levels: Some commands require approver permissions
  • Auto-verified Users: Certain users have automatic verification and merge privileges

For more information, please refer to the project documentation or contact the maintainers.

@rh-bot-1 rh-bot-1 requested a review from rnetser May 5, 2026 15:18
@rh-bot-1 rh-bot-1 requested a review from myakove May 5, 2026 15:18
@rnetser
Copy link
Copy Markdown
Collaborator

rnetser commented May 6, 2026

/approve
/lgtm

@vsibirsk
Copy link
Copy Markdown
Contributor Author

vsibirsk commented May 6, 2026

/verified

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.

5 participants