Skip to content

feat(plan): add scsiReservation field - #2790

Merged
myakove merged 1 commit into
RedHatQE:mainfrom
MiriSafra:feat/add-scsi-reservation-to-plan
Aug 15, 2026
Merged

feat(plan): add scsiReservation field#2790
myakove merged 1 commit into
RedHatQE:mainfrom
MiriSafra:feat/add-scsi-reservation-to-plan

Conversation

@MiriSafra

@MiriSafra MiriSafra commented Aug 13, 2026

Copy link
Copy Markdown
Member

Summary

Add support for the spec.scsiReservation boolean field on the Plan CR.

This field enables SCSI persistent reservations on shared RDM disks during migration. When set to true, it configures lun.reservation: true and errorPolicy: report on target VM disks.

Changes

4 standard touch points in ocp_resources/plan.py:

  • Docstring
  • __init__ parameter (bool | None = None)
  • self assignment
  • to_dict() conditional

Follows the same pattern as rdm_as_lun, run_preflight_inspection, etc.

Ref

Summary by CodeRabbit

  • New Features
    • Added support for configuring SCSI persistent reservations on shared RDM disks.
    • Added options for reservation behavior and error policies on target virtual machine disks in vSphere environments.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7dd94e5c-d364-4c59-9631-083fce0cef8e

📥 Commits

Reviewing files that changed from the base of the PR and between 228a581 and c94ce32.

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

Walkthrough

Plan now accepts the optional scsi_reservation setting, documents its vSphere-specific use, stores the value, and serializes it as spec.scsiReservation when configured.

Changes

SCSI reservation configuration

Layer / File(s) Summary
Plan option and serialization
ocp_resources/plan.py
Plan documents and accepts scsi_reservation, stores the value, and emits spec.scsiReservation when it is not None.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Mergeability Score: ⚪ Minimal · up to c94ce

This localized change adds optional SCSI reservation support to Plan resources without any identified merge-blocking risk; it is merge-ready after normal checks and review.

Possibly related PRs

Suggested labels: size/XS, verified, branch-main, can-be-merged, approved-myakove, lgtm-myakove

Suggested reviewers: krcmarik

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: adding the scsiReservation field to Plan.
Description check ✅ Passed The description explains the change, behavior, implementation points, and references, but it does not use the repository template headings.
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.
✨ 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.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Add Plan.spec.scsiReservation support for vSphere shared RDM migrations

✨ Enhancement 🕐 10-20 Minutes

Grey Divider

AI Description

• Add scsi_reservation optional parameter to the Plan resource API.
• Serialize spec.scsiReservation only when explicitly set.
• Document SCSI persistent reservation behavior for shared RDM disks.
Diagram

graph TD
  A["Client code"] --> B["Plan (ocp_resources)"] --> C["Plan.to_dict()"] --> D["spec.scsiReservation"] --> E{{"Forklift controller"}}
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Generic extra-spec dict passthrough
  • ➕ Avoids adding a new constructor argument for every new Plan spec field
  • ➕ Enables forward-compatible consumption of new upstream fields without library changes
  • ➖ Weakens API discoverability and type checking (fields become "stringly-typed")
  • ➖ Harder to document and validate supported flags consistently
  • ➖ Increases risk of emitting unsupported/typoed spec keys silently

Recommendation: Keep the explicit scsi_reservation: bool | None parameter approach used in this PR. It matches existing patterns (rdm_as_lun, run_preflight_inspection), preserves type hints and documentation, and avoids accidental emission of unknown spec keys.

Files changed (1) +8 / -0

Enhancement (1) +8 / -0
plan.pyAdd scsi_reservation option and emit spec.scsiReservation +8/-0

Add scsi_reservation option and emit spec.scsiReservation

• Extends the Plan resource API with an optional 'scsi_reservation' boolean. Stores the value on the instance and conditionally includes 'spec["scsiReservation"]' during 'to_dict()' serialization. Updates the class docstring to document the behavior and vSphere applicability for shared RDM disks.

ocp_resources/plan.py

@redhat-qe-bot

Copy link
Copy Markdown
Contributor

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 (PR author or approvers)
  • /hold cancel - Unblock PR merging (PR author or approvers)
  • /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.

@MiriSafra

Copy link
Copy Markdown
Member Author

/verified

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📜 Skill insights (0)

Grey Divider


Informational

1. scsi_reservation docstring not Google-style 📘 Rule violation ⚙ Maintainability
Description
The added scsi_reservation entry in the class docstring uses name (type): formatting and
non-2-space wrapped indentation, which does not match the required Google-style Args: layout
(name: description with 2-space indents). This can reduce doc consistency and tooling
compatibility for docstring parsers.
Code

ocp_resources/plan.py[R50-52]

+        scsi_reservation (bool, optional): Whether to enable SCSI persistent reservations on shared RDM disks.
+                                           When True, sets lun.reservation: true and errorPolicy: report
+                                           on target VM disks. Only applies to vSphere source providers.
Relevance

● Weak

Very similar Google-style docstring reformat request was previously rejected by reviewers/bot.

PR-#2765

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 1834792 requires Google-style docstrings and specifically mandates Args: entries
formatted as name: description with 2-space indented continuation lines. The newly added
scsi_reservation docstring lines use scsi_reservation (bool, optional): ... and align wrapped
lines with many spaces instead of a 2-space continuation indent.

Rule 1834792: Inline docstrings must use Google-style triple-quoted blocks
ocp_resources/plan.py[50-52]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The `Plan` class docstring was modified to add `scsi_reservation`, but the new `Args:` entry does not follow the required Google-style format (`name: description` with 2-space indented continuation lines).

## Issue Context
Compliance requires Google-style triple-quoted docstrings, including `Args:` entries formatted as `name: description` (no `:param` / NumPy headers) and wrapped lines with a 2-space continuation indent.

## Fix Focus Areas
- ocp_resources/plan.py[47-53]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context
✅ Compliance rules (platform): 18 rules

Grey Divider

Tip of the day
💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@myakove

myakove commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

/lgtm
/approve

@myakove
myakove enabled auto-merge (squash) August 15, 2026 12:15
@myakove
myakove merged commit 7892045 into RedHatQE:main Aug 15, 2026
9 checks passed
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