Skip to content

feat: Add defaultVolumesToFsBackup field to Backup#2654

Open
qwang1 wants to merge 1 commit intoRedHatQE:mainfrom
qwang1:qwang-backup-add
Open

feat: Add defaultVolumesToFsBackup field to Backup#2654
qwang1 wants to merge 1 commit intoRedHatQE:mainfrom
qwang1:qwang-backup-add

Conversation

@qwang1
Copy link
Contributor

@qwang1 qwang1 commented Feb 18, 2026

If defaultVolumesToFsBackup is not set, it equals to the default value False

Short description:
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 a new configuration option to control default filesystem backup behavior for volumes, providing users with additional flexibility in backup operations.

If defaultVolumesToFsBackup is not set, it equals to the default value False

Signed-off-by: Qixuan Wang <qwang@redhat.com>
@coderabbitai
Copy link

coderabbitai bot commented Feb 18, 2026

Walkthrough

Added an optional parameter default_volumes_to_fs_backup to the Backup class constructor. This parameter is stored on the instance and serialized as defaultVolumesToFsBackup in the spec dictionary, defaulting to False if not provided.

Changes

Cohort / File(s) Summary
Backup Configuration Enhancement
ocp_resources/backup.py
Added optional default_volumes_to_fs_backup parameter to Backup.__init__ with corresponding serialization in to_dict method.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is largely incomplete with most template sections left empty or minimally filled; only a single detail about default value is provided. Complete the required sections: provide a short description, detailed explanation of the change, rationale for why it's needed, any related issue numbers, reviewer notes, and bug information if applicable.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding the defaultVolumesToFsBackup field to the Backup resource.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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.

@redhat-qe-bot
Copy link
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

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. LGTM Count: Minimum 0 /lgtm from reviewers
  3. Status Checks: All required status checks must pass
  4. No Blockers: No WIP, hold, conflict labels
  5. Verified: PR must be marked as verified (if verification is enabled)

📊 Review Process

Approvers and Reviewers

Approvers:

  • myakove
  • rnetser

Reviewers:

  • myakove
  • rnetser
Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve
  • automerge

💡 Tips

  • WIP Status: Use /wip when your PR is not ready for review
  • Verification: The verified label is automatically removed on each new commit
  • 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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
ocp_resources/backup.py (1)

23-32: ⚠️ Potential issue | 🟡 Minor

Add docstring entry for the new default_volumes_to_fs_backup parameter.

The Args block documents every other parameter but omits default_volumes_to_fs_backup.

📝 Proposed fix
             snapshot_move_data (bool, optional): If set to true, deploys the volume snapshot mover
                 controller and a modified CSI Data Mover plugin.
+            default_volumes_to_fs_backup (bool, optional): If set to true, all pod volumes are backed
+                up via file system backup by default.
             storage_location (string, optional): Define the location for the DataMover.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ocp_resources/backup.py` around lines 23 - 32, The docstring Args block is
missing an entry for the new parameter default_volumes_to_fs_backup; update the
existing docstring in ocp_resources/backup.py (the function/class docstring that
currently lists included_namespaces, excluded_resources, snapshot_move_data,
storage_location) to add a line describing default_volumes_to_fs_backup (bool,
optional): explain its default behavior and what enabling it does (e.g., whether
volumes are backed up as filesystem snapshots by default), matching the style of
the other parameter entries.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ocp_resources/backup.py`:
- Around line 59-61: In to_dict() fix the unconditional emission of
spec_dict["defaultVolumesToFsBackup"] — instead of always writing False when
self.default_volumes_to_fs_backup is None, only set
spec_dict["defaultVolumesToFsBackup"] when self.default_volumes_to_fs_backup is
not None (so an explicit False is preserved but None omits the key); locate the
logic around the default_volumes_to_fs_backup attribute in the to_dict() method
and change the assignment to a conditional presence check before adding the
"defaultVolumesToFsBackup" key.

---

Outside diff comments:
In `@ocp_resources/backup.py`:
- Around line 23-32: The docstring Args block is missing an entry for the new
parameter default_volumes_to_fs_backup; update the existing docstring in
ocp_resources/backup.py (the function/class docstring that currently lists
included_namespaces, excluded_resources, snapshot_move_data, storage_location)
to add a line describing default_volumes_to_fs_backup (bool, optional): explain
its default behavior and what enabling it does (e.g., whether volumes are backed
up as filesystem snapshots by default), matching the style of the other
parameter entries.

Comment on lines +59 to +61
spec_dict["defaultVolumesToFsBackup"] = (
self.default_volumes_to_fs_backup if self.default_volumes_to_fs_backup is not None else False
)
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

defaultVolumesToFsBackup is always emitted, even when the caller never set it — inconsistent with all other optional fields.

Every other optional field in to_dict() is guarded by a truthiness or existence check and is omitted from the spec when not provided. This field unconditionally writes defaultVolumesToFsBackup: false whenever default_volumes_to_fs_backup is None, which can silently override a server-side or cluster-level default that differs from false.

The bool | None = None signature already signals "this field is optional"; the serialisation should honour that by only emitting the key when the caller explicitly provides a value (including an explicit False).

♻️ Proposed fix
-            spec_dict["defaultVolumesToFsBackup"] = (
-                self.default_volumes_to_fs_backup if self.default_volumes_to_fs_backup is not None else False
-            )
+            if self.default_volumes_to_fs_backup is not None:
+                spec_dict["defaultVolumesToFsBackup"] = self.default_volumes_to_fs_backup
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ocp_resources/backup.py` around lines 59 - 61, In to_dict() fix the
unconditional emission of spec_dict["defaultVolumesToFsBackup"] — instead of
always writing False when self.default_volumes_to_fs_backup is None, only set
spec_dict["defaultVolumesToFsBackup"] when self.default_volumes_to_fs_backup is
not None (so an explicit False is preserved but None omits the key); locate the
logic around the default_volumes_to_fs_backup attribute in the to_dict() method
and change the assignment to a conditional presence check before adding the
"defaultVolumesToFsBackup" key.

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

Comments