feat(MTV-4803): per-disk xcopyUsed verification for mixed datastore migration#529
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThis PR enhances XCOPY copy-offload verification with regex-based log parsing to extract datastore display names and xcopyUsed values, refactors verify_xcopy_used to use these helpers, adds verify_xcopy_used_per_datastore for per-datastore assertions, and updates the mixed-datastore test to validate XCOPY usage per datastore. ChangesPer-Datastore XCOPY Verification
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Report bugs in Issues Welcome! 🎉This pull request will be automatically processed with the following features: 🔄 Automatic Actions
📋 Available CommandsPR Status Management
Review & Approval
Testing & Validation
Container Operations
Cherry-pick Operations
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
AI Features
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/copyoffload/test_copyoffload_migration.py`:
- Around line 2471-2474: The dict construction using
source_provider.get_datastore_name_by_id for xcopy_datastore_id and
non_xcopy_datastore_id must validate results and fail early if either call
returns None: call source_provider.get_datastore_name_by_id for each id, check
"if name is None:" and raise a clear error (or assert) naming the missing
datastore id and variable (e.g., xcopy_datastore_id / non_xcopy_datastore_id),
then populate datastore_names_by_id only with the validated non-None names;
reference the datastore_names_by_id mapping,
source_provider.get_datastore_name_by_id, xcopy_datastore_id and
non_xcopy_datastore_id to locate where to add these checks.
🪄 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: ASSERTIVE
Plan: Pro
Run ID: f23933fe-b672-4d2d-b4ae-0f7ad475e2c9
📒 Files selected for processing (2)
tests/copyoffload/test_copyoffload_migration.pyutilities/copyoffload_migration.py
|
/verified |
|
cc: @tshefi |
|
/lgtm |
Add verify_mixed_datastore_xcopy_used() and test_check_xcopy_used on TestCopyoffloadMixedDatastoreMigration. Expected xcopyUsed is derived from provider copyoffload datastore_id (1) and non_xcopy_datastore_id (0); pod logs are correlated via resolved vSphere datastore display names. Co-authored-by: Cursor <cursoragent@cursor.com>
Replace verify_mixed_datastore_xcopy_used with verify_xcopy_used_per_datastore, accepting expected_xcopy_by_datastore_id for any number of datastores. Co-authored-by: Cursor <cursoragent@cursor.com>
Read populate pod logs once per disk, surface the last xcopyUsed log line, and raise a clear error when copy-offload fails before xcopyUsed is logged. Co-authored-by: Cursor <cursoragent@cursor.com>
Include PASS/FAIL and the source log line in xcopy verification INFO logs. Co-authored-by: Cursor <cursoragent@cursor.com>
Head branch was pushed to by a user without write access
7df610b to
dbe942d
Compare
Code Review by Qodo
Context used✅ Tickets:
MTV-4803 1. Missing datastore coverage details
|
|
Clean rebase detected — no code changes compared to previous head ( |
|
/verified |
|
Code review by qodo was updated up to the latest commit dbe942d |
|
/cherry-pick v2.11 v2.10 |
|
Cherry-picked PR feat(MTV-4803): per-disk xcopyUsed verification for mixed datastore migration into v2.11: #533 |
|
New container for ghcr.io/redhatqe/mtv-api-tests:latest published |
|
Cherry-picked PR feat(MTV-4803): per-disk xcopyUsed verification for mixed datastore migration into v2.10: #534 |
…igration (#529) (#533) * feat(MTV-4803): add per-disk xcopyUsed check for mixed datastore test Add verify_mixed_datastore_xcopy_used() and test_check_xcopy_used on TestCopyoffloadMixedDatastoreMigration. Expected xcopyUsed is derived from provider copyoffload datastore_id (1) and non_xcopy_datastore_id (0); pod logs are correlated via resolved vSphere datastore display names. * refactor(MTV-4803): generalize per-datastore xcopyUsed verification Replace verify_mixed_datastore_xcopy_used with verify_xcopy_used_per_datastore, accepting expected_xcopy_by_datastore_id for any number of datastores. * improve(copyoffload): enrich xcopy log parsing and failure diagnostics Read populate pod logs once per disk, surface the last xcopyUsed log line, and raise a clear error when copy-offload fails before xcopyUsed is logged. * improve(copyoffload): log expected vs actual xcopyUsed per populate pod Include PASS/FAIL and the source log line in xcopy verification INFO logs. --------- Co-authored-by: Polina Rabinovich <58551443+prabinovRedhat@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
…igration (#529) (#534) * feat(MTV-4803): add per-disk xcopyUsed check for mixed datastore test Add verify_mixed_datastore_xcopy_used() and test_check_xcopy_used on TestCopyoffloadMixedDatastoreMigration. Expected xcopyUsed is derived from provider copyoffload datastore_id (1) and non_xcopy_datastore_id (0); pod logs are correlated via resolved vSphere datastore display names. * refactor(MTV-4803): generalize per-datastore xcopyUsed verification Replace verify_mixed_datastore_xcopy_used with verify_xcopy_used_per_datastore, accepting expected_xcopy_by_datastore_id for any number of datastores. * improve(copyoffload): enrich xcopy log parsing and failure diagnostics Read populate pod logs once per disk, surface the last xcopyUsed log line, and raise a clear error when copy-offload fails before xcopyUsed is logged. * improve(copyoffload): log expected vs actual xcopyUsed per populate pod Include PASS/FAIL and the source log line in xcopy verification INFO logs. --------- Co-authored-by: Polina Rabinovich <58551443+prabinovRedhat@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>

Summary
test_check_xcopy_usedtoTestCopyoffloadMixedDatastoreMigration(MTV-565) using a newverify_xcopy_used_per_datastore()utility for migrations where disks on different vSphere datastores have different expected XCOPY behavior.datastore_id→ expectxcopyUsed=1,non_xcopy_datastore_id→ expectxcopyUsed=0) to populate pod log display names for per-pod verification.xcopyUsedis logged, and INFO logs with expected vs actual values plus PASS/FAIL.Test plan
TestCopyoffloadMixedDatastoreMigrationon vSphere with mixed XCOPY and non-XCOPY datastores configured in provider JSONexpected=/actual=with(PASS)for XCOPY and fallback disksverify_xcopy_used()are unchangedJira: MTV-4803
Summary by CodeRabbit
Tests
Refactor