Skip to content

Storage: add VirtualMachineBackup and VirtualMachineBackupTracker resources#2745

Open
dalia-frank wants to merge 3 commits into
RedHatQE:mainfrom
dalia-frank:add-cbt-backup-resources
Open

Storage: add VirtualMachineBackup and VirtualMachineBackupTracker resources#2745
dalia-frank wants to merge 3 commits into
RedHatQE:mainfrom
dalia-frank:add-cbt-backup-resources

Conversation

@dalia-frank

@dalia-frank dalia-frank commented Jun 18, 2026

Copy link
Copy Markdown
Contributor
Short description:

Add generated backup.kubevirt.io resources with Push/Pull mode constants and update class-generator schema for the new CRDs.

More details:

https://github.com/kubevirt/enhancements/blob/main/veps/sig-storage/incremental-backup.md

What this PR does / why we need it:

Adds the VirtualMachineBackup and VirtualMachineBackupTracker Custom Resource Definitions (CRDs) required to support the Change Block Tracking (CBT) feature for incremental backups.

Which issue(s) this PR fixes:
Special notes for reviewer:
Bug:

Summary by CodeRabbit

  • New Features
    • Added Virtual Machine Backup resource support, including Push/Pull backup modes and optional backup configuration fields.
    • Added Virtual Machine Backup Tracker resource support to describe and manage backup sources.
  • Chores
    • Updated formatting/lint tooling configuration.
    • Bumped package version and adjusted the Kubernetes dependency constraint.

@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 18, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@dalia-frank, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 35 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5d7d035b-c7fa-434b-9a8a-8e434592f64b

📥 Commits

Reviewing files that changed from the base of the PR and between a7b30cb and 7e51fe8.

📒 Files selected for processing (3)
  • ocp_resources/resource.py
  • ocp_resources/virtual_machine_backup.py
  • ocp_resources/virtual_machine_backup_tracker.py

Walkthrough

Adds BACKUP_KUBEVIRT_IO ("backup.kubevirt.io") to Resource.ApiGroup, then introduces VirtualMachineBackup and VirtualMachineBackupTracker resource wrappers, and updates the project version, kubernetes dependency constraint, and ruff pre-commit revision.

Changes

backup.kubevirt.io Resource Definitions

Layer / File(s) Summary
BACKUP_KUBEVIRT_IO API group constant
ocp_resources/resource.py
Adds BACKUP_KUBEVIRT_IO = "backup.kubevirt.io" to Resource.ApiGroup.
VirtualMachineBackup resource class
ocp_resources/virtual_machine_backup.py
Defines VirtualMachineBackup with a nested Mode class (PUSH/PULL), a constructor accepting optional backup parameters, and to_dict() that requires source and maps instance fields to camelCase spec keys.
VirtualMachineBackupTracker resource class
ocp_resources/virtual_machine_backup_tracker.py
Defines VirtualMachineBackupTracker with api_group set to BACKUP_KUBEVIRT_IO, a constructor storing an optional source dict, and to_dict() that raises MissingRequiredArgumentError if source is absent and writes it into spec.source.
Version and tooling updates
pyproject.toml, .pre-commit-config.yaml
Bumps the project version, adjusts the kubernetes dependency constraint to <36, and updates the ruff-pre-commit revision.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding VirtualMachineBackup and VirtualMachineBackupTracker resources.
Description check ✅ Passed The description follows the template and covers the main purpose, details, and rationale; the issue/special notes/bug sections are simply left blank.
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.

@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: 2

🤖 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/virtual_machine_backup_tracker.py`:
- Line 1: The header marker on line 1 in virtual_machine_backup_tracker.py does
not conform to the project's class-generator convention for ocp_resources.
Update the generator template (located in the class-generator tool referenced in
the comment) to use the correct start marker format as specified in the project
coding guidelines, then regenerate the virtual_machine_backup_tracker.py file
using the class-generator to ensure the generated-section tooling and review
behavior remains consistent with repository standards.

In `@ocp_resources/virtual_machine_backup.py`:
- Line 1: The generated-code start marker comment in virtual_machine_backup.py
uses a non-standard generator URL that does not match the repository standards
required for files in the ocp_resources directory. Update the class-generator
template to emit the correct repository-standard generated-code start marker,
then regenerate the virtual_machine_backup.py file to replace the current
marker, rather than manually editing the generated output.
🪄 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: f02901a6-0bcd-4a33-a4e0-39b14c879a7c

📥 Commits

Reviewing files that changed from the base of the PR and between 4aace26 and ab9f509.

⛔ Files ignored due to path filters (3)
  • class_generator/schema/__cluster_version__.txt is excluded by !class_generator/schema/**
  • class_generator/schema/__resources-mappings.json.gz is excluded by !**/*.gz, !class_generator/schema/**
  • class_generator/schema/_definitions.json is excluded by !class_generator/schema/**
📒 Files selected for processing (3)
  • ocp_resources/resource.py
  • ocp_resources/virtual_machine_backup.py
  • ocp_resources/virtual_machine_backup_tracker.py

Comment thread ocp_resources/virtual_machine_backup_tracker.py
Comment thread ocp_resources/virtual_machine_backup.py
@dalia-frank

Copy link
Copy Markdown
Contributor Author

/verified

@rnetser

rnetser commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

/retest security-committer-identity

@redhat-qe-bot

Copy link
Copy Markdown
Contributor

Clean rebase detected — no code changes compared to previous head (6c750a3).

@dalia-frank dalia-frank force-pushed the add-cbt-backup-resources branch from 2277040 to 62d66a1 Compare June 18, 2026 17:11
@redhat-qe-bot1

Copy link
Copy Markdown

Clean rebase detected — no code changes compared to previous head (2277040).

@rnetser

rnetser commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

/approve
/lgtm

@dalia-frank

Copy link
Copy Markdown
Contributor Author

/verified

@redhat-qe-bot1

Copy link
Copy Markdown

Clean rebase detected — no code changes compared to previous head (62d66a1).
The following labels were preserved: approved-rnetser, lgtm-rnetser.

@dalia-frank

Copy link
Copy Markdown
Contributor Author

/verified

@myakove

myakove commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

@dalia-frank please resolve the conflicts and rebase the PR
I think reset to main and regenerate the classes is the best option since the confilct is in class_generator/schema/__resources-mappings.json.gz file.

dalia-frank and others added 2 commits June 29, 2026 20:10
Add generated backup.kubevirt.io resources with Push/Pull mode constants
and update class-generator schema for the new CRDs.

Signed-off-by: Dalia Frank <dfrank@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Pre-commit hook detected missing newlines in schema files.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@dalia-frank dalia-frank force-pushed the add-cbt-backup-resources branch from 077ae6e to 7e51fe8 Compare June 29, 2026 17:22
@dalia-frank

Copy link
Copy Markdown
Contributor Author

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

7 participants