Skip to content

Conversation

@vsibirsk
Copy link
Contributor

@vsibirsk vsibirsk commented Nov 27, 2025

Short description:

removed wait_for_domstate_pause_status from pause/unpause (when called with wait=True):

  1. check for domstate was an old w/a which is irrelevant now
  2. executing domstate command on virt-launhcer pod can be done only with admin client (even though pause/unpause can be executed by unpriv client)
More details:
What this PR does / why we need it:
Which issue(s) this PR fixes:
Special notes for reviewer:
Bug:

Summary by CodeRabbit

  • Refactor

    • Simplified virtual machine pause status detection by consolidating the status-checking logic into a single unified method.
  • Chores

    • Added runtime deprecation warnings for legacy pause-status routines; behavior and public interfaces remain unchanged.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 27, 2025

Walkthrough

Two methods in ocp_resources/virtual_machine_instance.py now emit deprecation warnings at runtime (wait_for_domstate_pause_status, get_domstate); behavior and public signatures remain unchanged.

Changes

Cohort / File(s) Summary
Deprecation warnings added
ocp_resources/virtual_machine_instance.py
Added warnings.warn deprecation messages in wait_for_domstate_pause_status and get_domstate. No signature changes; wait_for_pause_status behavior unchanged and still routes through existing code paths that may call the deprecated method.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify deprecation messages are clear and use appropriate warning category (e.g., DeprecationWarning or FutureWarning) and wording.
  • Ensure no unintended side effects from importing/using warnings.
  • Confirm call sites handle the runtime warnings as expected and that behavior is unchanged.

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is largely incomplete, missing critical sections like 'More details', 'What this PR does / why we need it', and 'Special notes for reviewer'. Expand the description by filling in the missing template sections with detailed information about the changes, rationale, and testing performed.
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title is vague and generic, lacking specificity about what was changed regarding VMI pause/unpause functionality. Clarify the title to specify the main change, e.g., 'Remove domstate workaround from VMI pause/unpause' or 'Fix VMI pause/unpause privilege requirement'.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 82ae491 and fb30fde.

📒 Files selected for processing (1)
  • ocp_resources/virtual_machine_instance.py (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • ocp_resources/virtual_machine_instance.py

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: A tracking issue is created for this PR and will be closed when the PR is merged or closed
  • Pre-commit Checks: pre-commit runs automatically if .pre-commit-config.yaml exists
  • Branch Labeling: Branch-specific labels are applied to track the target branch
  • Auto-verification: Auto-verified users have their PRs automatically marked as verified

📋 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)

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

Container Operations

  • /build-and-push-container - Build and push container image (tagged with PR number)
    • Supports additional build arguments: /build-and-push-container --build-arg KEY=value

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, or 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
  • Container Builds: Container images are automatically tagged with the PR number
  • 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.

@vsibirsk vsibirsk changed the title Update VMI pause/unpause fix: Update VMI pause/unpause Nov 27, 2025
@vsibirsk
Copy link
Contributor Author

vsibirsk commented Nov 27, 2025

/verified

(multiple pause/unpause VM in a loop)

@rnetser
Copy link
Collaborator

rnetser commented Nov 28, 2025

/verified

local run (only create-start-pause/unpause-delete tests)

===================================================================== 60 passed, 0 skipped, 15 deselected, 26 warnings in 2366.66s (0:39:26) ======================================================================
$ uv run pytest -s -o log_cli=true --tc-file=tests/global_config_x86_64.py --tc-format=python --cluster-sanity-skip-check --storage-class-matrix=ocs-storagecluster-ceph-rbd-virtualization --skip-deprecated-api-test tests/virt/cluster/common_templates/fedora/test_fedora_os_support.py --latest-fedora --count=15 --repeat-scope=session

this repo is not tied to other repos for verification; please remove, you can explain that the verification was done by pause/unpause a VM

Copy link
Collaborator

@myakove myakove left a comment

Choose a reason for hiding this comment

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

This is a breaking change, you removed function that may be used (functions was not private).
Please deprecate them instead of delete them.

removed wait_for_domstate_pause_status from pause/unpause
(when called with wait=True):
  1. check for domstate was an old w/a with is irrelevant now
  2. executing domstate command on virt-launhcer pod can be done
     only with admin client (even though pause/unpause can be
     executed by unpriv client)
@rnetser
Copy link
Collaborator

rnetser commented Nov 30, 2025

/approve
/lgtm

@vsibirsk
Copy link
Contributor Author

/verified

@myakove myakove merged commit c41b34e into RedHatQE:main Dec 1, 2025
7 checks passed
@vsibirsk vsibirsk deleted the vk-update-vmi-pause-unpause branch December 1, 2025 14:17
rnetser pushed a commit to RedHatQE/openshift-virtualization-tests that referenced this pull request Dec 2, 2025
##### Short description:
 - Root cause fix is in python-wrapper (full details in jira ticket)
 - Refactor pause/unpause function names
 - drop optional migraion (never used)
 - remove admin_client dependency

##### More details:
Actual fix is in python-wrapper:
RedHatQE/openshift-python-wrapper#2596

##### What this PR does / why we need it:

##### Which issue(s) this PR fixes:

##### Special notes for reviewer:

##### jira-ticket:
https://issues.redhat.com/browse/CNV-72168


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Refactor**
* Simplified VM pause/unpause utilities by removing optional migration
paths and renaming helper functions for clearer, more consistent
behavior.

* **Tests**
* Updated tests to use the streamlined utilities across OS and GPU
scenarios; removed expected-failure markers so previously quarantined
pause/unpause tests now run as active tests.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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