Skip to content

Storage: Add DPA resource#2697

Open
dalia-frank wants to merge 1 commit intoRedHatQE:mainfrom
dalia-frank:add_resource_dpa
Open

Storage: Add DPA resource#2697
dalia-frank wants to merge 1 commit intoRedHatQE:mainfrom
dalia-frank:add_resource_dpa

Conversation

@dalia-frank
Copy link
Copy Markdown
Contributor

@dalia-frank dalia-frank commented Apr 19, 2026

Short description:

Add DataProtectionApplication (DPA) to ocp_resources

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 support for OpenShift Data Protection Application resources, enabling users to manage and configure data protection applications within OpenShift clusters
    • Provides integration with existing resource management infrastructure for seamless administration of data protection configurations and settings
    • Allows development teams to define and manage comprehensive data protection strategies across their OpenShift environments

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 19, 2026

Walkthrough

The changes add support for OpenShift Data Protection Application (OADP) resources. A new API group constant OADP_OPENSHIFT_IO is added to the base resource class, and a new DataProtectionApplication resource class is introduced that references this API group.

Changes

Cohort / File(s) Summary
Base Resource Configuration
ocp_resources/resource.py
Added new API group constant OADP_OPENSHIFT_IO with value "oadp.openshift.io" to the Resource.ApiGroup nested class.
New Resource Implementation
ocp_resources/data_protection_application.py
Added new DataProtectionApplication class subclassing NamespacedResource with api_group attribute set to NamespacedResource.ApiGroup.OADP_OPENSHIFT_IO.

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 PR description includes the short description section but leaves all other required template sections (More details, What this PR does / why we need it, Which issue(s) this PR fixes, Special notes for reviewer, Bug) empty or incomplete. Fill in the remaining template sections with details about the implementation, motivation for the change, any related issues, and relevant notes for reviewers.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Storage: Add DPA resource' clearly summarizes the main change: adding a new DataProtectionApplication (DPA) resource to the codebase.
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 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 and usage tips.

@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

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. 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])

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

Copy link
Copy Markdown

@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

🤖 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/data_protection_application.py`:
- Around line 1-10: Add the generated-code header/markers to this auto-generated
resource class: open the DataProtectionApplication class definition and prepend
the standard generated comment block used across ocp_resources (the one starting
"# Generated using
https://github.com/RedHatQE/openshift-python-wrapper/blob/main/scripts/resource/README.md"),
or re-run the class-generator to regenerate this file; ensure the generated
markers appear above the class and file imports and keep the existing class name
DataProtectionApplication, base NamespacedResource, and the api_group assignment
(NamespacedResource.ApiGroup.OADP_OPENSHIFT_IO) unchanged.
🪄 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: 84fe26b6-533a-4b91-8489-5ebc0e17740a

📥 Commits

Reviewing files that changed from the base of the PR and between f029e68 and 408fb10.

📒 Files selected for processing (2)
  • ocp_resources/data_protection_application.py
  • ocp_resources/resource.py

Comment on lines +1 to +10
from ocp_resources.resource import NamespacedResource


class DataProtectionApplication(NamespacedResource):
"""
DataProtectionApplication object. API reference:
https://docs.openshift.com/container-platform/latest/backup_and_restore/application_backup_and_restore/installing/about-installing-oadp.html
"""

api_group: str = NamespacedResource.ApiGroup.OADP_OPENSHIFT_IO
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# Check if the file exists and read its full contents
if [ -f "ocp_resources/data_protection_application.py" ]; then
  echo "=== File exists. Full contents: ==="
  cat -n "ocp_resources/data_protection_application.py"
  echo ""
  echo "=== File size: ==="
  wc -l "ocp_resources/data_protection_application.py"
else
  echo "File does not exist"
fi

Repository: RedHatQE/openshift-python-wrapper

Length of output: 641


🏁 Script executed:

# Check a few other files in ocp_resources to see if they have generated-code markers
echo "=== Checking for generated-code markers in ocp_resources files ==="
rg "Generated using https://github\.com/RedHatQE/openshift-python-wrapper" ocp_resources/ -l --max-count 5
echo ""
echo "=== Sample of auto-generated file structure ==="
for file in $(fd '\.py$' ocp_resources/ | head -3); do
  echo "--- File: $file ---"
  head -20 "$file"
  echo ""
done

Repository: RedHatQE/openshift-python-wrapper

Length of output: 6213


🏁 Script executed:

# Check git status to see if this is a new file
cd . && git status --porcelain | grep data_protection_application.py || echo "File not in git status"

Repository: RedHatQE/openshift-python-wrapper

Length of output: 99


Add generated-code markers or regenerate using the class-generator.

This ocp_resources resource class should include the generated-code markers since it follows the auto-generated pattern of other resources in this directory. Either regenerate it using the class-generator with the appropriate markers (# Generated using https://github.com/RedHatQE/openshift-python-wrapper/blob/main/scripts/resource/README.md) or add the markers manually if already generated.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ocp_resources/data_protection_application.py` around lines 1 - 10, Add the
generated-code header/markers to this auto-generated resource class: open the
DataProtectionApplication class definition and prepend the standard generated
comment block used across ocp_resources (the one starting "# Generated using
https://github.com/RedHatQE/openshift-python-wrapper/blob/main/scripts/resource/README.md"),
or re-run the class-generator to regenerate this file; ensure the generated
markers appear above the class and file imports and keep the existing class name
DataProtectionApplication, base NamespacedResource, and the api_group assignment
(NamespacedResource.ApiGroup.OADP_OPENSHIFT_IO) unchanged.

Copy link
Copy Markdown
Collaborator

@rnetser rnetser left a comment

Choose a reason for hiding this comment

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

please use class-generator to generate the module

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.

4 participants