Add exclude filter to verify_boot_sources_reimported#4983
Conversation
|
Caution Review failedAn error occurred during the review process. Please try again later. ✨ 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4983 +/- ##
==========================================
- Coverage 98.67% 98.66% -0.01%
==========================================
Files 25 42 +17
Lines 2487 2469 -18
==========================================
- Hits 2454 2436 -18
Misses 33 33
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
/build-and-push-container |
|
/build-and-push-container |
|
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
utilities/storage.py (1)
1-1:⚠️ Potential issue | 🟠 Major | ⚡ Quick winHIGH: PR template required sections are missing/incomplete in the provided PR description.
Please restore the required template headings and provide meaningful content under
##### What this PR does / why we need it:before merge.As per coding guidelines, required PR sections must be present, and
What this PR does / why we need it:must contain meaningful content.🤖 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 `@utilities/storage.py` at line 1, The PR description is missing required template headings and the section "##### What this PR does / why we need it:" is empty; update the PR description to restore all required template headings and populate "##### What this PR does / why we need it:" with a concise summary of the change, its purpose, and any high-level impact (e.g., files/classes affected, behavior changes), ensuring other template sections (e.g., testing steps, related tickets) are present and meaningful before merging.
🤖 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 `@utilities/storage.py`:
- Line 1124: The public type for data_source_names in
verify_boot_sources_reimported is too narrow (list[str] | None) while callers
pass a set[str]; change the parameter annotation to accept any collection (e.g.,
Collection[str] | None or Iterable[str] | None) and update the docstring to
reflect it, then update the other affected signatures/usages mentioned (around
the other occurrences) to the same broader type; ensure the function still uses
only membership checks so no logic changes are needed and adjust any related
type imports (typing.Collection or Iterable) accordingly.
---
Outside diff comments:
In `@utilities/storage.py`:
- Line 1: The PR description is missing required template headings and the
section "##### What this PR does / why we need it:" is empty; update the PR
description to restore all required template headings and populate "##### What
this PR does / why we need it:" with a concise summary of the change, its
purpose, and any high-level impact (e.g., files/classes affected, behavior
changes), ensuring other template sections (e.g., testing steps, related
tickets) are present and meaningful before merging.
🪄 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: 68fb094f-6b49-41df-b4d4-504f654a96fa
📒 Files selected for processing (3)
utilities/hco.pyutilities/storage.pyutilities/unittests/test_hco.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (3)
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
**/*.py: Never add linter suppressions like# noqa,# type: ignore, or# pylint: disable. Fix the code instead. If you believe a rule is wrong, ask the user for explicit approval.
Search the codebase for existing implementations before writing new code. Checkutilities/,libs/,tests/, andpyproject.tomldependencies. Never duplicate logic—extract to shared modules. Usepyhelper_utils.shell.run_commandfor shell commands instead ofsubprocess.run, and useocp-resourcesclasses instead of raw YAML dicts.
Type hints are MANDATORY. Use mypy strict mode inlibs/and all new public functions under utilities. UseTYPE_CHECKINGfor type-only imports to avoid runtime overhead and circular imports.
Write Google-format docstrings for all public functions with non-obvious return values or side effects.
Always useuv runto execute commands. Never executepython,pip,pytest,tox, orpre-commitdirectly. Useuv run python,uv run pytest,uv run tox,uv run pre-commit, anduv addfor package installation.
Always use absolute imports. Never use relative imports.
Prefer specific imports usingfrom module import funcfor functions and constants. Usefrom package import module(thenmodule.Name) when retaining the module name meaningfully improves readability. Never use bareimport modulewithout afromclause.
Always use named arguments for function calls with more than one argument.
Never use single-letter variable names. Always use descriptive, meaningful names.
No dead code. Every function, variable, and fixture must be used or removed. Code marked with# skip-unused-codeis excluded from dead code analysis (enforced via custom ruff plugin).
Prefer direct attribute access usingfoo.attr. Save to variables only when reusing the same attribute multiple times improves readability or extracting clarifies intent.
Imports must always be at the top of the module. Do not import inside functions.
No defensive programming. Fail...
Files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
**
⚙️ CodeRabbit configuration file
**: ## PR Template Validation
Check the PR description for required sections from.github/pull_request_template.md.
Required sections (must be present, even if empty):
##### What this PR does / why we need it:— MUST be present AND have meaningful content.
Flag as HIGH if the section is missing, empty, whitespace-only, contains only HTML comments,
or contains only placeholder tokens such asTBD,TBA,N/A,-,—,none, or..##### Which issue(s) this PR fixes:— must be present (may be empty)##### Special notes for reviewer:— must be present (may be empty)##### jira-ticket:— must be present (may be empty)
If any required section is absent, orWhat this PR does / why we need it:has no content,
flag it as HIGH severity and ask the author to restore the missing template section(s).
Files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
utilities/storage.py
📄 CodeRabbit inference engine (AGENTS.md)
Place storage operations (PVC, DataVolume, StorageClass) in
utilities/storage.py.
Files:
utilities/storage.py
🧠 Learnings (31)
📚 Learning: 2026-01-12T11:24:13.825Z
Learnt from: servolkov
Repo: RedHatQE/openshift-virtualization-tests PR: 3387
File: tests/network/provider_migration/libprovider.py:50-52
Timestamp: 2026-01-12T11:24:13.825Z
Learning: In the RedHatQE/openshift-virtualization-tests repository, when catching exceptions in Python, use LOGGER.error before re-raising and do not replace it with LOGGER.exception in except blocks. This follows the established pattern across the codebase.
Applied to files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
📚 Learning: 2026-01-12T14:25:05.723Z
Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 3366
File: tests/storage/cdi_clone/test_clone.py:5-9
Timestamp: 2026-01-12T14:25:05.723Z
Learning: In Python tests and utility code across the repository, bitmath.parse_string_unsafe correctly parses Kubernetes quantities (e.g., '4Gi', '512Mi', PVC storage requests) without supplying system=bitmath.NIST. There are 30+ usages indicating this is the standard behavior. Reviewers should verify that code that builds or compares quantity strings does not pass the NIST parameter, and if a new test relies on quantity parsing, assume no NIST parameter is required unless explicitly documented.
Applied to files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
📚 Learning: 2026-01-20T01:03:13.139Z
Learnt from: servolkov
Repo: RedHatQE/openshift-virtualization-tests PR: 3387
File: tests/network/provider_migration/libprovider.py:1-8
Timestamp: 2026-01-20T01:03:13.139Z
Learning: In the openshift-virtualization-tests repository, Python imports should consistently use module-level imports for the logging module (i.e., import logging) rather than from logging import ... The established pattern spans 270+ files and should not be flagged for refactoring. Apply this guideline to Python files across the repo (e.g., tests/network/provider_migration/libprovider.py).
Applied to files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
📚 Learning: 2026-01-21T21:26:41.805Z
Learnt from: geetikakay
Repo: RedHatQE/openshift-virtualization-tests PR: 3559
File: utilities/infra.py:251-254
Timestamp: 2026-01-21T21:26:41.805Z
Learning: In the RedHatQE/openshift-virtualization-tests repository, when reviewing Python code, recognize that with Python 3.14 the syntax 'except ValueError, TypeError:' is valid if there is no 'as' clause, and should not be flagged as Python 2 syntax. If you use an 'as' binding (e.g., 'except (ValueError, TypeError) as e:'), parentheses are required. Ensure this pattern is version-consistent and not flagged as Python 2 syntax when 'as' is absent.
Applied to files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
📚 Learning: 2026-01-25T13:18:21.675Z
Learnt from: jpeimer
Repo: RedHatQE/openshift-virtualization-tests PR: 3571
File: tests/storage/storage_migration/utils.py:158-167
Timestamp: 2026-01-25T13:18:21.675Z
Learning: In reviews of the openshift-virtualization-tests repo (and similar Python code), avoid suggesting minor stylistic changes that require extra verification (e.g., removing dict.keys() checks for membership) unless the change has clear correctness or maintainability impact. Focus on fixes with observable behavior, security, performance, or maintainability benefits; defer low-impact style tweaks that are costly to verify.
Applied to files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
📚 Learning: 2026-02-18T06:35:39.536Z
Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 3847
File: utilities/virt.py:2449-2453
Timestamp: 2026-02-18T06:35:39.536Z
Learning: In Python code, a function named clearly and self-descriptively can be deemed not to require a docstring. However, treat this as a context-specific guideline and not a universal rule. For public APIs or functions with side effects, prefer concise docstrings explaining behavior, inputs, outputs, and side effects. This guidance is based on the example in utilities/virt.py from RedHatQE/openshift-virtualization-tests where validate_libvirt_persistent_domain(vm, admin_client) was considered self-documenting.
Applied to files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
📚 Learning: 2026-02-23T16:33:22.070Z
Learnt from: vsibirsk
Repo: RedHatQE/openshift-virtualization-tests PR: 3883
File: utilities/pytest_utils.py:441-463
Timestamp: 2026-02-23T16:33:22.070Z
Learning: In Python code reviews, the guideline to always use named arguments for multi-argument calls does not apply to built-ins or methods that have positional-only parameters (those defined with a / in their signature). Do not flag or require named arguments for calls like dict.get(key, default=None, /), list.pop(), str.split(sep, maxsplit) and similar built-ins that cannot accept keyword arguments. Apply the named-argument rule only to functions/methods that explicitly accept keyword arguments.
Applied to files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
📚 Learning: 2026-03-17T01:32:02.617Z
Learnt from: dshchedr
Repo: RedHatQE/openshift-virtualization-tests PR: 4118
File: utilities/database.py:0-0
Timestamp: 2026-03-17T01:32:02.617Z
Learning: In RedHatQE/openshift-virtualization-tests, when reviewing Python files, post targeted inline comments on the Files changed tab at the exact location (file and line) of the issue rather than opening a single discussion thread for multiple issues. This should be done for each applicable location to improve traceability and clarity. If multiple issues exist in the same file, address them with separate inline comments pointing to the specific lines.
Applied to files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
📚 Learning: 2026-03-17T01:32:02.617Z
Learnt from: dshchedr
Repo: RedHatQE/openshift-virtualization-tests PR: 4118
File: utilities/database.py:0-0
Timestamp: 2026-03-17T01:32:02.617Z
Learning: In the RedHatQE/openshift-virtualization-tests repository, CodeRabbit should post targeted inline comments at each applicable location in the Files Changed tab, rather than aggregating multiple issues into a single PR discussion thread reply. This guideline applies to all Python files (any file ending in .py) changed in a PR; for non-Python files, follow the same inline-comment-at-location principle if relevant.
Applied to files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
📚 Learning: 2026-05-04T13:45:29.122Z
Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 4725
File: utilities/console.py:54-59
Timestamp: 2026-05-04T13:45:29.122Z
Learning: During review of RedHatQE/openshift-virtualization-tests “lint-cleanup” PRs (e.g., changes targeting lint issues like stale noqa/utf-8 headers), do not flag existing `# type: ignore` directives that were already present before the PR and were not introduced or modified by the PR. Only raise findings for `# type: ignore` suppressions that the PR itself adds, changes, or otherwise makes newly effective (i.e., they appear in the diff as additions/edits).
Applied to files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
📚 Learning: 2026-05-04T13:45:33.892Z
Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 4725
File: tests/virt/cluster/common_templates/centos/test_centos_os_support.py:78-83
Timestamp: 2026-05-04T13:45:33.892Z
Learning: When reviewing lint-cleanup or formatting-only pull requests in this repo (e.g., changes like removing/updating `# noqa` comments or UTF-8 headers), do not raise findings for code patterns that already existed before the PR. Specifically, if a problematic construct such as `.is_connective(tcp_timeout=120)` was present in the base branch, suppress that finding and only raise issues when the PR itself introduces or modifies that construct (i.e., the diff adds/changes the call or its arguments). Apply this rule across all Python files (`**/*.py`).
Applied to files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
📚 Learning: 2026-05-05T17:01:15.294Z
Learnt from: dshchedr
Repo: RedHatQE/openshift-virtualization-tests PR: 4739
File: tests/virt/node/descheduler/conftest.py:2-2
Timestamp: 2026-05-05T17:01:15.294Z
Learning: In this repo’s Python code, it’s acceptable (and preferred by convention) to build `run_command` inputs using `shlex.split(f"<command> {arg}")` rather than converting to direct list literals like `['oc', 'adm', 'uncordon', name]`. During code review, generally don’t flag `shlex.split(...)` usage for `run_command` calls and don’t suggest replacing it with list literals; the string-form pattern is used to keep commands readable and consistent with how they’re typed in a terminal.
Applied to files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
📚 Learning: 2026-05-08T12:49:20.694Z
Learnt from: geetikakay
Repo: RedHatQE/openshift-virtualization-tests PR: 4788
File: utilities/os_utils.py:257-262
Timestamp: 2026-05-08T12:49:20.694Z
Learning: In RedHatQE/openshift-virtualization-tests, the Ruff flake8-boolean-trap rules FBT001/FBT002 are intentionally not enabled (pyproject.toml does not select the FBT rules; confirmed via `ruff check --show-settings`). Therefore, do not flag boolean positional parameters as FBT001/FBT002 violations in this repository. If Ruff configuration changes and starts selecting FBT rules, this exception should be reconsidered.
Applied to files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
📚 Learning: 2026-05-12T05:10:24.601Z
Learnt from: acinko-rh
Repo: RedHatQE/openshift-virtualization-tests PR: 4780
File: tests/storage/utils.py:568-572
Timestamp: 2026-05-12T05:10:24.601Z
Learning: In this repository, Ruff rule UP043 ("unnecessary default type arguments") is enforced. When annotating `collections.abc.Generator` return types, prefer the single-parameter form `Generator[YieldType]` rather than `Generator[YieldType, None, None]`. Explicit `None, None` for the SendType and ReturnType are unnecessary defaults (per PEP 696) and will trigger UP043. Apply this consistently across all Python files.
Applied to files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
📚 Learning: 2026-05-13T19:23:09.603Z
Learnt from: Anatw
Repo: RedHatQE/openshift-virtualization-tests PR: 4833
File: tests/network/localnet/migration_stuntime/libstuntime.py:25-25
Timestamp: 2026-05-13T19:23:09.603Z
Learning: In this repository, do not recommend adding `from __future__ import annotations` to fix forward-reference type annotation issues (e.g., Ruff UP037). Follow the established convention: use quoted string type annotations for forward references when the referenced class/type is defined later in the same file (e.g., `"ContinuousPing"`), and prefer `typing.Self` for self-referential return types.
Applied to files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
📚 Learning: 2026-05-18T06:30:56.781Z
Learnt from: EdDev
Repo: RedHatQE/openshift-virtualization-tests PR: 4819
File: utilities/unittests/test_bitwarden.py:207-207
Timestamp: 2026-05-18T06:30:56.781Z
Learning: During Ruff/lint rule-enablement PRs in this repository (e.g., when introducing a new rule like PLC0415), it’s acceptable to keep CI green by adding per-line, targeted suppressions for pre-existing violations: add only `# noqa: <single-ruff-rule-id>` at the end of the specific violating line. In this PR context, reviewers should NOT flag these targeted `# noqa: PLC0415` comments as policy violations, assuming the suppression is for a pre-existing issue and is documented in the PR description as a candidate for follow-up cleanup. Do not allow blanket `# noqa` (without a specific rule) or `per-file-ignores`; those remain disallowed.
Applied to files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
📚 Learning: 2026-05-18T06:31:12.015Z
Learnt from: EdDev
Repo: RedHatQE/openshift-virtualization-tests PR: 4819
File: utilities/unittests/test_pytest_utils.py:270-270
Timestamp: 2026-05-18T06:31:12.015Z
Learning: In RedHatQE/openshift-virtualization-tests, if a PR is a Ruff rule-enforcement PR and its “Special notes for reviewer” documents that pre-existing Ruff violations are being temporarily handled via per-line suppressions (e.g., `# noqa: PLC0415`) to keep CI green, reviewers should treat those specific `# noqa: <rule>` comments as an agreed, temporary mechanism. Do not flag them as code-quality issues and do not recommend removing, consolidating, or refactoring those suppressions within the same PR; cleanup/remediation is expected to happen in dedicated follow-up PRs instead.
Applied to files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
📚 Learning: 2026-05-18T06:31:15.083Z
Learnt from: EdDev
Repo: RedHatQE/openshift-virtualization-tests PR: 4819
File: utilities/unittests/test_data_collector.py:304-304
Timestamp: 2026-05-18T06:31:15.083Z
Learning: When reviewing Python code in this repository for Ruff/linter rule rollouts, do not treat temporary suppression comments as violations in the specific migration scenario where a PR enables a new Ruff rule (e.g., PLC0415) and the PR description explicitly documents that all *pre-existing* violations are being annotated with `# noqa: <RULE>` as a short-lived measure. In that case, only flag `# noqa: <RULE>` suppressions that are newly introduced on code that did not previously violate the rule—i.e., verify via the PR diff against the prior state (and/or prior Ruff findings) that the suppressed line was already violating before the rule was enabled. Ignore suppressions that are covering violations that existed before the new rule rollout and were intentionally bulk-added for cleanup in follow-up PRs.
Applied to files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
📚 Learning: 2026-05-18T06:31:20.848Z
Learnt from: EdDev
Repo: RedHatQE/openshift-virtualization-tests PR: 4819
File: utilities/unittests/test_hco.py:501-501
Timestamp: 2026-05-18T06:31:20.848Z
Learning: When reviewing Python code in RedHatQE/openshift-virtualization-tests, avoid flagging Ruff `# noqa: <RULE>` suppressions as issues if they were intentionally added as a temporary measure to keep CI green after a PR enables a new Ruff/lint rule (e.g., PLC0415) and the PR description documents this under "Special notes for reviewer". Treat these suppressions as deferred technical debt. Only flag `# noqa: PLC0415` (and similar rule-specific suppressions) when they are newly introduced without an accompanying documented intent in the PR (and thus appear to be masking a new violation rather than a pre-existing one).
Applied to files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
📚 Learning: 2026-05-18T09:09:09.479Z
Learnt from: EdDev
Repo: RedHatQE/openshift-virtualization-tests PR: 4878
File: utilities/unittests/test_pytest_utils.py:2194-2197
Timestamp: 2026-05-18T09:09:09.479Z
Learning: In this repository (RedHatQE/openshift-virtualization-tests), do not flag missing return type annotations or missing argument type annotations as Ruff “ANN” rule violations (e.g., ANN001/ANN002/ANN201/ANN202). The repo’s Ruff configuration does not enable ANN rules and only uses `extend-select = ["PLC0415"]`, so missing type annotations should not be treated as ANN lint failures during code review.
Applied to files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
📚 Learning: 2026-05-19T07:48:17.119Z
Learnt from: azhivovk
Repo: RedHatQE/openshift-virtualization-tests PR: 4784
File: libs/vm/affinity.py:104-104
Timestamp: 2026-05-19T07:48:17.119Z
Learning: When using Kubernetes API models like `NodeSelectorRequirement` or `LabelSelectorRequirement` with operators `Exists` or `DoesNotExist`, the `values` field must not be non-empty. It is valid for `values` to be omitted / left as `None` (Python) / passed as `null`—Kubernetes rejects non-empty `values` for these operators, but does not require the field to be present or explicitly set to an empty list. In code reviews, do not treat missing `values=[]` for `Exists`/`DoesNotExist` as a validation issue; only flag cases where `values` is provided with actual elements.
Applied to files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
📚 Learning: 2026-05-19T07:48:17.119Z
Learnt from: azhivovk
Repo: RedHatQE/openshift-virtualization-tests PR: 4784
File: libs/vm/affinity.py:104-104
Timestamp: 2026-05-19T07:48:17.119Z
Learning: When constructing Kubernetes `NodeSelectorRequirement` (or `LabelSelectorRequirement`) objects in code, do not treat `values` being omitted, `None`, or an empty list as an API-validation problem when the requirement’s operator is `Exists` or `DoesNotExist`. Per the Kubernetes API spec, these operators only require that the `values` array is not non-empty (i.e., it must be empty); they do not require the field to be explicitly present as `[]`. Therefore, reviewers should not flag `values=None`/missing `values` for `Exists`/`DoesNotExist`.
Applied to files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
📚 Learning: 2026-02-18T06:34:38.042Z
Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 3847
File: tests/virt/cluster/common_templates/utils.py:58-58
Timestamp: 2026-02-18T06:34:38.042Z
Learning: In RedHatQE/openshift-virtualization-tests, treat 'public' functions as those defined in any Python files under libs/ or utilities/ (any depth). Functions inside nested test directories (e.g., tests/virt/cluster/common_templates/, tests/virt/node/, etc.) are test helpers and do not require Google-format docstrings unless explicitly requested. Use this rule during reviews to decide whether to enforce docstrings on public API functions in libs/utilities.
Applied to files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
📚 Learning: 2026-05-03T15:38:09.624Z
Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 4701
File: tests/virt/node/general/test_windows_vtpm_bitlocker.py:50-52
Timestamp: 2026-05-03T15:38:09.624Z
Learning: During review of PRs that are lint cleanups or tooling/version bumps, do not flag code-quality issues for patterns that pre-existed before the PR. Specifically, if the diff does not introduce/modify constructs such as nested `if` blocks or unnecessary list comprehensions, treat them as known/deferred and leave them for dedicated follow-up cleanup PRs. Only raise issues when the PR itself adds, changes, or refactors the problematic code.
Applied to files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
📚 Learning: 2026-05-15T18:42:02.504Z
Learnt from: geetikakay
Repo: RedHatQE/openshift-virtualization-tests PR: 4860
File: utilities/hco.py:385-389
Timestamp: 2026-05-15T18:42:02.504Z
Learning: In this repository, under the Python `utilities/` directory (utility/helper modules, not tests), do not flag bare `assert` statements as correctness or style issues. The codebase conventionally uses `assert` in these utilities (e.g., `utilities/virt.py`, `utilities/infra.py`, etc.) and does not enforce running Python with `-O`/`PYTHONOPTIMIZE`, so the usual “asserts may be stripped” concern should not be treated as a review blocker here.
Applied to files:
utilities/hco.pyutilities/unittests/test_hco.pyutilities/storage.py
📚 Learning: 2026-01-07T11:51:57.253Z
Learnt from: qwang1
Repo: RedHatQE/openshift-virtualization-tests PR: 3301
File: utilities/unittests/test_oadp.py:5-5
Timestamp: 2026-01-07T11:51:57.253Z
Learning: In utilities/unittests/test_oadp.py and similar test files in this repo, include a # flake8: noqa: E402 directive to suppress E402 warnings caused by pre-commit checks. This is needed because mock setup must precede imports to avoid circular dependencies, and Ruff may report unused imports. Apply this directive to all similar test files that require imports to guard against circular import issues.
Applied to files:
utilities/unittests/test_hco.py
📚 Learning: 2026-01-19T07:53:55.780Z
Learnt from: qwang1
Repo: RedHatQE/openshift-virtualization-tests PR: 3301
File: utilities/unittests/test_oadp.py:48-57
Timestamp: 2026-01-19T07:53:55.780Z
Learning: Enforce that pytest markers (e.g., marker requirement for integration tests) apply only to integration/functional tests under the tests/ directory. Unit tests located in utilities/unittests/ must not use pytest markers, following repository convention. For all unit test files under utilities/unittests (and subdirectories), do not require or mandate markers; for integration tests under tests/ and its subdirectories, ensure markers are used as per the project rule.
Applied to files:
utilities/unittests/test_hco.py
📚 Learning: 2026-02-23T21:16:51.920Z
Learnt from: vsibirsk
Repo: RedHatQE/openshift-virtualization-tests PR: 3883
File: utilities/unittests/test_os_utils.py:358-371
Timestamp: 2026-02-23T21:16:51.920Z
Learning: In the openshift-virtualization-tests repository, the guideline to require named arguments for function calls with more than one argument does not apply to unit tests under utilities/unittests/. For these tests, allow standard pytest patterns like pytest.raises(ExceptionType, match="pattern") without requiring named parameters. This exception applies specifically to files under utilities/unittests/ and does not generalize beyond that directory.
Applied to files:
utilities/unittests/test_hco.py
📚 Learning: 2026-05-03T15:38:22.954Z
Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 4701
File: utilities/unittests/test_database.py:12-12
Timestamp: 2026-05-03T15:38:22.954Z
Learning: In RedHatQE/openshift-virtualization-tests unit tests under `utilities/unittests/`, it’s intentional/pre-existing to use `sys.path.insert(0, ...)` in cases where tests need to import local modules. In lint-cleanup PRs, reviewers should not flag this `sys.path` manipulation as a violation. Also, don’t re-add `# noqa: E402` or other import-order suppressions if `ruff/flake8` no longer reports E402 for that import—handle any broader refactor (to remove the `sys.path` hack) in a dedicated follow-up.
Applied to files:
utilities/unittests/test_hco.py
📚 Learning: 2026-05-18T06:31:30.830Z
Learnt from: EdDev
Repo: RedHatQE/openshift-virtualization-tests PR: 4819
File: utilities/unittests/test_sanity.py:22-22
Timestamp: 2026-05-18T06:31:30.830Z
Learning: In this repo’s unit test files under `utilities/unittests/`, treat `# noqa: PLC0415` (import-outside-top-level) suppressions as intentional and do not flag them as violations when enabling Ruff’s PLC0415 rule incrementally. These suppressions are expected as temporary measures and are documented in the PR description; they should only be targeted for later cleanup follow-ups.
Also, allow imports placed inside unit test methods under `utilities/unittests/` when they are intentionally positioned to run after `patch` decorators are applied—especially when the imported module has import-time side effects.
Applied to files:
utilities/unittests/test_hco.py
📚 Learning: 2026-05-18T10:38:33.820Z
Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 4884
File: .coderabbit.yaml:79-80
Timestamp: 2026-05-18T10:38:33.820Z
Learning: In this repo, pytest tests are expected to live only in files named `test_*.py`. When applying CodeRabbit STP case B (newly added `def test_*` inside an existing test file), scope the check to existing files that match `test_*.py` and do not broaden it to newly added `def test_*` found in other non-`test_*.py` Python files.
Applied to files:
utilities/unittests/test_hco.py
🧬 Code graph analysis (1)
utilities/unittests/test_hco.py (1)
tests/conftest.py (2)
admin_client(310-314)namespace(680-693)
🪛 Ruff (0.15.13)
utilities/storage.py
[warning] 1145-1145: Logging statement uses f-string
(G004)
🔇 Additional comments (2)
utilities/hco.py (1)
389-390: LGTM!utilities/unittests/test_hco.py (1)
769-773: LGTM!Also applies to: 804-807, 839-839
|
New container for quay.io/openshift-cnv/openshift-virtualization-tests:pr-4983 published |
1 similar comment
|
New container for quay.io/openshift-cnv/openshift-virtualization-tests:pr-4983 published |
|
/verified |
Test execution plan request detailsCRITICAL: You MUST post an inline review comment on the first changed line of the first file. As an expert software testing engineer, analyze all modified files in this PR and create a targeted test execution plan. Analysis Requirements:
Your deliverable: Test Execution Plan
Guidelines:
Hardware-Related Checks (SR-IOV, GPU, DPDK): When PR modifies fixtures for hardware-specific resources:
CRITICAL WORKFLOW COMPLETION RULES: When responding to this test execution plan request, you MUST follow these rules EXACTLY:
ABSOLUTE PROHIBITIONS (violating these creates empty/meaningless reviews):
Remember: The pull request review is visible to users. Additional comments are redundant noise. CRITICAL: Before setting "Run smoke tests: True", you MUST use shell scripts to: |
|
Tip For best results, initiate chat on the files or code changes. |
|
/approve |
|
/retest all Auto-triggered: Files in this PR were modified by merged PR #5316. Overlapping filestests/install_upgrade_operators/hco_enablement_golden_image_updates/conftest.py |
Allow callers to limit DataSource verification to a specific set, skipping custom DataSources without imagestreams. Ref: RedHatQE#4968 Signed-off-by: Ramón Lobillo <rlobillo@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Ramón Lobillo <rlobillo@redhat.com>
The caller passes a set, so the type hint should accept any collection that supports membership checks. Signed-off-by: Ramón Lobillo <rlobillo@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Ramón Lobillo <rlobillo@redhat.com>
…ylist Addresses review feedback: the allowlist approach using data_import_cron_matrix does not cover multiarch DataSource names (e.g. fedora-aarch64) and silently skips valid custom templates. The denylist keeps "verify all" as the default and lets callers exclude specific DataSources when needed. Propagates exclude_data_source_names through disable_common_boot_image_import_hco_spec so test_add_custom_data_import_cron_template_disable_spec can exclude the custom DataSource during teardown verification. Signed-off-by: Ramón Lobillo <rlobillo@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The teardown AssertionError in verify_boot_sources_reimported (CNV-88015) is fixed by the exclude_data_source_names denylist propagated through disable_common_boot_image_import_hco_spec. Signed-off-by: Ramón Lobillo <rlobillo@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
for more information, see https://pre-commit.ci
Move disabled_boot_image_import_excluding_custom_datasource to @pytest.mark.usefixtures since its return value is not used by the test. Add unit tests verifying exclude_data_source_names propagation with non-default values through both disable_common_boot_image_import_hco_spec and enable_common_boot_image_import_spec_wait_for_data_import_cron. Signed-off-by: Ramón Lobillo <rlobillo@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Ramón Lobillo <rlobillo@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Ramón Lobillo <rlobillo@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Verification failed for PR #4983. Execution details |
|
/retest |
|
/build-and-push-container |
|
Verification failed for PR #4983. Execution details |
|
/build-and-push-container |
|
/retest tox |
|
New container for quay.io/openshift-cnv/openshift-virtualization-tests:pr-4983 published |
|
Verification failed for PR #4983. Execution details |
|
/build-and-push-container |
|
New container for quay.io/openshift-cnv/openshift-virtualization-tests:pr-4983 published |
|
/verified All tests passed for PR #4983. Execution details |
Test execution plan request detailsCRITICAL: You MUST post an inline review comment on the first changed line of the first file. As an expert software testing engineer, analyze all modified files in this PR and create a targeted test execution plan. Analysis Requirements:
Output rules: Your deliverable: Test Execution Plan
Use these formats:
Real test commands (MANDATORY when changes affect session/runtime code): When the affected code runs at session/collection time (conftest fixtures, pytest plugins,
Example output for a session-startup fix: Guidelines:
Hardware-Related Checks (SR-IOV, GPU, DPDK): When PR modifies fixtures for hardware-specific resources:
CRITICAL WORKFLOW COMPLETION RULES: When responding to this test execution plan request, you MUST follow these rules EXACTLY:
ABSOLUTE PROHIBITIONS (violating these creates empty/meaningless reviews):
Remember: The pull request review is visible to users. Additional comments are redundant noise. CRITICAL — Verification rules for smoke and gating decisions: |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
REPO="RedHatQE/openshift-virtualization-tests"
PR_NUMBER=4983
echo "=== CURRENT HEAD SHA ==="
gh pr view "$PR_NUMBER" --repo "$REPO" --json headRefOid --jq '.headRefOid'
echo
echo "=== CHANGED FILES (order from PR API) ==="
gh api "repos/${REPO}/pulls/${PR_NUMBER}/files?per_page=100" --jq '.[].filename'
echo
echo "=== FIRST CHANGED FILE + PATCH HEADER ==="
gh api "repos/${REPO}/pulls/${PR_NUMBER}/files?per_page=100" --jq '.[0] | {filename, patch: (.patch | split("\n") | .[0:20] | join("\n"))}'
echo
echo "=== DIFF: MODIFIED FUNCTION DEFINITIONS IN utilities/hco.py and utilities/storage.py ==="
git diff --unified=0 "origin/main...HEAD" -- utilities/hco.py utilities/storage.py | grep -nE '^[+-]def ' || true
echo
echo "=== PATCHES FOR CHANGED FILES ==="
for f in \
utilities/storage.py \
utilities/hco.py \
utilities/unittests/test_hco.py \
tests/install_upgrade_operators/hco_enablement_golden_image_updates/conftest.py \
tests/install_upgrade_operators/hco_enablement_golden_image_updates/test_update_hco_cr.py
do
echo "--- $f ---"
gh api "repos/${REPO}/pulls/${PR_NUMBER}/files?per_page=100" --jq ".[] | select(.filename == \"$f\") | .patch"
echo
done
echo
echo "=== DIRECT CALLERS / IMPORTERS IN tests/ and conftest.py ==="
rg -n --type py -C2 'verify_boot_sources_reimported|enable_common_boot_image_import_spec_wait_for_data_import_cron|disable_common_boot_image_import_hco_spec' tests/ utilities/unittests/ || true
echo
echo "=== FIXTURES / yield from PATHS REACHING CHANGED SYMBOLS ==="
rg -n --type py -C2 'yield from .*disable_common_boot_image_import_hco_spec|yield from .*enable_common_boot_image_import_spec_wait_for_data_import_cron|def .*disabled_.*boot_image_import|def .*enable_common_boot' tests/ || true
echo
echo "=== SAME-FILE CALLERS IN utilities/hco.py ==="
rg -n -C3 'verify_boot_sources_reimported|enable_common_boot_image_import_spec_wait_for_data_import_cron|disable_common_boot_image_import_hco_spec' utilities/hco.py
echo
echo "=== SMOKE-MARKED TEST FILES ==="
rg -n --type py '`@pytest`\.mark\.smoke' tests/ || true
echo
echo "=== GATING-MARKED TEST FILES ==="
rg -n --type py '`@pytest`\.mark\.gating' tests/ || true
echo
echo "=== SMOKE/GATING FILES THAT ALSO REFERENCE MODIFIED SYMBOLS DIRECTLY ==="
python - <<'PY'
from pathlib import Path
import re
symbols = re.compile(r'\b(verify_boot_sources_reimported|enable_common_boot_image_import_spec_wait_for_data_import_cron|disable_common_boot_image_import_hco_spec)\b')
for marker in ("smoke", "gating"):
print(f"-- {marker.upper()} direct symbol matches --")
for path in Path("tests").rglob("*.py"):
try:
text = path.read_text()
except Exception:
continue
if f"`@pytest.mark`.{marker}" in text and symbols.search(text):
print(path)
PY
echo
echo "=== CONFTST PARENTS OF SMOKE FILES THAT REFERENCE MODIFIED SYMBOLS ==="
python - <<'PY'
from pathlib import Path
import re
symbols = re.compile(r'\b(verify_boot_sources_reimported|enable_common_boot_image_import_spec_wait_for_data_import_cron|disable_common_boot_image_import_hco_spec)\b')
smoke_files = []
for path in Path("tests").rglob("*.py"):
try:
text = path.read_text()
except Exception:
continue
if "`@pytest.mark.smoke`" in text:
smoke_files.append(path)
seen = set()
for smoke in sorted(smoke_files):
cur = smoke.parent
while True:
conftest = cur / "conftest.py"
if conftest.exists():
text = conftest.read_text()
if symbols.search(text):
key = (str(smoke), str(conftest))
if key not in seen:
seen.add(key)
print(f"{smoke} <- {conftest}")
if cur == Path(".") or cur.parent == cur:
break
cur = cur.parent
PYLength of output: 43858 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== tests/conftest.py: affected fixture definitions and verify_boot_sources_reimported teardown contexts ==="
sed -n '1838,1895p' tests/conftest.py
echo
sed -n '2368,2480p' tests/conftest.py
echo
echo "=== Search for usages of affected fixture wrappers in tests/ ==="
rg -n --type py -C2 '\bdisabled_common_boot_image_import_hco_spec_scope_function\b|\bdisabled_common_boot_image_import_hco_spec_scope_class\b|\bdisabled_common_boot_image_import_hco_spec_rhel9_scope_function\b' tests/ || true
echo
echo "=== Search for tests using updated fixture disabled_boot_image_import_excluding_custom_datasource ==="
rg -n --type py -C2 '\bdisabled_boot_image_import_excluding_custom_datasource\b' tests/ || true
echo
echo "=== Affected files under tests/infrastructure/golden_images/update_boot_source/ ==="
fd . tests/infrastructure/golden_images/update_boot_source -e py | sort
echo
rg -n --type py -C2 'enable_common_boot_image_import_spec_wait_for_data_import_cron|disabled_common_boot_image_import|usefixtures|fixture' tests/infrastructure/golden_images/update_boot_source || true
echo
echo "=== Determine which smoke/gating files use affected fixtures directly ==="
python - <<'PY'
from pathlib import Path
import re
fixture_names = [
"disabled_common_boot_image_import_hco_spec_scope_function",
"disabled_common_boot_image_import_hco_spec_scope_class",
"disabled_common_boot_image_import_hco_spec_rhel9_scope_function",
"disabled_boot_image_import_excluding_custom_datasource",
]
for marker in ("smoke", "gating"):
print(f"-- {marker.upper()} files using affected fixtures --")
for path in sorted(Path("tests").rglob("*.py")):
try:
text = path.read_text()
except Exception:
continue
if f"`@pytest.mark`.{marker}" not in text:
continue
for name in fixture_names:
if re.search(rf'\b{name}\b', text):
print(f"{path}: {name}")
break
PY
echo
echo "=== Find any autouse fixtures in tests/conftest.py around affected sections ==="
rg -n --type py -C2 'autouse\s*=\s*True|`@pytest`\.fixture\(' tests/conftest.py | sed -n '1838,1905p;2368,2485p' || true
echo
echo "=== Product install test using verify_boot_sources_reimported ==="
sed -n '1,140p' tests/install_upgrade_operators/product_install/test_install_openshift_virtualization.pyLength of output: 58124 🏁 Script executed: #!/bin/bash
set -euo pipefail
REPO="RedHatQE/openshift-virtualization-tests"
PR_NUMBER=4983
echo "=== Search for tests using tests/conftest.py fixtures that call verify_boot_sources_reimported ==="
rg -n --type py -C2 '\bremoved_default_storage_classes\b|\bupdated_default_storage_class_ocs_virt\b|\bupdated_default_storage_class_from_config\b' tests/ || true
echo
echo "=== Search whether any smoke/gating files use those fixtures ==="
python - <<'PY'
from pathlib import Path
import re
fixtures = [
"removed_default_storage_classes",
"updated_default_storage_class_ocs_virt",
"updated_default_storage_class_from_config",
]
for marker in ("smoke", "gating"):
print(f"-- {marker.upper()} files using verify_boot_sources_reimported-related fixtures --")
for path in sorted(Path("tests").rglob("*.py")):
try:
text = path.read_text()
except Exception:
continue
if f"`@pytest.mark`.{marker}" not in text:
continue
for name in fixtures:
if re.search(rf'\b{name}\b', text):
print(f"{path}: {name}")
break
PY
echo
echo "=== Posting inline test execution plan ==="
HEAD_SHA="$(gh pr view "$PR_NUMBER" --repo "$REPO" --json headRefOid --jq '.headRefOid')"
COMMENT_BODY=$'**Test Execution Plan**\n\n- **Run smoke tests: False** — No smoke-marked test was traced to the modified symbols. The smoke files found in `tests/` do not import or request `disabled_common_boot_image_import_hco_spec_scope_function`, `disabled_common_boot_image_import_hco_spec_scope_class`, `disabled_boot_image_import_excluding_custom_datasource`, `enable_common_boot_image_import_spec_wait_for_data_import_cron`, or `verify_boot_sources_reimported` through an autouse fixture. The `tests/conftest.py` fixtures that call the modified helpers are named fixtures, not autouse.\n- **Run gating tests: False** — No gating-marked test was traced to the modified symbols or to fixtures wrapping them. The direct and transitive affected tests found are not marked `gating`.\n\n**Affected tests to run**\n\n- `utilities/unittests/test_hco.py` — unit coverage for `exclude_data_source_names` propagation\n- `tests/install_upgrade_operators/hco_enablement_golden_image_updates/test_update_hco_cr.py::test_add_custom_data_import_cron_template_disable_spec` — uses `disabled_boot_image_import_excluding_custom_datasource`\n- `tests/install_upgrade_operators/product_install/test_install_openshift_virtualization.py::test_default_storage_class_set` — directly calls `verify_boot_sources_reimported`\n- `tests/storage/golden_image/test_cached_snapshots.py::test_automatic_update_for_system_cached_snapshot` — fixture teardown calls `disable_common_boot_image_import_hco_spec`\n- `tests/infrastructure/golden_images/update_boot_source/test_ssp_common_templates_boot_sources.py::test_vm_created_from_template_when_boot_source_opted_out` — requests `disabled_common_boot_image_import_hco_spec_scope_function`\n- `tests/infrastructure/golden_images/update_boot_source/test_ssp_data_import_crons.py` — affected via `disabled_common_boot_image_import_hco_spec_scope_function` and `enabled_common_boot_image_import_feature_gate_scope_function`\n- `tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py` — affected via `disabled_common_boot_image_import_hco_spec_scope_function`, `disabled_common_boot_image_import_hco_spec_scope_class`, and teardown through `enable_common_boot_image_import_spec_wait_for_data_import_cron`\n- `tests/install_upgrade_operators/hco_enablement_golden_image_updates/test_enable_common_boot_image_import.py::test_enable_and_delete_spec_enable_common_boot_image_import_hco_cr` — requests `disabled_common_boot_image_import_hco_spec_scope_function`\n- `tests/install_upgrade_operators/hco_enablement_golden_image_updates/test_non_defaults.py` — class uses `disabled_common_boot_image_import_hco_spec_scope_class`\n\n**Real tests (cluster required)**\n\nError path (the fix — custom DataSource excluded from reimport verification):\n`pytest -s -o log_cli=true tests/install_upgrade_operators/hco_enablement_golden_image_updates/test_update_hco_cr.py::test_add_custom_data_import_cron_template_disable_spec`\nExpected: teardown completes without `AssertionError` from `verify_boot_sources_reimported` for the custom DataSource\n\nHappy path (regression — standard DIC-managed DataSources are still verified after re-enable):\n`pytest -s -o log_cli=true tests/infrastructure/golden_images/update_boot_source/test_ssp_data_import_crons.py tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py`\nExpected: re-enable path waits for standard boot sources to reach `Ready=True`; excluded-name logic does not affect default callers'
gh api \
"repos/${REPO}/pulls/${PR_NUMBER}/comments" \
--method POST \
-f body="$COMMENT_BODY" \
-f commit_id="$HEAD_SHA" \
-f path="tests/install_upgrade_operators/hco_enablement_golden_image_updates/conftest.py" \
-F line=6 \
-f side="RIGHT"Length of output: 9762 🏁 Script executed: #!/bin/bash
set -euo pipefail
REPO="RedHatQE/openshift-virtualization-tests"
PR_NUMBER=4983
COMMENT_BODY=$'**Test Execution Plan**\n\n- **Run smoke tests: False** — No smoke-marked test was traced to the modified symbols. The smoke files found in `tests/` do not import or request `disabled_common_boot_image_import_hco_spec_scope_function`, `disabled_common_boot_image_import_hco_spec_scope_class`, `disabled_boot_image_import_excluding_custom_datasource`, `enable_common_boot_image_import_spec_wait_for_data_import_cron`, or `verify_boot_sources_reimported` through an autouse fixture. The `tests/conftest.py` fixtures that call the modified helpers are named fixtures, not autouse.\n- **Run gating tests: False** — No gating-marked test was traced to the modified symbols or to fixtures wrapping them. The direct and transitive affected tests found are not marked `gating`.\n\n**Affected tests to run**\n\n- `utilities/unittests/test_hco.py` — unit coverage for `exclude_data_source_names` propagation\n- `tests/install_upgrade_operators/hco_enablement_golden_image_updates/test_update_hco_cr.py::test_add_custom_data_import_cron_template_disable_spec` — uses `disabled_boot_image_import_excluding_custom_datasource`\n- `tests/install_upgrade_operators/product_install/test_install_openshift_virtualization.py::test_default_storage_class_set` — directly calls `verify_boot_sources_reimported`\n- `tests/storage/golden_image/test_cached_snapshots.py::test_automatic_update_for_system_cached_snapshot` — fixture teardown calls `disable_common_boot_image_import_hco_spec`\n- `tests/infrastructure/golden_images/update_boot_source/test_ssp_common_templates_boot_sources.py::test_vm_created_from_template_when_boot_source_opted_out` — requests `disabled_common_boot_image_import_hco_spec_scope_function`\n- `tests/infrastructure/golden_images/update_boot_source/test_ssp_data_import_crons.py` — affected via `disabled_common_boot_image_import_hco_spec_scope_function` and `enabled_common_boot_image_import_feature_gate_scope_function`\n- `tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py` — affected via `disabled_common_boot_image_import_hco_spec_scope_function`, `disabled_common_boot_image_import_hco_spec_scope_class`, and teardown through `enable_common_boot_image_import_spec_wait_for_data_import_cron`\n- `tests/install_upgrade_operators/hco_enablement_golden_image_updates/test_enable_common_boot_image_import.py::test_enable_and_delete_spec_enable_common_boot_image_import_hco_cr` — requests `disabled_common_boot_image_import_hco_spec_scope_function`\n- `tests/install_upgrade_operators/hco_enablement_golden_image_updates/test_non_defaults.py` — class uses `disabled_common_boot_image_import_hco_spec_scope_class`\n- `tests/storage/upgrade/test_upgrade_storage.py` — uses `updated_default_storage_class_ocs_virt`, whose setup/teardown calls `verify_boot_sources_reimported`\n- `tests/storage/checkups/test_checkups_negative.py::TestStorageCheckupsNegative::test_no_default_storage_class` — uses `removed_default_storage_classes`, whose teardown calls `verify_boot_sources_reimported`\n\n**Real tests (cluster required)**\n\nError path (the fix — custom DataSource excluded from reimport verification):\n`pytest -s -o log_cli=true tests/install_upgrade_operators/hco_enablement_golden_image_updates/test_update_hco_cr.py::test_add_custom_data_import_cron_template_disable_spec`\nExpected: teardown completes without `AssertionError` from `verify_boot_sources_reimported` for the custom DataSource\n\nHappy path (regression — standard DIC-managed DataSources are still verified after re-enable):\n`pytest -s -o log_cli=true tests/infrastructure/golden_images/update_boot_source/test_ssp_data_import_crons.py tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py`\nExpected: re-enable path waits for standard boot sources to reach `Ready=True`; excluded-name logic does not affect default callers'
gh pr comment "$PR_NUMBER" --repo "$REPO" --body "$COMMENT_BODY"Length of output: 4395 🏁 Script executed: #!/bin/bash
set -euo pipefail
REPO="RedHatQE/openshift-virtualization-tests"
PR_NUMBER=4983
COMMENT_BODY=$'**Test Execution Plan**\n\n- **Run smoke tests: False** — No smoke-marked test was traced to the modified symbols. The smoke files found in `tests/` do not import or request `disabled_common_boot_image_import_hco_spec_scope_function`, `disabled_common_boot_image_import_hco_spec_scope_class`, `disabled_boot_image_import_excluding_custom_datasource`, `enable_common_boot_image_import_spec_wait_for_data_import_cron`, or `verify_boot_sources_reimported` through an autouse fixture. The `tests/conftest.py` fixtures that call the modified helpers are named fixtures, not autouse.\n- **Run gating tests: False** — No gating-marked test was traced to the modified symbols or to fixtures wrapping them. The direct and transitive affected tests found are not marked `gating`.\n\n**Affected tests to run**\n\n- `utilities/unittests/test_hco.py` — unit coverage for `exclude_data_source_names` propagation\n- `tests/install_upgrade_operators/hco_enablement_golden_image_updates/test_update_hco_cr.py::test_add_custom_data_import_cron_template_disable_spec` — uses `disabled_boot_image_import_excluding_custom_datasource`\n- `tests/install_upgrade_operators/product_install/test_install_openshift_virtualization.py::test_default_storage_class_set` — directly calls `verify_boot_sources_reimported`\n- `tests/storage/golden_image/test_cached_snapshots.py::test_automatic_update_for_system_cached_snapshot` — fixture teardown calls `disable_common_boot_image_import_hco_spec`\n- `tests/infrastructure/golden_images/update_boot_source/test_ssp_common_templates_boot_sources.py::test_vm_created_from_template_when_boot_source_opted_out` — requests `disabled_common_boot_image_import_hco_spec_scope_function`\n- `tests/infrastructure/golden_images/update_boot_source/test_ssp_data_import_crons.py` — affected via `disabled_common_boot_image_import_hco_spec_scope_function` and `enabled_common_boot_image_import_feature_gate_scope_function`\n- `tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py` — affected via `disabled_common_boot_image_import_hco_spec_scope_function`, `disabled_common_boot_image_import_hco_spec_scope_class`, and teardown through `enable_common_boot_image_import_spec_wait_for_data_import_cron`\n- `tests/install_upgrade_operators/hco_enablement_golden_image_updates/test_enable_common_boot_image_import.py::test_enable_and_delete_spec_enable_common_boot_image_import_hco_cr` — requests `disabled_common_boot_image_import_hco_spec_scope_function`\n- `tests/install_upgrade_operators/hco_enablement_golden_image_updates/test_non_defaults.py` — class uses `disabled_common_boot_image_import_hco_spec_scope_class`\n- `tests/storage/upgrade/test_upgrade_storage.py` — uses `updated_default_storage_class_ocs_virt`, whose setup/teardown calls `verify_boot_sources_reimported`\n- `tests/storage/checkups/test_checkups_negative.py::TestStorageCheckupsNegative::test_no_default_storage_class` — uses `removed_default_storage_classes`, whose teardown calls `verify_boot_sources_reimported`\n\n**Real tests (cluster required)**\n\nError path (the fix — custom DataSource excluded from reimport verification):\n`pytest -s -o log_cli=true tests/install_upgrade_operators/hco_enablement_golden_image_updates/test_update_hco_cr.py::test_add_custom_data_import_cron_template_disable_spec`\nExpected: teardown completes without `AssertionError` from `verify_boot_sources_reimported` for the custom DataSource\n\nHappy path (regression — standard DIC-managed DataSources are still verified after re-enable):\n`pytest -s -o log_cli=true tests/infrastructure/golden_images/update_boot_source/test_ssp_data_import_crons.py tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py`\nExpected: re-enable path waits for standard boot sources to reach `Ready=True`; excluded-name logic does not affect default callers'
gh api "repos/${REPO}/issues/${PR_NUMBER}/comments" \
--method POST \
-f body="$COMMENT_BODY"Length of output: 4579
Test Execution Plan
Affected tests to run
Real tests (cluster required) Error path: Expected: teardown completes without Happy path: Expected: re-enable path waits for standard DIC-managed DataSources to reach |
|
/lgtm |
|
/retest all Auto-triggered: Files in this PR were modified by merged PR #5323. Overlapping filesutilities/hco.py |
|
/retest tox |
|
No codecov/project configured for this repository |
What this PR does / why we need it:
After enabling common boot image imports,
verify_boot_sources_reimportedchecks all DIC-managed DataSources. If the cluster has custom DataImportCron templates whose DataSources lack valid sources, the verification fails waiting for DataSources that will never become Ready.This PR adds an optional
exclude_data_source_namesdenylist parameter so callers can skip specific DataSources. The default remains "verify all", which is backward compatible and automatically covers multiarch DataSource names (e.g.fedora-aarch64) and valid custom templates without requiring an explicit allowlist.The parameter is propagated through
disable_common_boot_image_import_hco_specso thattest_add_custom_data_import_cron_template_disable_speccan exclude the custom DataSource during teardown verification.This PR also de-quarantines
test_add_custom_data_import_cron_template_disable_spec, which was quarantined due to the teardownAssertionErrorinverify_boot_sources_reimported(CNV-88015). The fix resolves the root cause, so the quarantine marker is removed.Which issue(s) this PR fixes:
Special notes for reviewer:
jira-ticket:
CNV-88015
Summary by CodeRabbit
New Features
Tests
xfailexpectation for a custom data-import cron teardown-related test.Chores