[Storage] Use source_dict for DataVolume source specification, refactor create_dv#5443
Conversation
|
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 (1)
💤 Files with no reviewable changes (1)
📜 Recent review details⏰ Context from checks skipped due to timeout. (5)
|
| Layer / File(s) | Summary |
|---|---|
HTTP and registry cases utilities/unittests/test_storage.py |
construct_datavolume_source_dict is imported through real-module setup, and HTTP/registry outputs are verified for plain URLs, optional secret/config-map inputs, and HTTP URL-validation behavior. |
PVC, blank, and upload cases utilities/unittests/test_storage.py |
PVC output is checked with and without namespace, and blank/upload sources are asserted to produce empty source dictionaries. |
Unsupported source case utilities/unittests/test_storage.py |
An unsupported source type is asserted to raise ValueError with the expected message. |
Estimated code review effort: 1 (Trivial) | ~5 minutes
Possibly related PRs
- RedHatQE/openshift-virtualization-tests#971: Touches the same CDI import/DataVolume source-building area in
tests/storage/cdi_import/conftest.py. - RedHatQE/openshift-virtualization-tests#4556: Also aligns test code with refactored
utilities.storageDataVolume construction. - RedHatQE/openshift-virtualization-tests#4761: Related Windows DataVolume registry/source wiring changes in shared test utilities.
Suggested labels: new-tests
Suggested reviewers: Acedus, acinko-rh, dalia-frank, ema-aka-young, josemacassan, kshvaika, RoniKishner
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title is under 120 characters and clearly summarizes the source_dict refactor and create_dv update. |
| Description check | ✅ Passed | All required sections are present and the PR purpose, scope, and reviewer notes are clearly described. |
| 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. |
| Stp Link Required | ✅ Passed | PASS: The PR adds no new tests/**/test_*.py files and no new test_* functions in existing test files; the only new test file is under utilities/unittests/, which is excluded. |
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
Warning
Review ran into problems
🔥 Problems
Linked repositories: Your configuration references 1 linked repositories, but your current plan allows 0. Analyzed ``, skipped RedHatQE/openshift-virtualization-tests-design-docs.
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 @coderabbitai help to get the list of available commands.
|
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
Branch Management
Custom Commands
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
AI Features
Security Checks
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
…zation-tests into add_dv_source_dict
|
/approve |
|
Clean rebase detected — no code changes compared to previous head ( |
|
/verified |
|
/lgtm |
2 similar comments
|
/lgtm |
|
/lgtm |
|
/rerun-smoke |
|
Successfully removed PR tag: quay.io/openshift-cnv/openshift-virtualization-tests:pr-5443. |
|
/cherry-pick cnv-4.22 |
|
Manual cherry-pick is needed |
|
New container for quay.io/openshift-cnv/openshift-virtualization-tests:latest published |
What this PR does / why we need it:
DataVolumesourceargument is deprecated and needs to be replaced by thesource_dictRefactor
create_dvand allDataVolumeinstantiations to usesource_dict=with
construct_datavolume_source_dict()instead of the legacysource=.Why: The old
create_dvinterface mixed source specification, artifactorylifecycle, and annotation handling into a single flat parameter list. This made
it unclear which parameters applied to which source types and coupled every
caller to artifactory internals.
Changes:
construct_datavolume_source_dict()as a pure function for buildingDataVolume source dicts from typed parameters (
http,registry,pvc,blank,upload)create_dvto acceptsource_dict=directly, own artifactorylifecycle in
try/finally, use genericannotationsdict instead ofmultus_annotation/bind_immediate, and add full type hintssecret→secret_name,cert_configmap→cert_configmap_name,source_pvc→source_pvc_name,source_namespace→source_pvc_namespacehostpath_nodeparameterWhich issue(s) this PR fixes:
Special notes for reviewer:
create_dvand updates callersusing
create_dv, second migrates directDataVolume()instantiations touse
construct_datavolume_source_dict()DataVolumespecs as beforearchitecturein DV spec.jira-ticket:
Summary by CodeRabbit
sourcesetup for HTTP, registry, blank, PVC, and upload scenarios.source_dictflow and new parameter names.