Skip to content

feat: add Conversion resource for MTV deep inspection#2748

Open
MiriSafra wants to merge 1 commit into
RedHatQE:mainfrom
MiriSafra:feat/add-conversion-resource
Open

feat: add Conversion resource for MTV deep inspection#2748
MiriSafra wants to merge 1 commit into
RedHatQE:mainfrom
MiriSafra:feat/add-conversion-resource

Conversation

@MiriSafra

@MiriSafra MiriSafra commented Jun 23, 2026

Copy link
Copy Markdown
Member

Add the Conversion CR class for Migration Toolkit for Virtualization (MTV). Supports DeepInspection, InPlace, Remote, and Inspection conversion types, enabling standalone deep inspection workflows and VM conversion operations outside of migration plans. All 15 spec fields verified against forklift ConversionSpec Go source.

Summary by CodeRabbit

  • New Features
    • Added support for a new virtualization conversion resource for Migration Toolkit for Virtualization workflows.
    • Users can now define source VM details, target destination settings, connection credentials, disk encryption, compatibility options, and pod-related overrides.
    • Added support for extra volumes and mounts, as well as local migration and remote destination configuration.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Adds a new Conversion namespaced resource for MTV, including constructor parameters for conversion settings and to_dict() logic that serializes the resource spec with VM, connection, encryption, destination, pod, and storage-related fields.

Changes

Conversion resource

Layer / File(s) Summary
Conversion class and spec serialization
ocp_resources/conversion.py
Adds the Conversion resource class, wires constructor inputs for VM and conversion options, and implements to_dict() to build the nested spec fields when no predefined resource payload is supplied.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically references the main change: adding a Conversion resource for MTV deep inspection, which aligns with the changeset's primary objective.
Description check ✅ Passed The description provides adequate context about the Conversion CR class, supported conversion types, and verification against forklift ConversionSpec, but does not follow the repository's template structure with required sections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

@redhat-qe-bot1

Copy link
Copy Markdown

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
  • /security-override - Set security check runs to pass (maintainers only)
  • /security-override cancel - Re-run security checks

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
  • /cherry-pick-retry <branch> - Retry a failed cherry-pick (merged PRs only)

Branch Management

  • /rebase - Rebase this PR branch onto its base branch

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)
Security Checks
  • Suspicious Path Detection: Monitors paths: .claude/, .vscode/, .cursor/, .devcontainer/, .pi/, .github/workflows/, .github/actions/
  • Committer Identity Check: Verifies last committer matches PR author
  • Mandatory: Security checks block merge (use /security-override to bypass — maintainers only)

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

@redhat-qe-bot1

Copy link
Copy Markdown

myakove can not be added as reviewer. 401 {"message": "Bad credentials", "documentation_url": "https://docs.github.com/rest", "status": "401"}

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
ocp_resources/conversion.py (1)

46-46: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Avoid shadowing Python built-in type in the constructor API.

Using type as a parameter name hurts readability/tooling. Prefer conversion_type (or type_) and map it to spec["type"].

Also applies to: 72-72, 110-110

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ocp_resources/conversion.py` at line 46, The constructor API is shadowing
Python’s built-in type by using type as a parameter name in Conversion, which
hurts readability and tooling. Update the relevant constructor and any related
call sites/helpers in conversion.py to use a clearer name such as
conversion_type or type_, and continue mapping that value into spec["type"]
inside the Conversion class and its related methods. Ensure the same rename is
applied consistently across all referenced locations so the public API and
internal spec handling stay aligned.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ocp_resources/conversion.py`:
- Around line 95-137: The to_dict() implementation in ConversionResource is
building spec without enforcing the documented required fields, so add
validation before populating self.res["spec"]. In the ConversionResource.to_dict
path, check that type is set, at least one of vm_id or vm_name is present, the
connection secret name and namespace are provided, and diskEncryption with LUKS
cannot be emitted unless its secret name is set (and namespace when required by
the contract). Keep the existing field assembly in to_dict(), but fail early
with clear validation using the same class attributes (type, vm_id, vm_name,
connection_secret_name, connection_secret_namespace, disk_encryption_type,
disk_encryption_secret_name, disk_encryption_secret_namespace).

---

Nitpick comments:
In `@ocp_resources/conversion.py`:
- Line 46: The constructor API is shadowing Python’s built-in type by using type
as a parameter name in Conversion, which hurts readability and tooling. Update
the relevant constructor and any related call sites/helpers in conversion.py to
use a clearer name such as conversion_type or type_, and continue mapping that
value into spec["type"] inside the Conversion class and its related methods.
Ensure the same rename is applied consistently across all referenced locations
so the public API and internal spec handling stay aligned.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: dc634faf-33dc-4074-91ad-a0b79ebd773b

📥 Commits

Reviewing files that changed from the base of the PR and between fd98ef8 and ac70d8c.

📒 Files selected for processing (1)
  • ocp_resources/conversion.py

Comment thread ocp_resources/conversion.py
@MiriSafra

Copy link
Copy Markdown
Member Author

/verified

@redhat-qe-bot

Copy link
Copy Markdown
Contributor

MiriSafra is not allowed to run commands.
maintainers can allow it by comment /add-allowed-user @MiriSafra
Maintainers:

  • omaciel
  • Lorquas
  • FilipB
  • rnetser
  • Aftermath
  • dajohnso
  • redhat-qe-bot2
  • ogajduse
  • rh-bot-1
  • spoore1
  • rlandy
  • redhat-qe-bot1
  • jsamato
  • myakove
  • smallamp
  • mshriver
  • etirta
  • dbasunag
  • jkandasa
  • quality-innovators-bot
  • RonnyPfannschmidt
  • thrix
  • redhat-qe-bot
  • bsquizz
  • myakove-bot
  • psav

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.

3 participants