Skip to content

feat(Plan): add runPreflightInspection field#2758

Merged
myakove merged 1 commit into
RedHatQE:mainfrom
MiriSafra:feat/add-run-preflight-inspection-to-plan
Jul 8, 2026
Merged

feat(Plan): add runPreflightInspection field#2758
myakove merged 1 commit into
RedHatQE:mainfrom
MiriSafra:feat/add-run-preflight-inspection-to-plan

Conversation

@MiriSafra

@MiriSafra MiriSafra commented Jul 8, 2026

Copy link
Copy Markdown
Member

Summary

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

This field controls whether preflight deep inspection runs on warm migrations. It defaults to true via kubebuilder (+kubebuilder:default:=true in plan.go:331-335).

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 enable_nested_virtualization, skip_guest_conversion, etc.

Ref

  • forklift field definition: pkg/apis/forklift/v1beta1/plan.go:331-335

Summary by CodeRabbit

  • New Features
    • Added support for an optional preflight inspection parameter to the Plan resource, enabling additional configuration during plan execution.

Add support for the spec.runPreflightInspection boolean field on
the Plan CR. This field controls whether preflight deep inspection
runs on warm migrations (default: true via kubebuilder).

Ref: forklift pkg/apis/forklift/v1beta1/plan.go:331-335
@coderabbitai

coderabbitai Bot commented Jul 8, 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

Run ID: 645a64b7-f014-426d-92c5-015500742352

📥 Commits

Reviewing files that changed from the base of the PR and between c40db79 and 5de6797.

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

Walkthrough

Added an optional run_preflight_inspection boolean parameter to the Plan class constructor, documented in the docstring, stored as an instance attribute, and conditionally serialized into the manifest's spec.runPreflightInspection field when set.

Changes

Plan resource preflight inspection support

Layer / File(s) Summary
Add run_preflight_inspection parameter
ocp_resources/plan.py
New optional run_preflight_inspection: bool | None = None parameter added to docstring and __init__, stored as instance attribute, and serialized to spec.runPreflightInspection in to_dict() when not None.

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

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: adding the Plan runPreflightInspection field.
Description check ✅ Passed It covers the main summary, rationale, changes, and reference, but it does not follow the repository's full 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.

@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 (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.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Add Plan spec.runPreflightInspection support

✨ Enhancement 🕐 10-20 Minutes

Grey Divider

AI Description

• Add run_preflight_inspection to Plan and serialize to spec.runPreflightInspection.
• Document the new flag controlling preflight deep inspection for warm migrations.
• Omit the field when unset to preserve API-side defaults.
Diagram

graph TD
  A([Client code]) --> B["Plan (ocp_resources/plan.py)"] --> C["run_preflight_inspection (optional)"] --> D{{"spec dict"}} --> E[("Plan CR (K8s)")] --> F["MTV controller"]
  subgraph Legend
    direction LR
    _actor([Caller]) ~~~ _code["Library code"] ~~~ _opt["Optional field"] ~~~ _dict{{"Dict/decision"}} ~~~ _cr[("K8s resource")]
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Generic spec passthrough (e.g., spec_overrides dict)
  • ➕ Reduces boilerplate for new Plan spec fields
  • ➕ Allows supporting new upstream fields without library releases
  • ➖ Weaker type hints and discoverability in IDEs/docs
  • ➖ Easier to accidentally set invalid/unsupported spec keys
2. Codegen from upstream CRD/OpenAPI schema
  • ➕ Keeps wrapper in sync with upstream API definitions automatically
  • ➕ Avoids manual drift across many small flags
  • ➖ Higher tooling/maintenance overhead
  • ➖ Bigger change than needed for a single field addition

Recommendation: Current approach (explicit constructor arg + conditional serialization) is the best fit here because it matches existing patterns in Plan, preserves type hints, and keeps the public API discoverable. The generic passthrough/codegen options are only worth it if Plan spec churn becomes frequent enough to justify the added complexity.

Files changed (1) +6 / -0

Enhancement (1) +6 / -0
plan.pyAdd 'run_preflight_inspection' Plan option and spec serialization +6/-0

Add 'run_preflight_inspection' Plan option and spec serialization

• Extends the Plan wrapper API with a 'run_preflight_inspection' optional parameter and documents it. Stores the value on the instance and conditionally emits 'spec.runPreflightInspection' in 'to_dict()' when provided, aligning with existing optional Plan fields.

ocp_resources/plan.py

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Qodo Logo

@MiriSafra

Copy link
Copy Markdown
Member Author

/verified

@myakove

myakove commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

/lgtm
/approve

@myakove
myakove enabled auto-merge (squash) July 8, 2026 10:29
@myakove
myakove merged commit ea91701 into RedHatQE:main Jul 8, 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