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 Data Protection Application resources, allowing configuration of backups, snapshot locations, feature flags, image pull policy, pod DNS/annotations, and unsupported overrides; requires a configuration payload.
  • Tests
    • Added end-to-end tests covering create, retrieve, update (metadata/labels) and delete behaviors for the Data Protection Application resource.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 19, 2026

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: 5510bde3-dca8-49ec-b577-1712a3198e4b

📥 Commits

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

📒 Files selected for processing (3)
  • ocp_resources/data_protection_application.py
  • ocp_resources/resource.py
  • tests/test_resources/test_data_protection_application.py
✅ Files skipped from review due to trivial changes (1)
  • ocp_resources/resource.py

Walkthrough

Adds OpenShift Data Protection Application (OADP) support: a new DataProtectionApplication NamespacedResource class and an API group constant OADP_OPENSHIFT_IO, plus tests exercising create/read/update/delete of the new resource.

Changes

Cohort / File(s) Summary
API Group Constant
ocp_resources/resource.py
Adds OADP_OPENSHIFT_IO = "oadp.openshift.io" to Resource.ApiGroup.
New Resource Class
ocp_resources/data_protection_application.py
Introduces DataProtectionApplication subclassing NamespacedResource, sets api_group to the new API group, accepts multiple spec-related ctor args, and implements to_dict() that enforces configuration and conditionally includes optional spec fields.
Tests
tests/test_resources/test_data_protection_application.py
Adds an incremental pytest suite that creates a DataProtectionApplication fixture and tests deploy/retrieve/update/delete lifecycle behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description includes only the short description field filled; all other template sections (More details, What this PR does/why, Related issues, Special notes, Bug) are empty. Complete the missing template sections to provide context on rationale, implementation details, related issues, and any special reviewer notes.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Storage: Add DPA resource' clearly and concisely describes the main change—adding a DataProtectionApplication resource to the codebase.
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.

✏️ 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 thread ocp_resources/data_protection_application.py
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

@dalia-frank
Copy link
Copy Markdown
Contributor Author

/verified

@@ -0,0 +1,40 @@
import pytest
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why was this test added?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

https://github.com/RedHatQE/openshift-python-wrapper#adding-tests-for-new-resources

I saw that we have tests for other new resources so assumed we adding it, but can remove tests if not required

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