Skip to content

[Storage] Use source_dict for DataVolume source specification, refactor create_dv#5443

Open
jpeimer wants to merge 6 commits into
RedHatQE:mainfrom
jpeimer:add_dv_source_dict
Open

[Storage] Use source_dict for DataVolume source specification, refactor create_dv#5443
jpeimer wants to merge 6 commits into
RedHatQE:mainfrom
jpeimer:add_dv_source_dict

Conversation

@jpeimer

@jpeimer jpeimer commented Jul 1, 2026

Copy link
Copy Markdown
Contributor
What this PR does / why we need it:

DataVolume source argument is deprecated and needs to be replaced by the source_dict

Refactor create_dv and all DataVolume instantiations to use source_dict=
with construct_datavolume_source_dict() instead of the legacy source=.

Why: The old create_dv interface mixed source specification, artifactory
lifecycle, 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:

  • Extract construct_datavolume_source_dict() as a pure function for building
    DataVolume source dicts from typed parameters (http, registry, pvc, blank, upload)
  • Refactor create_dv to accept source_dict= directly, own artifactory
    lifecycle in try/finally, use generic annotations dict instead of
    multus_annotation/bind_immediate, and add full type hints
  • Rename parameters for consistency: secretsecret_name,
    cert_configmapcert_configmap_name, source_pvcsource_pvc_name,
    source_namespacesource_pvc_namespace
  • Remove unused hostpath_node parameter
  • Migrate all 36 caller files to the new interface
Which issue(s) this PR fixes:
Special notes for reviewer:
  • The two commits are stacked: first refactors create_dv and updates callers
    using create_dv, second migrates direct DataVolume() instantiations to
    use construct_datavolume_source_dict()
  • No behavioral changes — all callers produce the same DataVolume specs as before
  • This change is needed as preparation for specifying the architecture in DV spec.
jira-ticket:

Summary by CodeRabbit

  • New Features

    • Introduced a unified DataVolume source configuration flow that standardizes HTTP, registry, blank, PVC, and upload setup across VM, golden image, and related scenarios.
    • Standardized bind-immediate behavior via DataVolume annotations.
  • Bug Fixes

    • Fixed TLS and auth reference wiring by consistently using named secret and cert config-map fields.
    • Improved Artifactory-backed handling by enabling Artifactory mode in the relevant image import paths.
  • Tests

    • Updated fixtures and assertions to match the new unified configuration and renamed source location parameters.
    • Added unit coverage for the new source configuration helper.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: bd9633fb-f280-4d22-83a6-52d236b30ff0

📥 Commits

Reviewing files that changed from the base of the PR and between 5446621 and 6436367.

📒 Files selected for processing (38)
  • tests/chaos/conftest.py
  • tests/chaos/snapshot/conftest.py
  • tests/conftest.py
  • tests/data_protection/oadp/conftest.py
  • tests/infrastructure/golden_images/update_boot_source/test_ssp_common_templates_boot_sources.py
  • tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py
  • tests/infrastructure/instance_types/conftest.py
  • tests/infrastructure/instance_types/supported_os/conftest.py
  • tests/observability/metrics/utils.py
  • tests/scale/test_scale_benchmark.py
  • tests/storage/cdi_clone/test_clone.py
  • tests/storage/cdi_import/conftest.py
  • tests/storage/cdi_import/test_import_http.py
  • tests/storage/cross_cluster_live_migration/conftest.py
  • tests/storage/golden_image/test_golden_image.py
  • tests/storage/hpp/utils.py
  • tests/storage/online_resize/conftest.py
  • tests/storage/online_resize/test_online_resize.py
  • tests/storage/restricted_namespace_cloning/conftest.py
  • tests/storage/restricted_namespace_cloning/test_restricted_namespace_cloning.py
  • tests/storage/restricted_namespace_cloning/utils.py
  • tests/storage/storage_migration/conftest.py
  • tests/storage/test_cdi_certificate.py
  • tests/storage/test_cdi_resources.py
  • tests/storage/test_priority_class.py
  • tests/storage/test_wffc.py
  • tests/storage/utils.py
  • tests/storage/vm_export/utils.py
  • tests/utils.py
  • tests/virt/cluster/longevity_tests/utils.py
  • tests/virt/cluster/vm_cloning/test_vm_cloning.py
  • tests/virt/upgrade/conftest.py
  • tests/virt/upgrade_custom/vgpu/conftest.py
  • tests/virt/utils.py
  • utilities/oadp.py
  • utilities/storage.py
  • utilities/unittests/conftest.py
  • utilities/unittests/test_storage.py
👮 Files not reviewed due to content moderation or server errors (38)
  • tests/conftest.py
  • tests/chaos/conftest.py
  • tests/chaos/snapshot/conftest.py
  • tests/infrastructure/instance_types/supported_os/conftest.py
  • tests/storage/golden_image/test_golden_image.py
  • tests/storage/cdi_clone/test_clone.py
  • tests/storage/test_cdi_certificate.py
  • tests/data_protection/oadp/conftest.py
  • tests/utils.py
  • tests/infrastructure/instance_types/conftest.py
  • tests/observability/metrics/utils.py
  • tests/storage/test_wffc.py
  • utilities/oadp.py
  • utilities/storage.py
  • tests/scale/test_scale_benchmark.py
  • tests/virt/cluster/longevity_tests/utils.py
  • tests/storage/test_priority_class.py
  • tests/storage/cdi_import/test_import_http.py
  • tests/storage/vm_export/utils.py
  • tests/storage/cdi_import/conftest.py
  • tests/storage/utils.py
  • utilities/unittests/test_storage.py
  • tests/storage/cross_cluster_live_migration/conftest.py
  • tests/storage/test_cdi_resources.py
  • tests/storage/restricted_namespace_cloning/test_restricted_namespace_cloning.py
  • tests/storage/online_resize/conftest.py
  • tests/storage/restricted_namespace_cloning/conftest.py
  • tests/virt/cluster/vm_cloning/test_vm_cloning.py
  • tests/storage/restricted_namespace_cloning/utils.py
  • tests/storage/online_resize/test_online_resize.py
  • utilities/unittests/conftest.py
  • tests/virt/upgrade_custom/vgpu/conftest.py
  • tests/storage/storage_migration/conftest.py
  • tests/virt/upgrade/conftest.py
  • tests/virt/utils.py
  • tests/infrastructure/golden_images/update_boot_source/test_ssp_common_templates_boot_sources.py
  • tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py
  • tests/storage/hpp/utils.py

📝 Walkthrough
🚥 Pre-merge checks | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Stp Link Required ❓ Inconclusive Custom check execution failed before a final verdict was produced. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
✨ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@openshift-virtualization-qe-bot-6

Copy link
Copy Markdown

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
  • 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: Enabled categories: branch, can-be-merged, cherry-pick, has-conflicts, hold, needs-rebase, size, verified, wip

📋 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)
  • /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)
  • /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 build-container - Rebuild and test container image
  • /retest verify-bugs-are-open - verify-bugs-are-open
  • /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
  • /cherry-pick-retry <branch> - Retry a failed cherry-pick (merged PRs only)

Branch Management

  • /rebase - Rebase this PR branch onto its base branch

Custom Commands

  • /test-plan - Triggers CodeRabbit to analyze the PR's changed files and post a test execution plan
  • /rerun-smoke - Adds `retest-smoke` label on the PR to trigger smoke tests exectuion

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 2 /lgtm from reviewers
  3. Status Checks: All required status checks must pass
  4. No Blockers: No wip, hold, has-conflicts labels and PR must be mergeable (no conflicts)
  5. Verified: PR must be marked as verified

📊 Review Process

Approvers and Reviewers

Approvers:

  • dshchedr
  • jpeimer
  • myakove
  • rnetser
  • vsibirsk

Reviewers:

  • Acedus
  • Ahmad-Hafe
  • Dsanatar
  • OhadRevah
  • RoniKishner
  • SamAlber
  • acinko-rh
  • akalenyu
  • akri3i
  • albarker-rh
  • awels
  • dalia-frank
  • dshchedr
  • ema-aka-young
  • geetikakay
  • guchen11
  • hmeir
  • josemacassan
  • jpeimer
  • kgoldbla
  • kshvaika
  • mijankow
  • rlobillo
  • rnetser
  • sarahbx
  • vsibirsk
Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve
AI Features
  • Cherry-Pick Conflict Resolution: Enabled (claude/claude-opus-4-6-1m)
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
  • 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.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 1, 2026
@rnetser

rnetser commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

/approve
/lgtm

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.67%. Comparing base (a2dc143) to head (2ec4f73).
⚠️ Report is 196 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5443   +/-   ##
=======================================
  Coverage   98.67%   98.67%           
=======================================
  Files          25       42   +17     
  Lines        2487     2493    +6     
=======================================
+ Hits         2454     2460    +6     
  Misses         33       33           
Flag Coverage Δ
utilities 98.67% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jpeimer

jpeimer commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

/build-and-push-container

@openshift-virtualization-qe-bot-2

Copy link
Copy Markdown
Contributor

New container for quay.io/openshift-cnv/openshift-virtualization-tests:pr-5443 published

@jpeimer

jpeimer commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

/test-plan

@openshift-virtualization-qe-bot-3

Copy link
Copy Markdown
Contributor

@coderabbitai

Test execution plan request details

CRITICAL: You MUST post an inline review comment on the first changed line of the first file.
The inline comment should contain the full Test Execution Plan (smoke decision, gating decision, and specific affected tests).
Do NOT submit a blocking review event (REQUEST_CHANGES/APPROVE).
Post a single inline PR comment on Files Changed (non-blocking COMMENT flow).

As an expert software testing engineer, analyze all modified files in this PR and create a targeted test execution plan.
You will post an inline review comment with the test execution plan on the first changed file.
If you fail to run or post a comment, retry.

Analysis Requirements:

  1. Examine code changes in each modified file

  2. Identify affected code paths, functions, and classes

  3. Analyze pytest-specific elements: fixtures (scope, dependencies), parametrization, markers, conftest changes

  4. Trace test dependencies through imports, shared utilities, fixture inheritance, fixture teardown, and yield from cleanup in conftest

  5. Detect new tests introduced in the PR

  6. Utilities and libs impact (when utilities/ or libs/ changes):
    You MUST use shell scripts (rg, git diff) to trace the full impact.
    Follow these sub-steps in order:

    6a. Identify modified symbols: For each changed file under utilities/ or libs/,
    list every modified function or method.
    Example: git diff HEAD~1 --unified=0 -- utilities/hco.py | grep '^[+-]def '

    6b. Find direct callers: Search tests and conftest for each symbol from 6a.
    Example: rg -l 'get_hco_version' tests/

    6c. Trace fixture teardown and cleanup: Find fixtures that reach
    the modified symbol through yield from or context-manager wrappers.
    Example: rg -l 'yield from.*enable_common_boot|def.*enable_common_boot' tests/

    6d. Trace same-file callers: In each changed file, find other functions
    whose body calls a modified symbol (including code after yield
    in @contextmanager helpers).
    Example: rg 'get_hco_version|enable_common_boot' utilities/hco.py

    6e. Expand transitively: If function A calls modified B, then
    tests/fixtures that call A are affected — even when the test body
    never imports B directly.

    Do NOT limit impact to tests that import the modified symbol only.

  7. Smoke test impact: Intersect the affected set from step 6 with smoke-marked tests.
    Run: rg -l '@pytest.mark.smoke' tests/
    VERIFY the above command returned actual file paths before concluding False.
    Set True if either condition is met:

    • a smoke-marked file appears in the affected set from 6b-6e, OR
    • any conftest.py in the smoke test's parent-directory hierarchy (up to repo root)
      imports or calls a modified utilities/libs symbol — including autouse fixtures
      that depend on modified functions. ALL tests in that directory and below are affected.
      Example check: for each smoke_file, scan dirname(smoke_file)/conftest.py,
      dirname(dirname(smoke_file))/conftest.py, etc. for modified symbol imports
      and autouse fixtures that depend on modified symbols.
  8. Gating test impact: Intersect the affected set from step 6 with gating-marked tests.
    Run: rg -l '@pytest.mark.gating' tests/
    Set True if a gating-marked file also appears in the affected set from 6b-6e.
    Utilities/libs changes often affect gating tests without affecting smoke tests.
    Do NOT stop analysis after concluding Run smoke tests: False.

Output rules:
Do NOT include analysis step numbers (1-8) in your visible output.

Your deliverable:
Your inline informational comment will be based on the following requirements:

Test Execution Plan

  • Run smoke tests: True / False — If True, state the dependency path (test → fixture → changed symbol). True ONLY with a verified path.
  • Run gating tests: True / False — If True, state the dependency path. True if any gating-marked test is in the affected set.
  • Affected tests to run (required when utilities/, libs/, or shared conftest changes — list concrete paths even when smoke is False)

Use these formats:

  • path/to/test_file.py - When the entire test file needs verification
  • path/to/test_file.py::TestClass::test_method - When specific test(s) needed
  • path/to/test_file.py::test_function - When specific test(s) needed
  • -m marker - When a marker covers multiple affected tests (e.g. -m gating only if ALL gating tests in scope need run)
  • Tag each listed test or group with its marker when not obvious, e.g. (gating) or (smoke)

Real test commands (MANDATORY when changes affect session/runtime code):

When the affected code runs at session/collection time (conftest fixtures, pytest plugins,
config hooks, session-scoped setup) or modifies runtime behavior that unit tests mock away,
you MUST include concrete pytest commands the PR author must run on a real cluster
to verify the change works end-to-end. Include:

  • A command for the error/fix path (the scenario the PR fixes)
  • A command for the happy path (regression: the normal case still works)
  • Use lightweight tests (e.g., --collect-only for startup failures,
    a single small test for runtime behavior)
    If the PR only changes test logic (not utilities/libs/conftest), the affected test
    paths themselves serve as the real test commands — no separate section needed.

Example output for a session-startup fix:

**Real tests (cluster required)**
Error path (the fix):
`pytest tests/storage/.../test_foo.py --storage-class-matrix=nonexistent-sc --collect-only`
Expected: ValueError with clear message, not IndexError

Happy path (regression):
`pytest tests/storage/.../test_foo.py --storage-class-matrix=<valid-sc> -k test_bar`
Expected: session starts normally

Guidelines:

  • Include tests affected directly OR via fixture setup/teardown, yield from cleanup, or transitive utility call chains (caller calls modified helper)
  • Use a full file path only if ALL tests in that file require verification
  • Use file path + test name when only specific tests use an affected fixture or utility wrapper (preferred for partial file impact)
  • If a test marker can cover multiple files/tests, provide the marker
  • Balance coverage vs over-testing - Keep descriptions minimal
  • Example: if leaf helper foo() changes, include tests whose fixture teardown calls wrapper bar() where bar() calls foo(), even when the test body only imports an unrelated symbol from the same utilities module

Hardware-Related Checks (SR-IOV, GPU, DPDK):

When PR modifies fixtures for hardware-specific resources:

  • Collection Safety: Fixtures MUST have existence checks (return None when hardware unavailable)
  • Test Plan: MUST verify both WITH and WITHOUT hardware:
    • Run affected tests on cluster WITH hardware
    • Verify collection succeeds on cluster WITHOUT hardware

CRITICAL WORKFLOW COMPLETION RULES:

When responding to this test execution plan request, you MUST follow these rules EXACTLY:

  1. YOUR ONLY DELIVERABLE: Post one non-blocking inline comment containing the test execution plan on the first changed line
  2. THEN STOP IMMEDIATELY - Do NOT generate any additional response
  3. FALLBACK ONLY: If inline comment API calls fail after retrying, post as a regular PR comment
  4. SILENCE = SUCCESS: After successfully submitting the review, your task is complete. No confirmation needed.

ABSOLUTE PROHIBITIONS (violating these creates empty/meaningless reviews):

  • ❌ Do NOT post acknowledgment messages like "Test execution plan posted", "Review posted successfully", "I've successfully posted"
  • ❌ Do NOT mention review IDs, URLs, or confirmation of posting in the PR thread
  • ❌ Do NOT add any follow-up comments after submitting the review
  • ❌ Do NOT reply to confirm task completion
  • ❌ Do NOT explain what you did - just do it and stop

Remember: The pull request review is visible to users. Additional comments are redundant noise.

CRITICAL — Verification rules for smoke and gating decisions:
- For each True decision, you must have traced a concrete path: test file → fixture → utility function → modified symbol.
- Do NOT assume impact based on scope, file proximity, or infrastructure-sounding names.
Only set True when you trace a concrete path through steps 6a-6e, then 7 or 8.
WRONG: "utilities/hco.py changed → run smoke" (no traced dependency path)
WRONG: "Run smoke tests: False" with no affected-test list when gating tests use the changed utility
RIGHT: "Run smoke tests: False, Run gating tests: True" plus tests/.../test_foo.py::TestBar::test_baz (gating)
RIGHT: "Smoke test X uses fixture Y → wrapper Z → changed function W in utilities/hco.py"

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== diff stat ==="
git log --oneline -5
git diff origin/main...HEAD --stat -- utilities/storage.py || true

echo "=== modified functions in utilities/storage.py ==="
git diff origin/main...HEAD -- utilities/storage.py | grep -E '^[+-]def ' || true

echo "=== smoke-marked test files ==="
rg -l '`@pytest.mark.smoke`' tests/ || true

echo "=== gating-marked test files ==="
rg -l '`@pytest.mark.gating`' tests/ || true

echo "=== callers of create_dv ==="
rg -l '\bcreate_dv\(' tests/ | head -50

echo "=== callers of construct_datavolume_source_dict ==="
rg -l 'construct_datavolume_source_dict' tests/ utilities/ | head -50

echo "=== callers of data_volume( fixture / data_volume_template_dict ==="
rg -l 'data_volume_template_dict|def data_volume\(' tests/ utilities/ | head -50

Length of output: 7410


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== test_container_disk_vm.py imports/fixtures ==="
rg -n 'create_dv|DataVolume|data_volume' tests/virt/node/general/test_container_disk_vm.py tests/virt/node/general/conftest.py 2>/dev/null || true

echo "=== cdi_upload conftest create_dv usage ==="
rg -n 'create_dv\(' tests/storage/cdi_upload/conftest.py

echo "=== test_upload_virtctl.py fixtures used ==="
rg -n 'def test_' tests/storage/cdi_upload/test_upload_virtctl.py | head -20
rg -n 'fixture' tests/storage/cdi_upload/conftest.py | head -20

echo "=== common_templates conftest data_volume_template_dict usage ==="
rg -n 'data_volume_template_dict' tests/virt/cluster/common_templates/conftest.py

echo "=== csv smoke test and install_upgrade_operators create_dv relevance ==="
rg -n 'create_dv|DataVolume' tests/install_upgrade_operators/csv/test_csv.py || true

Length of output: 2876


🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n -A10 'def get_data_volume_template_dict_with_default_storage_class' tests/virt/utils.py

Length of output: 722


🏁 Script executed:

#!/bin/bash
set -euo pipefail
sed -n '473,500p' tests/virt/utils.py

Length of output: 1606


🏁 Script executed:

#!/bin/bash
set -euo pipefail
echo "=== exact calls to data_volume_template_dict( ==="
rg -n '\bdata_volume_template_dict\(' tests/ utilities/ || true
echo "=== exact calls to create_dv( within cdi_clone/test_clone.py context ==="
rg -n 'create_dv\(' tests/storage/cdi_clone/test_clone.py

Length of output: 798


@openshift-virtualization-qe-bot-3: Note that this thread has no diff context available to me, so I can't post a native inline review comment on a specific line — I'm posting the full Test Execution Plan here instead.

Test Execution Plan

  • Run smoke tests: Truetests/storage/cdi_clone/test_clone.py calls create_dv(source_pvc_name=..., source_pvc_namespace=...) and data_volume_template_dict(...) directly, both changed in utilities/storage.py. tests/storage/cdi_upload/test_upload_virtctl.py → fixture uploaded_dv_scope_class (tests/storage/cdi_upload/conftest.py:79) → create_dv(...).
  • Run gating tests: True — Same test_clone.py and test_upload_virtctl.py are also gating-marked. Additional gating-marked direct callers of the refactored create_dv/construct_datavolume_source_dict: test_golden_image.py, test_online_resize.py, test_import_http.py, test_vm_cloning.py; test_restricted_namespace_cloning.py reaches create_dv transitively via create_dv_negative() in tests/storage/restricted_namespace_cloning/utils.py.

Affected tests to run

  • tests/storage/cdi_clone/test_clone.py (smoke, gating)
  • tests/storage/cdi_upload/test_upload_virtctl.py (smoke, gating)
  • tests/storage/golden_image/test_golden_image.py::test_regular_user_cant_clone_dv_in_ns (gating)
  • tests/storage/online_resize/test_online_resize.py (gating)
  • tests/storage/restricted_namespace_cloning/test_restricted_namespace_cloning.py (gating)
  • tests/storage/cdi_import/test_import_http.py (gating)
  • tests/virt/cluster/vm_cloning/test_vm_cloning.py (gating)
  • Broader create_dv/construct_datavolume_source_dict callers worth spot-checking (non-smoke/gating but directly touched by param renames): tests/storage/cdi_import/conftest.py, tests/storage/restricted_namespace_cloning/conftest.py, tests/storage/storage_migration/conftest.py, tests/storage/test_cdi_certificate.py, tests/storage/test_cdi_resources.py, tests/data_protection/oadp/conftest.py, tests/utils.py

Real tests (cluster required)

Error path (the fix — renamed PVC clone params):
pytest tests/storage/cdi_clone/test_clone.py::test_successful_clone_of_large_image --storage-class-matrix=<valid-sc>
Expected: create_dv(source_pvc_name=..., source_pvc_namespace=...) resolves correctly to a functioning clone (no TypeError/wrong PVC reference from the rename).

Happy path (regression — HTTP source_dict + artifactory lifecycle):
pytest tests/storage/cdi_import/test_import_http.py::test_successful_import_basic_auth
Expected: DV import succeeds via source_dict built by construct_datavolume_source_dict, and artifactory secret/configmap are created and cleaned up in finally.

@openshift-virtualization-qe-bot-3

Copy link
Copy Markdown
Contributor

/retest all

Auto-triggered: Files in this PR were modified by merged PR #4959.

Overlapping files

tests/virt/upgrade_custom/vgpu/conftest.py

@jpeimer

jpeimer commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

/build-and-push-container

@openshift-virtualization-qe-bot

Copy link
Copy Markdown

New container for quay.io/openshift-cnv/openshift-virtualization-tests:pr-5443 published

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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/virt/upgrade_custom/vgpu/conftest.py`:
- Around line 162-169: The fixture name
`non_existent_mdev_bus_nodes_session_scope` is misleading because it actually
verifies that `mdev_bus` is available via `verify_mdev_bus_available` and yields
vGPU nodes with that check passed. Rename this fixture to something that matches
its behavior, such as `mdev_bus_verified_vgpu_nodes_session_scope` or
`vgpu_nodes_with_mdev_bus_verified`, and update all downstream references/usages
of `non_existent_mdev_bus_nodes_session_scope` to the new name.
🪄 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: e6965cf2-cc74-4e52-89ff-2b36525da096

📥 Commits

Reviewing files that changed from the base of the PR and between 47a0a91 and 5446621.

📒 Files selected for processing (4)
  • tests/storage/cdi_clone/test_clone.py
  • tests/virt/upgrade_custom/vgpu/conftest.py
  • utilities/storage.py
  • utilities/unittests/test_storage.py

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

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/virt/upgrade_custom/vgpu/conftest.py`:
- Around line 162-169: The fixture name
`non_existent_mdev_bus_nodes_session_scope` is misleading because it actually
verifies that `mdev_bus` is available via `verify_mdev_bus_available` and yields
vGPU nodes with that check passed. Rename this fixture to something that matches
its behavior, such as `mdev_bus_verified_vgpu_nodes_session_scope` or
`vgpu_nodes_with_mdev_bus_verified`, and update all downstream references/usages
of `non_existent_mdev_bus_nodes_session_scope` to the new name.
🪄 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: e6965cf2-cc74-4e52-89ff-2b36525da096

📥 Commits

Reviewing files that changed from the base of the PR and between 47a0a91 and 5446621.

📒 Files selected for processing (4)
  • tests/storage/cdi_clone/test_clone.py
  • tests/virt/upgrade_custom/vgpu/conftest.py
  • utilities/storage.py
  • utilities/unittests/test_storage.py
📜 Review details
🔇 Additional comments (6)
utilities/storage.py (1)

143-143: LGTM!

utilities/unittests/test_storage.py (1)

126-133: LGTM!

tests/virt/upgrade_custom/vgpu/conftest.py (2)

3-25: LGTM!


94-159: LGTM!

tests/storage/cdi_clone/test_clone.py (2)

219-229: LGTM!


203-203: 🗄️ Data Integrity & Integration

The Windows DV rename is safe; no stale dv-source-win references remain.

			> Likely an incorrect or invalid review comment.
🛑 Comments failed to post (1)
tests/virt/upgrade_custom/vgpu/conftest.py (1)

162-169: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Confusing fixture name — inverts actual behavior.

non_existent_mdev_bus_nodes_session_scope calls verify_mdev_bus_available, which fails when mdev_bus is missing on a node — i.e., it asserts mdev_bus does exist. The fixture name implies the opposite ("non-existent mdev bus"), which will mislead anyone reading the fixture dependency chain in other conftests/tests.

Consider a name that reflects what the fixture actually provides, e.g. vgpu_nodes_with_mdev_bus_verified or mdev_bus_verified_vgpu_nodes_session_scope.

♻️ Suggested rename
-@pytest.fixture(scope="session")
-def non_existent_mdev_bus_nodes_session_scope(workers_utility_pods, vgpu_ready_nodes_session_scope):
+@pytest.fixture(scope="session")
+def mdev_bus_verified_vgpu_nodes_session_scope(workers_utility_pods, vgpu_ready_nodes_session_scope):
     """Verify mdev_bus is available on all vGPU nodes."""
     verify_mdev_bus_available(
         workers_utility_pods=workers_utility_pods,
         vgpu_nodes=vgpu_ready_nodes_session_scope,
     )
     yield vgpu_ready_nodes_session_scope

Note: rename all downstream usages of non_existent_mdev_bus_nodes_session_scope accordingly.

🧰 Tools
🪛 Ruff (0.15.20)

[warning] 169-169: No teardown in fixture non_existent_mdev_bus_nodes_session_scope, use return instead of yield

Replace yield with return

(PT022)

🤖 Prompt for 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.

In `@tests/virt/upgrade_custom/vgpu/conftest.py` around lines 162 - 169, The
fixture name `non_existent_mdev_bus_nodes_session_scope` is misleading because
it actually verifies that `mdev_bus` is available via
`verify_mdev_bus_available` and yields vGPU nodes with that check passed. Rename
this fixture to something that matches its behavior, such as
`mdev_bus_verified_vgpu_nodes_session_scope` or
`vgpu_nodes_with_mdev_bus_verified`, and update all downstream references/usages
of `non_existent_mdev_bus_nodes_session_scope` to the new name.

@openshift-virtualization-qe-bot-3

Copy link
Copy Markdown
Contributor

/retest all

Auto-triggered: Files in this PR were modified by merged PR #5440.

Overlapping files

tests/conftest.py
tests/observability/metrics/utils.py
tests/scale/test_scale_benchmark.py
tests/utils.py

jpeimer and others added 6 commits July 2, 2026 15:02
…ter naming

Extract construct_datavolume_source_dict as a pure function for building
DataVolume source dicts. Refactor create_dv to own artifactory lifecycle
in try/finally, require explicit source parameter, use generic annotations
dict instead of multus_annotation/bind_immediate, rename parameters for
consistency (secret_name, cert_configmap_name, source_pvc_name,
source_pvc_namespace), add full type hints, and remove unused hostpath_node.
Update all 21 caller files to match the new interface.

Assisted-by: Claude <noreply@anthropic.com>
Signed-off-by: Jenia Peimer <jpeimer@redhat.com>
…ce_dict()

Migrate all DataVolume instantiations from the legacy source=/url=/secret=/cert_configmap=
parameters to the new source_dict= parameter using construct_datavolume_source_dict()
for consistent source specification across the codebase.

Assisted-by: Claude <noreply@anthropic.com>
Signed-off-by: Jenia Peimer <jpeimer@redhat.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Jenia Peimer <jpeimer@redhat.com>
…espace from source dict, add unit tests

- Add source_pvc_namespace= to all 9 PVC clone call sites that relied
  on the old wrapper fallback (self.source_namespace or self.namespace)
- Omit namespace key from PVC source dict when source_pvc_namespace is
  None to avoid serializing {"namespace": None}
- Add 14 unit tests for construct_datavolume_source_dict covering all 5
  source types, secret/cert enrichment, and unsupported source error
- Mock utilities.virt in unittests conftest.py to break circular import

Assisted-by: Claude <noreply@anthropic.com>
Signed-off-by: Jenia Peimer <jpeimer@redhat.com>
Assisted-by: Claude <noreply@anthropic.com>
Signed-off-by: Jenia Peimer <jpeimer@redhat.com>
After create_dv refactoring, url is no longer passed to the DataVolume
constructor (only embedded in source_dict). Check dv.name instead and
use OS_FLAVOR_WINDOWS constant for the parametrized dv_name.

Assisted-by: Claude <noreply@anthropic.com>
Signed-off-by: Jenia Peimer <jpeimer@redhat.com>
@jpeimer

jpeimer commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

/retest all

@jpeimer

jpeimer commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

/retest tox

@jpeimer

jpeimer commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

/build-and-push-container

@openshift-virtualization-qe-bot

Copy link
Copy Markdown

New container for quay.io/openshift-cnv/openshift-virtualization-tests:pr-5443 published

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.

8 participants