Skip to content

refactor: remove deprecated wait() method from DataVolume class#2704

Open
ema-aka-young wants to merge 2 commits into
RedHatQE:mainfrom
ema-aka-young:cnv-73197-remove-dv-wait
Open

refactor: remove deprecated wait() method from DataVolume class#2704
ema-aka-young wants to merge 2 commits into
RedHatQE:mainfrom
ema-aka-young:cnv-73197-remove-dv-wait

Conversation

@ema-aka-young
Copy link
Copy Markdown
Contributor

@ema-aka-young ema-aka-young commented Apr 30, 2026

Short description:

The intention is to allow DataVolume.wait() to fall back to the parent Resource.wait() method.

More details:
What this PR does / why we need it:

Deprecate DataVolume.wait() in favor of wait_for_dv_success() to fix bad practice and prevent bugs.

Which issue(s) this PR fixes:

This PR will allow us to safely de-quarantine https://github.com/RedHatQE/openshift-virtualization-tests/blob/2ee0d6e604bc3ade241bfb1a53879875eb7d2ecc/tests/storage/cdi_import/test_import_http.py#L62

Special notes for reviewer:

This PR needs to be merged first

This PR is part of this task, and continues the work started in #2613

Bug:

Summary by CodeRabbit

  • Refactor
    • Removed the wait() method from DataVolume. This is a breaking change—applications relying on this method will require updates. The removal eliminates deprecation warnings and simplifies the DataVolume interface.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

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: 5ecafd11-21b0-4d87-b422-95cf15a4d97d

📥 Commits

Reviewing files that changed from the base of the PR and between 0a07b2e and dc95f11.

📒 Files selected for processing (1)
  • ocp_resources/datavolume.py
💤 Files with no reviewable changes (1)
  • ocp_resources/datavolume.py

Walkthrough

This PR removes the deprecated DataVolume.wait() public method from the DataVolume resource class, eliminating a 17-line method that emitted a deprecation warning and previously handled waiting for DataVolume SUCCEEDED status and PVC BOUND state.

Changes

Deprecation removal

Layer / File(s) Summary
Remove DataVolume.wait method
ocp_resources/datavolume.py
Deletes the deprecated public DataVolume.wait(...) method that emitted a deprecation warning and implemented custom waiting logic for DataVolume/PVC status transitions.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 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 accurately describes the main change: removing the deprecated wait() method from the DataVolume class.
Description check ✅ Passed The description covers all required sections with relevant context: short description, purpose, issue references, and special notes for reviewers.
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.

@ema-aka-young ema-aka-young marked this pull request as ready for review April 30, 2026 08:10
@ema-aka-young ema-aka-young marked this pull request as draft April 30, 2026 08:17
@ema-aka-young ema-aka-young marked this pull request as ready for review May 4, 2026 07:31
@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.

@redhat-qe-bot redhat-qe-bot requested a review from rnetser May 4, 2026 07:32
@redhat-qe-bot redhat-qe-bot requested a review from myakove May 4, 2026 07:32
@redhat-qe-bot redhat-qe-bot changed the title Remove deprecated wait() method from DataVolume class refactor: remove deprecated wait() method from DataVolume class May 4, 2026
@ema-aka-young
Copy link
Copy Markdown
Contributor Author

/verified
with RedHatQE/openshift-virtualization-tests#4862 (comment)

@ema-aka-young
Copy link
Copy Markdown
Contributor Author

/verified
openshift-virtualization-tests-runner/5296

@redhat-qe-bot
Copy link
Copy Markdown
Contributor

Clean rebase detected — no code changes compared to previous head (3da5955).
The following labels were preserved: verified.

@ema-aka-young
Copy link
Copy Markdown
Contributor Author

/verified
RedHatQE/openshift-virtualization-tests#4862 (comment)

@dalia-frank
Copy link
Copy Markdown
Contributor

/lgtm

def wait(self, timeout=TIMEOUT_10MINUTES, failure_timeout=TIMEOUT_2MINUTES, wait_for_exists_only=False, sleep=1):
warn(
message="DataVolume.wait() is deprecated and will be removed in "
"the next version. Use wait_for_dv_success() instead.",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The wrapper hasn't branched yet. We planned to remove it in the next version (4.23) ?

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.

Actually, I thought it would be possible to include this as we haven't branched yet...

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