Remove DataSource storage class fallback from DV template helper#4985
Conversation
|
Warning Review limit reached
More reviews will be available in 32 minutes and 4 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughdata_volume_template_with_source_ref_dict now sets the DataVolume's storage_class only from its ChangesStorage class passthrough and test wiring
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (4 passed)
✨ 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. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4985 +/- ##
==========================================
- Coverage 98.67% 98.65% -0.02%
==========================================
Files 25 25
Lines 2487 2456 -31
==========================================
- Hits 2454 2423 -31
Misses 33 33
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d211ddc to
3191752
Compare
|
Clean rebase detected — no code changes compared to previous head ( |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Get latest commit SHA
gh pr view 4985 --repo RedHatQE/openshift-virtualization-tests --json headRefOid -q '.headRefOid'
echo "=== Gating-marked test files ==="
rg -l '`@pytest.mark.gating`' tests/ 2>/dev/null || echo "None found"
echo "=== Gating tests that use data_volume_template_with_source_ref_dict ==="
rg -l 'data_volume_template_with_source_ref_dict' tests/ 2>/dev/null | xargs -I{} grep -l 'gating' {} 2>/dev/null || echo "None found"
echo "=== Smoke-marked test files ==="
rg -l '`@pytest.mark.smoke`' tests/ 2>/dev/null | head -20 || echo "None found"
echo "=== All callers of data_volume_template_with_source_ref_dict in tests/ ==="
rg -n 'data_volume_template_with_source_ref_dict' tests/ --type py -l
echo "=== All callers of data_volume_template_with_source_ref_dict in utilities/ ==="
rg -n 'data_volume_template_with_source_ref_dict' utilities/ --type py
echo "=== storage_class_name_scope_function callers ==="
rg -n 'storage_class_name_scope_function' tests/ --type py
echo "=== Check if any gating tests use storage_class_name_scope_function ==="
rg -l 'storage_class_name_scope_function' tests/ --type py | xargs -I{} grep -l 'gating' {} 2>/dev/null || echo "None"
echo "=== Check smoke tests that have data_volume or golden_image in path ==="
rg -l '`@pytest.mark.smoke`' tests/infrastructure/golden_images/ 2>/dev/null || echo "None"
rg -l '`@pytest.mark.smoke`' tests/virt/upgrade/ 2>/dev/null || echo "None"Length of output: 10369 🏁 Script executed: #!/bin/bash
COMMIT_SHA="2135565c9051fc6a828f2711d019fc06285d57ac"
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/RedHatQE/openshift-virtualization-tests/pulls/4985/comments \
-f commit_id="$COMMIT_SHA" \
-f path="tests/infrastructure/golden_images/test_common_templates_data_volumes.py" \
-f side="RIGHT" \
-F line=22 \
-f body="**Test Execution Plan**
- **Run smoke tests: True**
- \`tests/storage/cdi_upload/test_upload_virtctl.py\` (smoke) → \`tests/storage/conftest.py\` → \`data_volume_template_with_source_ref_dict\` (modified)
- \`tests/storage/cdi_clone/test_clone.py\` (smoke) → \`tests/storage/conftest.py\` → \`data_volume_template_with_source_ref_dict\` (modified)
- \`tests/infrastructure/instance_types/supported_os/test_rhel_os.py\` (smoke) → \`tests/infrastructure/instance_types/conftest.py\` → \`data_volume_template_with_source_ref_dict\` (modified)
- **Run gating tests: True**
- \`tests/virt/upgrade/test_upgrade_virt.py\` (gating) → \`tests/virt/upgrade/conftest.py\` → \`data_volume_template_with_source_ref_dict\` (modified, no \`storage_class\` passed → now uses cluster default instead of DataSource's SC)
**Directly affected tests:**
- \`tests/infrastructure/golden_images/test_common_templates_data_volumes.py::test_vm_from_golden_image_cluster_default_storage_class\`
- \`tests/infrastructure/golden_images/test_common_templates_data_volumes.py::test_vm_from_golden_image_different_storage_class\`
**Callers omitting \`storage_class\` (now default to cluster default instead of DataSource's SC):**
- \`tests/virt/upgrade/\` — via \`tests/virt/upgrade/conftest.py\`
- \`tests/infrastructure/golden_images/update_boot_source/test_boot_sources_vm.py\` — via \`tests/infrastructure/golden_images/update_boot_source/conftest.py\`
- \`tests/infrastructure/golden_images/update_boot_source/test_ssp_data_import_crons.py\`
**\`storage_class_name_scope_function\` fixture moved** (tests/storage/conftest.py → tests/conftest.py, same behavior):
- \`tests/storage/golden_image/test_golden_image.py\` (gating)
- \`tests/storage/cdi_upload/test_upload_virtctl.py\` (smoke, gating)
- \`tests/storage/general/test_storage_behavior.py\`
- \`tests/storage/test_data_import_cron.py\`" \
--jq '.id'Length of output: 2324 |
|
/approve |
|
Verified gating as well. |
|
/lgtm |
|
/approve |
|
New container for quay.io/openshift-cnv/openshift-virtualization-tests:latest published |
|
/cherry-pick cnv-4.22 |
|
Cherry-picked PR Remove DataSource storage class fallback from DV template helper into cnv-4.22: #5140 |
What this PR does / why we need it:
When calling
data_volume_template_with_source_ref_dictwe should either use it with explicitstorage_classfield, or omit the field and use the default storage class.Relying on the storage class of the DataSources can cause miss interpretations, while also causing issues since it is not possible to match the storage class to the DataSource, if a snap shot storage class is used.
Which issue(s) this PR fixes:
Failing tests when snapshot storage classes are set.
Special notes for reviewer:
Since we could not decide the storage class according to the
VolumeSnapshotthat was used when creating the VM, this is the approach we decided to use.jira-ticket:
https://redhat.atlassian.net/browse/CNV-88988
Summary by CodeRabbit
Bug Fixes
Tests