Skip to content

refactor!: Remove the deprecated override in wait() method from DataVolume class - #2884

Merged
myakove merged 2 commits into
RedHatQE:mainfrom
ema-aka-young:remove-dv-wait
Nov 24, 2026
Merged

myakove merged 2 commits into
RedHatQE:mainfrom
ema-aka-young:remove-dv-wait

Conversation

@ema-aka-young

@ema-aka-young ema-aka-young commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor
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:
Special notes for reviewer:

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

Bug:

Summary by CodeRabbit

  • API Changes
    • Removed the deprecated DataVolume wait method. Applications that called this method may need to be updated to use wait_for_dv_success() or the inherited wait behavior instead. The removed method previously supported waiting for the resource to exist or waiting for its success and PVC binding.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

No actionable comments were generated in the recent review.

Walkthrough

The deprecated DataVolume.wait() method was removed. Its prior behavior included an existence-only option and waits for DataVolume success and PVC binding.

Changes

DataVolume wait method

Layer / File(s) Summary
Remove deprecated wait method
ocp_resources/datavolume.py
The DataVolume.wait() method was removed. It previously supported existence-only waits and waits for DataVolume success and PVC binding.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Refactor

Suggested reviewers: rnetser

Merge Risk: Minimal · up to 21b74

This removes the deprecated DataVolume.wait() so DataVolume uses the standard Resource wait, and callers needing success and PVC binding use wait_for_dv_success(). Downstream code that relied on create(wait=True) waiting for DataVolume success will now only wait for existence. That is the intended, declared breaking change. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
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.
Title check Passed The title names the main change: the deprecated override of wait() in the DataVolume class is removed. The raw summary confirms that DataVolume.wait() was deleted (-17 lines in ocp_resources/datavolum…
Description check Passed The description states the intent (let DataVolume.wait() fall back to the parent Resource.wait() method), the reason (deprecate DataVolume.wait() in favor of wait_for_dv_success() to address bad pract…
Full details: Title check

Explanation

The title names the main change: the deprecated override of wait() in the DataVolume class is removed. The raw summary confirms that DataVolume.wait() was deleted (-17 lines in ocp_resources/datavolume.py), and the objectives say callers fall back to Resource.wait() or use wait_for_dv_success(). The title is specific and matches the changeset. The conventional-commit 'refactor!' prefix marks a breaking change, which fits the removal of a public method.

Full details: Description check

Explanation

The description states the intent (let DataVolume.wait() fall back to the parent Resource.wait() method), the reason (deprecate DataVolume.wait() in favor of wait_for_dv_success() to address bad practice and prevent bugs), and a related task and PR reference. The template sections 'More details', 'Which issue(s) this PR fixes', 'Bug', and the 'Special notes' content are only partly filled. The 'Short description' and 'What this PR does' sections are present and clear. The description is mostly complete, so the check passes. The Short description is a bit contradictory with the body: it says the intent is to let wait() fall back to the parent, while the change removes the method entirely, which the reviewer may want clarified.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 742a7aa and 49c63c9.

Files selected for processing: 1

  • ocp_resources/datavolume.py
Files with no reviewable changes: 1

  • ocp_resources/datavolume.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@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 (PR author or approvers)
  • /hold cancel - Unblock PR merging (PR author or approvers)
  • /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 (effective maintainers and approvers only)
  • /automerge cancel - Remove automerge label (effective 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 (EnMaaS/rits/deepseek-ai/DeepSeek-V4.1-Flash-1017)
  • Cherry-Pick Conflict Resolution: Enabled (EnMaaS/rits/deepseek-ai/DeepSeek-V4.1-Flash-1017)
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.

@qodo-code-review

qodo-code-review Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Restore inherited DataVolume.wait() existence behavior

🐞 Bug fix 🕐 10-20 Minutes

Grey Divider

AI Description

• Remove the deprecated DataVolume.wait() override so calls use Resource.wait() to check existence.
• Keep wait_for_dv_success() as the explicit method for DataVolume and PVC readiness.
Merge Risk 🟡 Medium

Blast radius 🟢 Low 💥 1 capability

  • 1 affected end-to-end capability after fault-specific containment; implementation boundaries do not widen its functional scope.
  • The changed public wait behavior and the downstream consumer decision to proceed after that wait are one bounded end-to-end DataVolume readiness capability.
  • Resource.wait(), DataVolume.wait_for_dv_success(), and the associated PVC status check are implementation stages of this capability rather than independent functional scopes.
  • Legacy keyword compatibility is part of the same bounded DataVolume readiness synchronization capability; it is not an independent capability merely because the failure occurs at argument binding.
Behavioral complexity 🟡 Medium 🧩 Compatibility cases

  • Before: DataVolume.wait() accepted timeout, failure_timeout, wait_for_exists_only, and sleep, and its normal path waited for DataVolume Succeeded followed by PVC Bound.
  • After: method resolution uses Resource.wait(), whose contract accepts only timeout and sleep and returns after the resource exists.
  • New correctness condition: callers must remain compatible with the inherited signature and must not treat object existence as DataVolume readiness.
  • This is a compatibility-case change; the underlying polling helper is reused and no new algorithm or concurrency protocol is introduced.
Sources

ocp_resources/datavolume.py[304-305]

    def wait_for_dv_success(
        self,
Potential damage 🟡 Medium 🩹 Recoverable

  • If the changed behavior regresses, a dependent workflow can start before DataVolume population or PVC binding completes, causing transient follow-on failures or requiring the caller to wait again.
  • Reverting the library restores the prior method contract.
  • Without rollback, a consumer can use the existing wait_for_dv_success() method or retry after the DataVolume and PVC become ready.
  • No persistent state corruption, automatic repair, or irreversible external effect is established by the inspected code.
  • Any external side effect caused by a consumer proceeding early is consumer-specific and not demonstrated here.
  • Code rollback restores the old wait contract.
  • Otherwise, recovery requires the consumer to use wait_for_dv_success() or an equivalent explicit readiness check and retry any premature operation; the source does not establish automatic repair or compensation for already-triggered consumer effects.
Sources

ocp_resources/datavolume.py[304-305]

    def wait_for_dv_success(
        self,
Assessed commit 21b74f9
Diagram

graph TD
  Caller["DataVolume caller"] --> Wait["wait()"] --> Resource["Resource.wait()"] --> Exists["Existence check"]
  Caller --> Success["wait_for_dv_success()"] --> Status["DV succeeded"] --> PVC["PVC bound"]
Loading
High-Level Assessment

Removing the override is the simplest way to restore the shared Resource.wait() contract while retaining wait_for_dv_success() for readiness. Keeping a forwarding override would add no useful behavior.

Files changed (1) +0 / -17

Bug fix (1) +0 / -17
datavolume.pyRemove deprecated DataVolume.wait() override +0/-17

Remove deprecated DataVolume.wait() override

• Deletes the override that waited for DataVolume success and PVC binding by default. DataVolume.wait() now inherits Resource.wait(), which waits only for the resource to exist; wait_for_dv_success() remains available for readiness checks.

ocp_resources/datavolume.py

@qodo-code-review

qodo-code-review Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. DataVolume create(wait=True) returns before the disk is ready ✗ Dismissed

Dismissed as Intentional

Description
Removing the DataVolume.wait override makes Resource.create (self.wait() at resource.py:1110)
and Resource.wait_for_condition (self.wait(...) at resource.py:1339) fall through to
Resource.wait, which only polls self.exists. Any DataVolume created with wait=True, or any
wait_for_condition call on a DV, now returns as soon as the DV object exists, not when it reaches
SUCCEEDED and its PVC is Bound as the removed method guaranteed.


Remediation recommended

2. Callers of dv.wait() silently get weaker checks ✗ Dismissed

Dismissed as Intentional

Description
Existing callers of dv.wait() in other repositories (such as the linked test suite) that use
default arguments now get an existence-only wait, and callers passing wait_for_exists_only or
failure_timeout get a TypeError. The removed signature `wait(timeout, failure_timeout,
wait_for_exists_only, sleep)` means a bare call silently changes meaning rather than failing loudly.

Grey Divider

Context sources
✅ Linked PRs:
  🌐 PR #2613
⚠️ Tickets: not configured — No jira integration is connected for the linked tickets
✅ Compliance rules (platform): 19 rules
✅ Cross-repo context — repo relationships
✅ REVIEW.md
Review mode: Auto: 🚀 Fast: Localized removal of one deprecated method with contained runtime impact.

Grey Divider

Tip of the day
💡 Did you know, you can show, collapse, or hide each part of a finding: code, evidence, and all

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread ocp_resources/datavolume.py Resolved
Comment thread ocp_resources/datavolume.py Resolved
@ema-aka-young ema-aka-young changed the title refactor: remove deprecated wait() method from DataVolume class refactor!: Remove the deprecated override in wait() method from DataVolume class Nov 23, 2026
@ema-aka-young

Copy link
Copy Markdown
Contributor Author

/verified
openshift-virtualization-tests-runner/6841

@rnetser rnetser left a comment

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.

please fix the pr description; this repo is a standlone one and is not tied to openshift-virt-tests one.

@ema-aka-young

Copy link
Copy Markdown
Contributor Author

@rnetser I have removed the mention to our tests repo

@jpeimer

jpeimer commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@myakove

myakove commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

/lgtm
/approve

@redhat-qe-bot1

Copy link
Copy Markdown

Clean rebase detected — no code changes compared to previous head (49c63c9).
The following labels were preserved: verified, commented-rnetser, approved-myakove, lgtm-jpeimer, lgtm-myakove, commented-ema-aka-young, commented-qodo-code-review[bot].

@myakove
myakove merged commit bcb97e8 into RedHatQE:main Nov 24, 2026
9 of 10 checks passed
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