Skip to content

WIP: feat: toehold (copy appliance) transfer path as a --toehold run toggle (VIRTSTRAT-757) - #835

Open
AmenB wants to merge 2 commits into
RedHatQE:mainfrom
AmenB:feat/toehold-t0-migration
Open

AmenB wants to merge 2 commits into
RedHatQE:mainfrom
AmenB:feat/toehold-t0-migration

Conversation

@AmenB

@AmenB AmenB commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

What

Adds toehold (copy appliance) transfer path support (VIRTSTRAT-757, MTV 5.0 feature_copy_appliance): instead of VDDK direct transfer, MTV deploys a copy appliance VM inside vSphere, exposes the source disks over NBD, and migrates through it (pipeline stages ApplianceDeployment → … → ApplianceTeardown).

The path is a run-level CLI toggle, not a per-test marker: passing --toehold attaches a session-scoped toehold_pre_setup fixture to every collected test, so the entire tier0 suite can run through the appliance path unchanged; without the flag, everything runs the regular transfer path.

  • conftest.py: --toehold option + collection-time fixture attachment. Flag and provider config must agree — --toehold without a provider toehold block (or a toehold provider without the flag) exits with a usage error instead of silently running the wrong path.
  • utilities/toehold.py: pre-setup/teardown — ForkliftController feature_copy_appliance gate + template config, provider copyAppliance* placement settings, CopyApplianceTemplate creation and build wait, optional controller/CDI dev-image overrides (restored on session end via ResourceEditor backups), fail-fast CopyApplianceCheck condition verification (block on CopyApplianceCheckFailed, tolerate CopyApplianceCheckPending).
  • Provider config: toehold block in .providers.json (schema + example + docs updated together) — keep a dedicated vSphere entry for toehold runs.
  • Docs: docs/pytest-options-and-markers.md, docs/provider-config-file.md, docsite regenerated.

Why a separate commit for the workaround

fe8ebe9 (grant the automation SA pull access to the nbd imagestream) works around MTV-7457 — the namespace default ServiceAccount cannot pull the copy-appliance-nbd imagestream the appliance import needs. It is isolated in its own commit with a RoleBinding created per-run in fixture_store (auto-deleted by teardown) so it can be reverted cleanly once the product fix ships.

Evidence

Two green end-to-end runs on a PSI cluster (qemtv-05, vSphere 7.0.3 source, OCS RBD destination, MTV 5.0 dev controller): 5/5 pass including full teardown. Plan pipeline confirmed the appliance path (ApplianceDeployment/DiskTransferV2v/ApplianceTeardown all Completed), post-migration checks pass (serial, firmware, NICs, guest agent), and teardown restores all cluster modifications (feature gate intentionally left on — inert without a provider template).

Notes for reviewers

  • The CDI/controller image overrides are cluster-wide: no other migration tests should run against the same cluster while a toehold run is active (documented in docs/provider-config-file.md).
  • Requires MTV 5.0+ with feature_copy_appliance support and a vSphere source provider.

@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Ignore keyword(s) in the title.

⛔ Ignored keywords: 1

  • WIP

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@redhat-qe-bot

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: Disabled for this repository
  • 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: All label categories are enabled (default configuration)

📋 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 (PR author or approvers)
  • /hold cancel - Unblock PR merging (PR author or approvers)
  • /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)
  • /automerge - Enable automatic merging when all requirements are met (effective maintainers and approvers only)
  • /automerge cancel - Remove automerge label (effective maintainers and 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 conventional-title - Validate commit message format
  • /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

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

📊 Review Process

Approvers and Reviewers

Approvers:

  • krcmarik
  • myakove
  • solenoci

Reviewers:

  • krcmarik
  • myakove
  • solenoci
Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve
  • automerge
AI Features
  • Conventional Title: Mode: fix (EnMaaS/rits/deepseek-ai/DeepSeek-V4.1-Flash-1017)
  • Cherry-Pick Conflict Resolution: Enabled (EnMaaS/rits/deepseek-ai/DeepSeek-V4.1-Flash-1017)
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.

@redhat-qe-bot

Copy link
Copy Markdown

⚠️ CI checks were skipped because this pull request has merge conflicts.

Please resolve the conflicts (rebase/merge) — checks will run automatically on your next push.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Add run-level toehold copy-appliance migration path

✨ Enhancement 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Add --toehold to run existing tests through vSphere's copy-appliance transfer path instead of
 VDDK.
• Configure and verify the appliance before migration, then restore temporary provider and image
 overrides.
• Document provider requirements and add a temporary image-pull permission workaround for MTV-7457.
Diagram

graph TD
  A["Toehold CLI"] --> B["Session fixture"] --> C["Provider settings"] --> D["Appliance template"] --> H["Migration tests"]
  B --> E["Forklift controller"] --> D
  B --> F["CDI images"] --> H
  B --> G["Pull RoleBinding"] --> D
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Preconfigure compatible cluster images
  • ➕ Avoids changing cluster-wide controller and CDI images during a test run.
  • ➕ Reduces rollout and restoration risk on shared clusters.
  • ➖ Requires maintaining a dedicated, prepared cluster.
  • ➖ Makes testing development images less flexible.

Recommendation: Keep the run-level fixture and optional image overrides for preview testing: the transfer path is a property of the selected provider and cluster, not an individual test. Prefer preconfigured compatible images when running on a stable or shared cluster; the documented isolation requirement remains important when overrides are used.

Files changed (39) +4296 / -979

Enhancement (2) +613 / -0
conftest.pyAttach and manage run-level toehold setup +172/-0

Attach and manage run-level toehold setup

• Registers '--toehold', rejects flag/provider mismatches, and attaches session setup to collected tests. The fixtures validate the vSphere configuration, prepare appliance resources, and restore temporary provider and image patches.

conftest.py

toehold.pyImplement copy-appliance setup and readiness checks +441/-0

Implement copy-appliance setup and readiness checks

• Configures the ForkliftController and optional CDI image overrides, creates the temporary image-pull RoleBinding and CopyApplianceTemplate, and waits for rollouts, SSH-secret publication, template build, and provider checks. Returns resource editors so the session fixture can restore temporary settings.

utilities/toehold.py

Documentation (34) +2574 / -69
SHARED_DISK_MIGRATION.htmlPublish generated shared-disk migration page +1162/-0

Publish generated shared-disk migration page

• Adds a generated HTML rendering of the existing shared-disk migration guide as part of the docsite regeneration.

docs/SHARED_DISK_MIGRATION.html

advanced-plan-features.htmlRefresh advanced-plan page navigation +16/-2

Refresh advanced-plan page navigation

• Adds the shared-disk guide to generated site navigation and changes the displayed GitHub repository links.

docs/advanced-plan-features.html

architecture-and-workflow.htmlRefresh architecture page navigation +16/-2

Refresh architecture page navigation

• Adds the shared-disk guide to generated site navigation and changes the displayed GitHub repository links.

docs/architecture-and-workflow.html

automation-and-release.htmlRefresh automation page and next-page link +20/-3

Refresh automation page and next-page link

• Adds the shared-disk guide to site navigation and as the next page, and changes the displayed GitHub repository links.

docs/automation-and-release.html

cleanup-and-teardown.htmlRefresh cleanup page navigation +16/-2

Refresh cleanup page navigation

• Adds the shared-disk guide to generated site navigation and changes the displayed GitHub repository links.

docs/cleanup-and-teardown.html

cold-migrations.htmlRefresh cold-migration page navigation +16/-2

Refresh cold-migration page navigation

• Adds the shared-disk guide to generated site navigation and changes the displayed GitHub repository links.

docs/cold-migrations.html

container-and-openshift-job-execution.htmlRefresh execution page navigation +16/-2

Refresh execution page navigation

• Adds the shared-disk guide to generated site navigation and changes the displayed GitHub repository links.

docs/container-and-openshift-job-execution.html

copy-offload-migrations.htmlRefresh copy-offload page navigation +16/-2

Refresh copy-offload page navigation

• Adds the shared-disk guide to generated site navigation and changes the displayed GitHub repository links.

docs/copy-offload-migrations.html

development-workflow.htmlRefresh development page navigation +16/-2

Refresh development page navigation

• Adds the shared-disk guide to generated site navigation and changes the displayed GitHub repository links.

docs/development-workflow.html

extending-the-suite.htmlRefresh extension page navigation +16/-2

Refresh extension page navigation

• Adds the shared-disk guide to generated site navigation and changes the displayed GitHub repository links.

docs/extending-the-suite.html

hooks-and-expected-failures.htmlRefresh hooks page navigation +16/-2

Refresh hooks page navigation

• Adds the shared-disk guide to generated site navigation and changes the displayed GitHub repository links.

docs/hooks-and-expected-failures.html

index.htmlAdd shared-disk guide to generated site index +33/-2

Add shared-disk guide to generated site index

• Adds a shared-disk migration card and navigation entry, and changes the displayed GitHub repository links.

docs/index.html

installation-and-local-setup.htmlRefresh installation page navigation +16/-2

Refresh installation page navigation

• Adds the shared-disk guide to generated site navigation and changes the displayed GitHub repository links.

docs/installation-and-local-setup.html

introduction.htmlRefresh introduction page navigation +16/-2

Refresh introduction page navigation

• Adds the shared-disk guide to generated site navigation and changes the displayed GitHub repository links.

docs/introduction.html

llms-full.txtRegenerate consolidated documentation +785/-4

Regenerate consolidated documentation

• Incorporates the toehold provider and CLI guidance and the shared-disk guide. The regeneration also picks up a changed storage-diagnostics description.

docs/llms-full.txt

llms.txtIndex the shared-disk guide +4/-0

Index the shared-disk guide

• Adds the shared-disk migration page to the generated LLM documentation index.

docs/llms.txt

optional-integrations-and-secrets.htmlRefresh integrations page navigation +16/-2

Refresh integrations page navigation

• Adds the shared-disk guide to generated site navigation and changes the displayed GitHub repository links.

docs/optional-integrations-and-secrets.html

plan-and-resource-reference.htmlRefresh resource-reference navigation +16/-2

Refresh resource-reference navigation

• Adds the shared-disk guide to generated site navigation and changes the displayed GitHub repository links.

docs/plan-and-resource-reference.html

prerequisites.htmlRefresh prerequisites page navigation +16/-2

Refresh prerequisites page navigation

• Adds the shared-disk guide to generated site navigation and changes the displayed GitHub repository links.

docs/prerequisites.html

project-structure.htmlRefresh project-structure navigation +16/-2

Refresh project-structure navigation

• Adds the shared-disk guide to generated site navigation and changes the displayed GitHub repository links.

docs/project-structure.html

provider-and-inventory-reference.htmlRefresh provider-reference navigation +16/-2

Refresh provider-reference navigation

• Adds the shared-disk guide to generated site navigation and changes the displayed GitHub repository links.

docs/provider-and-inventory-reference.html

provider-config-file.htmlPublish generated toehold provider guidance +89/-2

Publish generated toehold provider guidance

• Documents the new provider block, required placement and image fields, optional overrides, and the image-pull workaround. The regenerated page also gains shared-disk navigation and changed GitHub links.

docs/provider-config-file.html

provider-config-file.mdDocument toehold provider configuration +32/-0

Document toehold provider configuration

• Explains the dedicated vSphere entry, required and optional settings, feature-gate behavior, cleanup, and MTV-7457 workaround. Warns that CDI image overrides affect the cluster.

docs/provider-config-file.md

pytest-options-and-markers.htmlPublish generated toehold CLI guidance +39/-5

Publish generated toehold CLI guidance

• Explains that '--toehold' applies to the run rather than a marker and updates the options reference. The regenerated page also gains shared-disk navigation and changed GitHub links.

docs/pytest-options-and-markers.html

pytest-options-and-markers.mdDocument the run-level toehold option +20/-3

Document the run-level toehold option

• Describes fixture attachment, flag/provider mismatch behavior, and the absence of a toehold marker. Also revises the documented marker and option counts.

docs/pytest-options-and-markers.md

python-module-reference.htmlRefresh module-reference navigation +16/-2

Refresh module-reference navigation

• Adds the shared-disk guide to generated site navigation and changes the displayed GitHub repository links.

docs/python-module-reference.html

quickstart-first-run.htmlRefresh quickstart page navigation +16/-2

Refresh quickstart page navigation

• Adds the shared-disk guide to generated site navigation and changes the displayed GitHub repository links.

docs/quickstart-first-run.html

remote-openshift-migrations.htmlRefresh remote-migration navigation +16/-2

Refresh remote-migration navigation

• Adds the shared-disk guide to generated site navigation and changes the displayed GitHub repository links.

docs/remote-openshift-migrations.html

runtime-configuration.htmlRefresh runtime-configuration navigation +16/-2

Refresh runtime-configuration navigation

• Adds the shared-disk guide to generated site navigation and changes the displayed GitHub repository links.

docs/runtime-configuration.html

supported-providers-and-scenarios.htmlRefresh supported-scenarios navigation +16/-2

Refresh supported-scenarios navigation

• Adds the shared-disk guide to generated site navigation and changes the displayed GitHub repository links.

docs/supported-providers-and-scenarios.html

test-plan-configuration.htmlRefresh test-plan page navigation +16/-2

Refresh test-plan page navigation

• Adds the shared-disk guide to generated site navigation and changes the displayed GitHub repository links.

docs/test-plan-configuration.html

troubleshooting-and-diagnostics.htmlRefresh troubleshooting and storage-evidence guidance +17/-3

Refresh troubleshooting and storage-evidence guidance

• Updates the generated storage diagnostics description to cover scoped PVC, volume, attachment, event, and driver-log collection. Also gains shared-disk navigation and changed GitHub links.

docs/troubleshooting-and-diagnostics.html

warm-migrations.htmlRefresh warm-migration page navigation +16/-2

Refresh warm-migration page navigation

• Adds the shared-disk guide to generated site navigation and changes the displayed GitHub repository links.

docs/warm-migrations.html

test_mtv_cold_migration.pyClarify cold-test toehold behavior +5/-1

Clarify cold-test toehold behavior

• Extends the sanity cold-migration test docstring to describe how the run-level pre-setup selects the copy-appliance path. No test steps or assertions change.

tests/cold/test_mtv_cold_migration.py

Other (3) +1109 / -910
.providers.json.exampleExample dedicated toehold vSphere provider +51/-0

Example dedicated toehold vSphere provider

• Adds a vSphere entry with appliance placement and base-disk settings, plus optional image and hardware overrides. It omits the VDDK image to illustrate a separate copy-appliance provider.

.providers.json.example

providers_schema.jsonValidate vSphere toehold settings +183/-31

Validate vSphere toehold settings

• Adds a vSphere-only toehold configuration definition with required placement and base-image fields and optional image and hardware overrides. The diff also reformats existing schema entries.

providers_schema.json

uv.lockRefresh resolved dependency lockfile +875/-879

Refresh resolved dependency lockfile

• The PR includes a substantial lockfile refresh; no corresponding dependency declaration change is shown. The lockfile diff was not supplied for a package-level comparison.

uv.lock

@redhat-qe-bot

Copy link
Copy Markdown

⚠️ CI checks were skipped because this pull request has merge conflicts.

Please resolve the conflicts (rebase/merge) — checks will run automatically on your next push.

@AmenB
AmenB force-pushed the feat/toehold-t0-migration branch from 8ccae39 to 839eae1 Compare November 9, 2026 22:48
@redhat-qe-bot

Copy link
Copy Markdown

Clean rebase detected — no code changes compared to previous head (8ccae39).

@redhat-qe-bot

Copy link
Copy Markdown

⚠️ CI checks were skipped because this pull request has merge conflicts.

Please resolve the conflicts (rebase/merge) — checks will run automatically on your next push.

@qodo-code-review

qodo-code-review Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

Grey Divider


Action required

1. Teardown fails on a deleted provider ✓ Resolved

Resolving commit: b3740b1

Resolution reason
The PR's current code guards the provider settings restore in restore_toehold_setup
(utilities/toehold.py, conftest.py toehold_appliance finalizer) with a check that the provider still
exists: `if state.settings_editor and (provider is None or
_provider_exists(ocp_admin_client=ocp_admin_client, provider=provider))`, and the fixture passes
provider=ocp_provider. So if session cleanup already deleted the Provider, the settings restore is
skipped instead of patching a deleted resource, which removes the teardown failure. This is a
different mechanism than moving restores before session deletion, but it addresses the same failure
(patching a deleted Provider during teardown). The CDI and controller restores are still performed
in the finalizer, and the fixture's finally block is unchanged in the diff context, so the finding's
premise (restore attempting to patch a deleted Provider) no longer holds.
Description
toehold_appliance restores its provider settings in a session-fixture finalizer, but the
session-finish hook deletes the tracked Provider before that finalizer runs. On a normal run without
--skip-teardown, restore_toehold_setup() therefore attempts to patch a deleted Provider, adding
a teardown failure after the migration tests complete.

2. Failed appliance setup leaves CDI dev images live ✓ Resolved

Resolving commit: 3afb2c8

Resolution reason
Introduced a _ToeholdClusterState mutable holder filled in as each change is applied, with
toehold_appliance wrapping setup and yield in one try/finally that calls _restore_toehold_setup.
Restore is nested so every restore is attempted even if an earlier one fails.
Description
toehold_pre_setup calls _apply_toehold_setup before entering the try/finally that restores its
editors, so an exception during setup prevents it from receiving editors for changes already
applied. If a later validation, resource-creation, template-build, or appliance-readiness step
fails, the fixture never yields and the provider settings, cluster-wide CDI image override, and
ForkliftController template override can remain in place for later runs on the cluster.

3. Toehold runs fail during setup ✗ Dismissed

Dismissed as False positive

Description
patch_forklift_controller() reads forklift_controller.Condition, but the
openshift-python-wrapper ForkliftController has no such attribute and wait_for_condition()
accepts string values. Every toehold run that reaches the controller rollout wait raises
AttributeError before appliance preparation can finish.

View high (6)
4. API errors leave test images on the cluster ✓ Resolved

Resolving commit: d9ed96c

Resolution reason
Replaced the except TimeoutExpiredError with a try/finally guarded by a rolled_out flag, so the CSV
override is restored on any exception raised during the rollout wait.
Description
patch_cdi_images() restores its CSV backup only when _wait_for_cdi_rollout() raises
TimeoutExpiredError. If a deployment read or condition wait instead raises another API or runtime
exception after the CSV update, setup exits before the fixture's cleanup block and leaves the
cluster-wide CDI override applied.

5. Clusters run a mutable controller image ✓ Resolved

Resolving commit: 4f47607

Resolution reason
The commit removes the forklift_controller_image entry from _TOEHOLD_SHARED_CONFIG (line 59 of the
finding's diff is deleted at diff line 59-ish: the "forklift_controller_image" key is removed),
removes the controller_image_fqin patch from patch_forklift_controller, and deletes the
_wait_for_controller_rollout helper that waited on the image. The cluster-wide mutable controller
image override is therefore no longer installed at all, rather than being pinned to a digest. This
addresses the finding's concern (mutable tag executed cluster-wide) through removal, not by pinning
the digest the fix prompt suggested.
Description
TOEHOLD_CONFIG_BY_VERSION now supplies the mutable
quay.io/mnecas0/forklift-controller:toehold-test-fix tag for every supported-version run, and
patch_forklift_controller installs it as the operator-managed controller image. Whenever
--toehold runs, a later tag change can alter the cluster-wide controller code that executes under
the suite's administrative setup.

6. Parallel workers can undo each other's setup ⊘ Outdated
Description
toehold_pre_setup applies and backs up shared ForkliftController and CDI settings independently in
each pytest worker. With --toehold -n 2, one worker can restore those settings while another is
migrating, and a later worker can restore values it backed up after the first worker had already
patched them.

7. Appliance pull grants persist after runs ⊘ Outdated
Description
create_copy_appliance_nbd_puller_rolebinding() records a new RoleBinding in the fixture store, but
teardown_resources() never processes RoleBindings. Each toehold run therefore leaves its per-run
image-pull grant in the MTV namespace after the target namespace is deleted.

8. One restore failure leaves other overrides ⊘ Outdated
Description
toehold_pre_setup restores the provider, CDI, and controller editors as sequential statements in
one finally block. If the provider restore raises, neither cluster-wide image override is
restored; a CDI restore failure likewise skips the controller restore.

9. Job runs ignore the appliance toggle ✓ Resolved

Resolving commit: bd4400c

Resolution reason
Job mode with --toehold now exits with a clear usage error instead of silently dropping the flag.
The docstring and README note that toehold is local-mode only.
Description
run_command() accepts toehold, but the job-mode branch returns before the flag reaches the
generated Job's pytest command. With a regular provider in the manifest, `mtv-api-tests run --mode
job --toehold` silently exercises the regular transfer path; with a toehold provider, pytest exits
on the missing flag.


Remediation recommended

10. Appliance sizing overrides are never set ✓ Resolved

Resolving commit: 57899c0

Resolution reason
The commit deletes the three dead .get() branches for builder_image, cpu and memory_mib from
patch_forklift_controller (the first suggested option: delete the unused branches). It also changes
patch_cdi_images to index cdi_controller_image and cdi_importer_image directly instead of using
.get() with a silent return None, addressing the second concern about hidden misconfiguration.
Description
patch_forklift_controller reads builder_image, cpu and memory_mib with .get() from
toehold_config, but no entry in TOEHOLD_CONFIG_BY_PROVIDER defines those keys, so the three if
branches never run and the controller template keeps its defaults. Since this dict is hardcoded and
controlled, a future entry that does set these keys looks configured while the sizing is silently
dropped, and the .get() reads on the always-present CDI keys in patch_cdi_images likewise hide a
missing-key misconfiguration behind a silent return None.

11. Template creation skips the shared helper ✓ Resolved

Resolving commit: b3740b1

Resolution reason
create_provider_copy_appliance_template now calls create_and_store_resource(...,
on_conflict="fail"); create_and_store_resource gained an on_conflict Literal parameter that raises
ValueError on ConflictError instead of adopting, so the refusal behaviour is kept inside the shared
creation path and store_resource_for_teardown is the single registration point.
Description
create_new_and_store_resource builds the CopyApplianceTemplate with resource(**kwargs) and calls
_resource.deploy(wait=True) directly, instead of going through create_and_store_resource(),
which is the centralized creation path. Every appliance template created by
create_provider_copy_appliance_template takes this route, so later fixes to the shared creation
logic (naming, reuse, teardown registration) will not reach it. A refusal-on-conflict option on
create_and_store_resource would keep the behaviour without a second creation path.

12. Fallback tests miss direct transfer ✓ Resolved

Resolving commit: b3740b1

Resolution reason
At PR head, the fallback scenarios the finding names are marked with @pytest.mark.vddk_baseline:
TestCopyoffloadMixedDatastoreMigration (tests/copyoffload/test_copyoffload_migration.py ~line 3359),
TestCopyoffloadFallbackLargeMigration (~line 3610), and the snapshot base class
CopyoffloadSnapshotBase (~line 309). The conftest.py collection hook at PR head skips every item
carrying vddk_baseline under --toehold (the "if item.get_closest_marker('vddk_baseline')" branch),
so these fallback tests no longer receive toehold_appliance. The issue is addressed by marking the
fallback scenarios with vddk_baseline and excluding them from toehold collection, a different
mechanism than the suggested per-test marking but covering the same tests.
Description
The vddk_baseline skip applies to the concurrent comparison class but not to the copy-offload
fallback classes, so the collection hook attaches toehold_appliance to those classes and clears
their provider’s VDDK image. With --toehold -m copyoffload, their xcopyUsed=False checks can
pass using the appliance rather than exercising the standard non-XCOPY transfer they describe.

View medium (40)
13. Failed template deploy escapes teardown ✓ Resolved

Resolving commit: b3740b1

Resolution reason
Moved the teardown registration (store_resource_for_teardown) to occur before the deploy(wait=True)
call, so a resource created but failing its existence wait still has a teardown entry. ConflictError
handling is preserved, with on_conflict="fail" raising without adopting the resource.
Description
create_new_and_store_resource calls deploy(wait=True) before recording the CopyApplianceTemplate
for teardown, and handles only ConflictError. If creation succeeds but the subsequent existence
wait raises another exception, template-specific teardown has no entry to delete or report, leaving
the template to namespace cleanup and causing the next run’s assert_copy_appliance_template_absent
check to fail if it remains.

14. Callers lose the original conflict error type ✓ Resolved

Resolving commit: 374e8d3

Resolution reason
The from None was replaced by from conflict_error after binding the exception to
conflict_error, so the original Kubernetes ConflictError is preserved as the chained cause in the
raised ValueError.
Description
When adopt_on_conflict is False, create_and_store_resource catches the Kubernetes
ConflictError and raises a generic ValueError with from None, so the original exception type
and its chain are discarded. Any caller that expects ConflictError on a name clash will no longer
catch it, and the toehold template creation path is the only one that reaches this branch.

15. Test config holds toehold setup logic ✓ Resolved

Resolving commit: 40a0851

Resolution reason
N/A
Description
The toehold apply and restore helpers and their state dataclass are plain module-level code in the
pytest config file, which the checklist limits to fixtures and hooks. A maintainer searching the
toehold utilities for the appliance setup will not find this logic, and new helpers added beside it
will follow the same pattern.

16. Some plan checks validate the wrong path ✓ Resolved

Resolving commit: e67b028

Resolution reason
Items that use ca_crt_source_provider or insecure_source_provider are skipped at collection time
under --toehold, so their Plan readiness checks never run as appliance-path coverage; documentation
in pytest markers and README was updated to match.
Description
toehold_appliance patches only source_provider.ocp_resource, while the cold certificate and
insecure-connection fixtures create separate Provider resources without the appliance settings or
template. When those tier1 tests run with --toehold, their Plan readiness checks use the separate
resources and can pass through the VDDK configuration instead of validating appliance readiness.

17. Cloned VM setup crashes on null NICs ✓ Resolved

Resolving commit: e67b028

Resolution reason
Changed the nics read in _check_mac_convergence to vm.get("nics") or [], so a null nics field is
treated as no NICs and polling continues instead of raising TypeError.
Description
_wait_for_inventory_mac_convergence() now forces a provider refresh, but its MAC checker iterates
vm.get("nics", []) without handling a present-but-null nics field. If inventory returns that
transient state during reconciliation, TypeError escapes the polling loop instead of allowing the
cloned VM's MACs to converge.

18. Another appliance template can be deleted ✓ Resolved

Resolving commit: bd75503

Resolution reason
Added an adopt_on_conflict parameter to create_and_store_resource (utilities/resources.py). On
ConflictError with adopt_on_conflict=False it raises ValueError instead of reusing the resource, and
it does so before the teardown registration at the end of the function.
create_provider_copy_appliance_template passes adopt_on_conflict=False (utilities/toehold.py line
452 at head), so a race-created template is never adopted or deleted at teardown. This matches the
suggested fix, which proposes propagating the conflict as a setup error.
Description
create_provider_copy_appliance_template() checks that the fixed name is absent, then uses
create_and_store_resource(), which adopts an existing resource on a creation conflict and
registers it for teardown. If the provider controller or another actor creates that name between the
check and the create call, session teardown deletes a template this run did not create.

19. Controller wait helper looks public ✓ Resolved

Resolving commit: 6692ac8

Resolution reason
The PR head defines the helper as _wait_for_forklift_controller_running (line 170) and both call
sites (lines 160 and 250) use the underscore name. No public wait_for_forklift_controller_running
remains in the current code, so the naming issue is resolved.
Description
wait_for_forklift_controller_running has no leading underscore, but it is called only from
restore_forklift_controller and patch_forklift_controller inside utilities/toehold.py and is
never imported elsewhere. Its public-looking name suggests a reusable API that other modules may
come to depend on, which does not match its internal scope.

20. Controller settings outlast the run ✓ Resolved

Resolving commit: d5041ac

Resolution reason
The PR head's _restore_toehold_setup now calls restore_forklift_controller(...) in the
controller-editor branch. restore_forklift_controller (utilities/toehold.py, current content) calls
editor.restore() and then wait_for_forklift_controller_running(), which waits up to
FORKLIFT_CONTROLLER_ROLLOUT_TIMEOUT for the RUNNING condition to be TRUE. So the teardown no longer
returns before the controller reconciles the restored config. The suggested fix's second part
(rollback wait in patch_forklift_controller's failure path) is also present: the failure branch
calls editor.restore() and the success path waits via wait_for_forklift_controller_running. The wait
is implemented via a Running-condition wait rather than checking the deployment generation, which is
a different but valid implementation.
Description
_restore_toehold_setup() restores the ForkliftController spec but does not wait for the operator
to apply the restored configuration, unlike its CDI restoration path. When the controller reconciles
asynchronously, the session can finish while its deployment still serves the toehold template
settings, despite teardown having reported completion.

21. Setup fixture name reads as an action ⊘ Outdated
Description
toehold_pre_setup is a session fixture that yields no value and only patches cluster settings,
then restores them on teardown, yet its name is a setup-style action rather than a noun for a
provided resource. Because it is attached at collection time through fixturenames instead of being
requested by name, readers scanning fixtures for what a test receives will not find a resource, and
the name does not follow the noun convention used by the sibling fixture toehold_config.

22. Back-to-back clones can miss a refresh ✓ Resolved

Resolving commit: c258b73

Resolution reason
The PR head adds _next_refresh_timestamp, which returns max(int(time.time()), last+1) and bumps
above the provider's current _refresh value if it is numeric and >= candidate.
force_inventory_refresh now uses this helper, so each forced refresh writes a value strictly
different from the provider's current one, even within the same second. This addresses the finding's
premise with a different implementation than the suggested fix (which is essentially the same idea,
so it is close but the helper also reads the live provider value), and the readiness wait and MAC
polling are kept intact.
Description
_wait_for_inventory_mac_convergence calls force_inventory_refresh, which writes _refresh using
a timestamp rounded to whole seconds, so consecutive calls can write the same value. If two cloned
VMs need a refresh within one second, the second request leaves the refresh trigger unchanged, and
its MAC check can time out while subsequent polling only reads inventory.

23. Setup fixture body lacks section breaks ⊘ Outdated
Description
toehold_pre_setup has a body of roughly 59 lines (from the provider lookup through the nested
finally restores) whose only comments are explanatory notes, with no section comments dividing the
patch, assert, controller, template and teardown phases. A reader must trace the whole sequence to
find where each cluster change is applied and rolled back, and the function is over the 50-line
threshold that requires such dividers.

24. Misconfigured clusters wait out CDI rollouts first ✓ Resolved

Resolving commit: d5041ac

Resolution reason
At PR head, _apply_toehold_setup runs provider settings patch, assert_copy_appliance_path_enabled
(controller-level VDDK_IMAGE check), and assert_copy_appliance_template_absent before
patch_cdi_images and patch_forklift_controller. The CDI override (and its rollout wait) now happens
only after the cheap checks pass, so misconfigurations fail in seconds without disturbing CDI. The
fix is implemented by reordering within a helper function rather than moving the call into the try
block as the prompt suggests, and it also adds a separate leftover-template pre-check.
Description
toehold_pre_setup calls patch_cdi_images first. That patches the CNV CSV and waits up to 3×600s
for the CDI rollout. Only after that do assert_copy_appliance_path_enabled (the controller-level
VDDK_IMAGE check) and the leftover-template check in create_provider_copy_appliance_template run.
When either check fails, the session first rolls the cluster-wide CDI controller to the dev image.
The finally then rolls it back and waits again, so a configuration error that could fail in
seconds costs tens of minutes. It also disturbs CDI for everyone else on the cluster.

25. Concurrent copy test misses direct transfer ✓ Resolved

Resolving commit: 3afb2c8

Resolution reason
N/A
Description
pytest_collection_modifyitems attaches toehold_pre_setup to the concurrent copy-offload test,
and that fixture clears the provider’s vddkInitImage before its second migration runs. With
--toehold -m copyoffload, the test still labels and checks that migration as its VDDK comparison,
but the provider is configured to use the appliance instead, so a passing run no longer covers the
comparison the test promises.

26. Template errors stop remaining cleanup ✗ Dismissed

Dismissed as Rejected

Description
teardown_resources catches only TimeoutExpiredError and ResourceTeardownError in the
CopyApplianceTemplate loop, although clean_up(wait=True) can propagate other Kubernetes client or
connection errors. If a template disappears between the wrapper’s existence check and delete call,
for example, a NotFoundError escapes before teardown can clean up providers, secrets, maps,
namespaces, and vSphere clones or record them as leftovers.

27. Existing appliance templates get deleted ✓ Resolved

Resolving commit: accfac2

Resolution reason
At PR head, create_provider_copy_appliance_template now scans CopyApplianceTemplate.get() in the
provider namespace before creating and raises ValueError if a template with the fixed name already
exists ("delete the leftover before running"). Thus the run never reaches
create_and_store_resource's ConflictError reuse path for this template, so no pre-existing template
is ever adopted and registered for teardown. This matches the suggested fix's "reject an existing
template with a clear setup error" option.
Description
create_provider_copy_appliance_template() passes a fixed name to create_and_store_resource(),
which reuses an existing template on a creation conflict but still records it as owned by this
session. If that name already exists from an earlier run or another owner, the new teardown loop
deletes the existing template.

28. Long provider names break the template lookup ✓ Resolved

Resolving commit: 2f0a6c5

Resolution reason
At PR head, create_provider_copy_appliance_template computes template_name =
f"{provider.name}-copy-appliance-template" and, before calling create_and_store_resource, raises
ValueError if len(template_name) > K8S_NAME_MAX_LENGTH (63), naming the provider and telling the
user to use a shorter name. So a truncated name is never created. K8S_NAME_MAX_LENGTH is exported
from utilities/naming.py and imported in toehold.py, matching the suggested fix.
Description
create_provider_copy_appliance_template builds the CR name as
f"{provider.name}-copy-appliance-template", but create_and_store_resource passes every name
through truncate_resource_name, which keeps only the last 63 characters. If the provider name is
longer than 39 characters, the CR is created under a name with the front cut off, while the
controller still looks for <provider>-copy-appliance-template; the appliance check then never
finds the template and setup waits the full 1800 s before timing out.

29. The appliance template is never cleaned up explicitly ✓ Resolved

Resolving commit: d16193b

Resolution reason
At PR head, utilities/pytest_utils.py teardown_resources reads
session_teardown_resources.get(CopyApplianceTemplate.kind, []) and, before the Provider loop,
deletes each template via CopyApplianceTemplate(...).clean_up(wait=True). Failures on
clean_up(wait=True) are appended to leftovers, and TimeoutExpiredError/ResourceTeardownError are
logged and recorded as leftovers. This matches the suggested fix and resolves the finding.
Description
create_provider_copy_appliance_template stores the CopyApplianceTemplate in fixture_store under
kind CopyApplianceTemplate, but teardown_resources has no branch for that kind. It is deleted,
if at all, only as a side effect of namespace deletion, and that happens after the referenced
Provider has already been removed. Any template cleanup the controller does when the CR is deleted
is therefore not driven or verified by teardown, and a CR that fails to delete never shows up in the
leftovers report.

30. Controller config stays patched after an API error ✓ Resolved

Resolving commit: 1796bee

Resolution reason
Replaced the TimeoutExpiredError-only handling with a rolled_out flag and a finally clause that
restores the ForkliftController template-config editor on any failure during the rollout wait, so
API errors also roll back the override.
Description
patch_forklift_controller restores its template-config editor only on TimeoutExpiredError from
wait_for_condition; any other exception (API error, missing status) propagates with the patch
applied. toehold_pre_setup then sees controller_editor still None and skips the restore, leaving
the cluster-wide ForkliftController overrides in place — the same gap already fixed for the CDI
override with a finally.

31. Kubernetes package imported directly in toehold module ✗ Dismissed

Dismissed as Intentional

Description
utilities/toehold.py adds from kubernetes.dynamic import DynamicClient under TYPE_CHECKING, a
direct import of the kubernetes package in non-test code. The import exists only for annotations,
yet the rest of the module uses openshift-python-wrapper resources, so it bypasses the
wrapper-only policy for cluster-facing code.

32. Setup plans omit appliance preparation ⊘ Outdated
Description
pytest_collection_modifyitems places the new --toehold fixture injection inside a block that
runs only when is_dry_run(config) is false. With --setup-plan --toehold, pytest therefore omits
toehold_pre_setup from its fixture plan, even though a real run requests the cluster-wide
appliance preparation.

33. Controller config stays patched without CDI override ✓ Resolved

Resolving commit: c463827

Resolution reason
N/A
Description
In the toehold_pre_setup finally block, controller_editor.restore() sits inside the `if
cdi_override: branch. patch_cdi_images returns None` whenever the config lacks either CDI image
key, and in that case the ForkliftController template-config overrides are never restored. The
helpers explicitly support this case (the docstring says the CDI override is optional), so any
provider entry without dev CDI images leaves the cluster-wide controller spec modified after the
run.

34. Upgrading clusters can fail appliance setup ✓ Resolved

Resolving commit: c463827

Resolution reason
At PR head, _get_cdi_csv() (lines 446-475 of utilities/toehold.py) now filters candidates to those
with CDI env vars AND candidate.instance.status.get("phase") == "Succeeded", returns the single
candidate, raises ValueError on multiple active candidates (ambiguous), and raises ValueError if
none is active. The comment explicitly explains that replaced CSVs must be excluded. This addresses
the finding's premise (replaced CSV patched) and the recommended fix's "active, succeeded CSV" and
"fail clearly" requirements, though it differs in that it errors on ambiguity instead of selecting
one.
Description
_get_cdi_csv() returns the first CSV with the two CDI image environment variables without checking
whether it is the active operator version. During an operator upgrade, a replaced CSV can still be
present; patching it leaves the running CDI deployment unchanged, so the rollout wait times out
instead of starting the toehold run.

35. CDI controller Deployment handle is duplicated across helpers ✓ Resolved

Resolving commit: c463827

Resolution reason
The current PR head adds _get_cdi_controller_deployment(ocp_admin_client) (lines 429-443 of the file
content), which builds the Deployment(client, name=CDI_CONTROLLER_DEPLOYMENT,
namespace=CNV_NAMESPACE, ensure_exists=True) once. Both patch_cdi_images (line 405) and
_wait_for_cdi_rollout (line 556) now call this helper, so the duplicated construction the finding
describes is gone and the two sites cannot drift apart.
Description
The `Deployment(client=..., name=CDI_CONTROLLER_DEPLOYMENT, namespace=CNV_NAMESPACE,
ensure_exists=True) construction is repeated in patch_cdi_images` and again in
_wait_for_cdi_rollout. Both copies must stay in sync on the deployment name and namespace, and a
change to one that misses the other makes the image capture and the rollout wait inspect different
resources.

36. Runs can finish before CDI returns ✓ Resolved

Resolving commit: 791e1dd

Resolution reason
The PR head now has CdiImageOverride.restore(), which restores the CSV and then calls
_wait_for_cdi_rollout(...) with the captured original_controller_image. That wait polls the
deployment image, observedGeneration/updatedReplicas vs generation, and Available=True.
toehold_pre_setup's finally block calls cdi_override.restore(ocp_admin_client=...), so the rollback
wait happens on teardown. patch_cdi_images also restores on rollout-timeout failure, covering the
setup-failure path. This matches the finding's intent, though the restore is wrapped in a class
rather than the suggested inline capture.
Description
toehold_pre_setup calls cdi_editor.restore() without waiting for the CDI deployment to roll back
to its original image. Because the forward CSV change requires an asynchronous operator rollout, a
subsequent regular run can begin while the overridden controller is still serving.

37. Guest-info helper stranded in conftest ✓ Resolved

Resolving commit: b51f6e5

Resolution reason
The guest-info helper now lives in utilities/vmware_guest_operations.py as wait_guest_info_or_fail
(diff lines 3928-3958), with the same role and a ValueError on timeout. conftest.py only imports it
(diff lines 143-146 region, 2601-2604 of the diff) and calls it at the prepared_plan call sites. No
module-level helper remains in conftest.py, so the finding's premise is resolved at the PR head.
Description
_wait_guest_info_or_fail is a plain module-level function added to conftest.py. It is neither a
@pytest.fixture nor a pytest_* hook, and it is called from the prepared_plan fixture at three
call sites. Conftest is meant to hold only fixtures and hooks, so a later reader looking for
guest-info waits in utilities/ will not find it.

38. A prior check can approve a new appliance ✗ Dismissed

Dismissed as False positive

Description
_wait_for_provider_copy_appliance_check accepts CopyApplianceChecked=True without establishing
that the condition belongs to the template just created. If a provider retains its documented
durable result from an earlier check, setup can proceed before the current appliance check
completes; a retained failure can instead abort it before the new check runs.

39. CDI setup can pass before pods update ✗ Dismissed

Dismissed as Rejected

Description
_wait_for_deployment_image reads the CDI Deployment's desired pod-template image, and
_wait_for_cdi_rollout then checks only its Available condition. Immediately after a template
change, the desired image can match while availability still reflects old replicas, allowing
appliance setup to continue before the replacement CDI controller is serving requests.

40. Powered-off clones fail during NIC setup ✓ Resolved

Resolving commit: cd20a5a

Resolution reason
The post-add_nic call to _wait_guest_info_or_fail is now wrapped in `if
source_provider.is_vm_powered_on(provider_vm_api):`, so the powered-on-only wait runs only for
powered-on clones. Powered-off clones skip it and keep the existing cloning and metadata path.
Description
prepared_plan calls _wait_guest_info_or_fail after adding a NIC without checking whether the
clone is powered on. When source_vm_power is "off", the preceding branch stops the VM, so the
wait's powered-on requirement cannot succeed and plan preparation fails after the timeout.

41. Appliance setup runs after the plan VMs are prepared ✗ Dismissed

Dismissed as Rejected

Description
pytest_collection_modifyitems attaches the fixture with
item.fixturenames.append("toehold_pre_setup"), and pytest fills fixtures in fixturenames order.
That places the session fixture after the class-scoped prepared_plan, which clones and
reconfigures the VMs and waits for them to appear in Forklift inventory. The ForkliftController
patch, which makes the operator roll the controller and its inventory, and the cluster-wide CDI
image rollout therefore run after that inventory wait, right before the first map or plan test step.

42. Any vSphere provider labelled "8" gets QE-specific paths ✓ Resolved

Resolving commit: 06fcb5f

Resolution reason
The version-keyed map was replaced with a provider-name-keyed map (TOEHOLD_CONFIG_BY_PROVIDER with
vsphere-7.0.3 and vsphere-8.0.1 keys, no bare "8" key), so unrelated vCenters no longer receive the
QE placement paths; the docstring explains the provider-name keying rationale.
Description
The new "8" key in TOEHOLD_CONFIG_BY_VERSION is matched by exact string equality against the
provider's version field, so any vSphere provider whose version is the bare string "8" receives
the hardcoded QE resource pool /Datacenter/host/mtv-cluster/Resources and shared
datastore/folder/network paths. This is a version-string alias for one CI secret rather than an
identifier of a vCenter, so a different vCenter that happens to report "8" passes --toehold
collection and then fails appliance setup on missing inventory paths.

43. Clone guest-OS race still proceeds silently on timeout ✓ Resolved

Resolving commit: cd20a5a

Resolution reason
N/A
Description
wait_for_vmware_guest_info now returns False when guestFamily stays empty for the full timeout,
but the two conftest clone/power-on call sites discard that return value and continue, so the
"Cannot determine guest OS" failure still occurs after an extra silent wait of up to
guest_agent_timeout seconds. The same stricter predicate reaches
utilities/copyoffload_migration.py, which converts the False into a hard ValueError, so VMs
whose tools never populate guestFamily within the timeout (where they previously passed on tools
OK plus network data) now fail copy-offload setup.

44. Automation doc omits that --toehold is rejected in job mode ✗ Dismissed

Dismissed as Rejected

Description
The docs/automation-and-release.md sentence lists --toehold as accepted by mtv-api-tests run
and says it is forwarded to pytest, but it does not say that job mode rejects the flag.
run_command() exits with code 1 when mode == "job" and toehold is set, because the Job
manifest's pytest command is fixed at generate time. A user who reads only this doc and runs
--mode job --toehold gets a hard error that the doc never mentioned.

45. Same-version vCenters fail appliance setup ✓ Resolved

Resolving commit: 06fcb5f

Resolution reason
The config is now keyed by provider name (TOEHOLD_CONFIG_BY_PROVIDER) instead of vSphere version.
The comment at lines 48-54 explains that an unrelated vCenter running the same version must not
receive these paths. toehold_usage_error (lines 76-98) rejects any provider name not in the map, and
get_toehold_config (lines 101-122) looks up by provider name, so providers without a matching
placement fail fast before cluster modification. This addresses the finding's premise through a
different implementation than the suggested fix.
Description
TOEHOLD_CONFIG_BY_VERSION chooses fixed QE inventory paths solely by vSphere version, including a
host-specific resource pool for 7.0.3. A provider on another vCenter with the same supported version
passes collection validation but receives those paths in its Provider settings and template, so
setup cannot complete when that inventory lacks them.

46. ForkliftController handle is built twice in one helper ⊘ Outdated
Description
patch_forklift_controller constructs an identical `ForkliftController(client=...,
name=FORKLIFT_CONTROLLER_NAME, namespace=mtv_namespace, ensure_exists=True)` object twice: once
before the feature-gate update and again before the template and image patch. The six-line block is
copy-pasted within the same function, so a later change to the constructor arguments has to be made
in both places and can drift.

47. Cleanup guards test editor objects by truthiness ⊘ Outdated
Description
The finally block of toehold_pre_setup guards the CDI and controller restores with `if
cdi_editor: and if controller_editor:, where both variables are ResourceEditor | None`. The
None case is tested by truthiness instead of is not None, so an editor object that defines falsy
behaviour would silently skip its restore. This runs on every toehold session teardown, so a skipped
restore would leave the cluster-wide CDI or controller image overrides in place.

48. One CDI image override is silently ignored ⊘ Outdated
Description
patch_cdi_images returns without changing either image unless both optional CDI image fields are
truthy. A provider configuration specifying just one override passes the new schema, but setup
proceeds without applying the requested image.

49. A successful appliance check can time out ⊘ Outdated
Description
_wait_for_provider_copy_appliance_check requires the CopyApplianceCheckNotReady condition to
disappear, rather than checking whether its status is still True. If the condition remains with
status False after CopyApplianceChecked becomes True, setup waits until its 1,800-second
timeout despite a non-blocking result.

50. Unjustified Any types in toehold helpers ⊘ Outdated
Description
The new helpers in utilities/toehold.py annotate toehold_config, fixture_store and the other
config payloads as dict[str, Any] with no preceding comment explaining why a narrower type cannot
be used. Nothing in the diff documents that these are deliberately dynamic JSON payloads, so the
next reader cannot tell whether the Any is intentional or a shortcut.

51. Regular provider pools can abort runs ✓ Resolved

Resolving commit: cd42d9d

Resolution reason
Removed the post-selection guard verify_pool_provider_toehold_agreement and the toehold block in
providers config entirely; toehold is now hardcoded per vSphere version and --toehold is validated
at collection time, so regular pool selection can no longer be aborted by a toehold entry.
Description
verify_pool_provider_toehold_agreement aborts when a regular pool selects a toehold entry, but
pool derivation does not exclude those entries from regular candidates. When a dedicated toehold
entry matches a regular run's provider type and version and wins selection, the entire run fails
even if a regular entry was available.

52. Conftest grows a non-fixture helper ✓ Resolved

Resolving commit: bd4400c

Resolution reason
The helper was removed from conftest.py and re-implemented as public function
verify_pool_provider_toehold_agreement in utilities/toehold.py, taking providers_json_path,
toehold_flag, and provider_name (not request), with the same ValueError messages. conftest.py
imports it and calls it from selected_source_provider, passing request.config option values. This
matches the suggested fix closely.
Description
_verify_pool_provider_toehold_agreement is a plain module-level function added to conftest.py.
It is neither a @pytest.fixture nor a pytest_* hook, and it is called only from the
selected_source_provider fixture. Conftest is meant to hold only fixtures and hooks, so this
helper sits outside the module where the rest of the toehold logic lives (utilities/toehold.py),
and a later reader searching utilities for the toehold checks will miss it.

Grey Divider

⚠️ Warning | Comment size exceeded, 25 lower severity findings omitted View findings
⚠️ Warning | Comment size exceeded, inner finding content trimmed View findings
⚠️ Warning | Comment size exceeded, non finding content trimmed Learn more

Grey Divider

Qodo Logo

Comment thread utilities/toehold.py Resolved
Comment thread utilities/toehold.py Resolved
Comment thread conftest.py Resolved
Comment thread conftest.py Resolved
Comment thread conftest.py Resolved
Comment thread conftest.py Resolved
@redhat-qe-bot

Copy link
Copy Markdown

⚠️ CI checks were skipped because this pull request has merge conflicts.

Please resolve the conflicts (rebase/merge) — checks will run automatically on your next push.

@AmenB

AmenB commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

/qodo

The following review comments were reviewed and a decision was made:

conftest.py:1288 (qodo rule violation) — Required toehold keys are read with .get() before validation

Addressed: Addressed in 9dcdbd2: toehold_config reads the five schema-required keys with direct access (toehold_config_data[param]) — a missing key now fails fast with KeyError per the required-field access rule; the remaining explicit check rejects empty values.

utilities/toehold.py:52 (qodo rule violation) — Client parameters lose type checking

Addressed: Addressed in 9dcdbd2: ocp_admin_client is now typed as DynamicClient (TYPE_CHECKING import, matching utilities/aap.py) in patch_forklift_controller, wait_provider_copy_appliance_template, create_copy_appliance_nbd_puller_rolebinding, patch_cdi_images, _wait_for_controller_rollout, _get_cdi_csv and _wait_for_cdi_rollout.

conftest.py:1377 (qodo rule violation) — Teardown error hides the real setup failure

Addressed: Addressed in 9dcdbd2: patch_forklift_controller restores its own backup when the rollout/condition waits fail (TimeoutExpiredError -> editor.restore() -> raise), and toehold_pre_setup initializes controller_editor to None and guards the finally-block restore — no UnboundLocalError can mask the original failure, and an applied override is rolled back.

conftest.py:1354 (qodo bug) — Failed CDI rollout leaves test images active

Addressed: Addressed in 9dcdbd2: patch_cdi_images restores its CSV backup when _wait_for_cdi_rollout fails (TimeoutExpiredError -> editor.restore() -> raise), so a failed CDI rollout no longer leaves the cluster-wide image overrides active.

@AmenB

AmenB commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

/qodo

The following review comments were reviewed and a decision was made:

utilities/toehold.py:270 (qodo rule violation) — Image rollout polling copied in two places

Addressed: Addressed in 9dcdbd2: extracted _wait_for_deployment_image(deployment, expected_image, timeout) — both _wait_for_controller_rollout and _wait_for_cdi_rollout now call it, so the polling logic lives in one place.

conftest.py:160 (qodo rule violation) — README misses the new --toehold flag

Addressed: Addressed in 9dcdbd2: README.md now has a 'Toehold (Copy Appliance) Runs' section documenting the --toehold flag, the dedicated toehold provider entry, the mismatch fail-fast, the mtv-api-tests run forwarding, and the cluster-exclusivity caveat, with a link to the docs provider-config page.

conftest.py:598 (qodo bug) — Pool runs can use the wrong transfer path

Addressed: Addressed in 9dcdbd2: pool-selected providers are now checked in selected_source_provider via _verify_pool_provider_toehold_agreement — --toehold with pool selection fails fast (setup is attached at collection, before pool selection), and a pool-selected toehold provider without the flag fails fast too. Documented in the --toehold option table.

conftest.py:160 (qodo bug) — The suite command cannot enable toehold

Addressed: Addressed in 9dcdbd2: the mtv-api-tests run command now accepts and forwards --toehold to pytest (cli/mtv_api_tests run.py and init.py), so local runs via the suite command can select the copy appliance path. Documented in README.md and docs/automation-and-release.md.

@qodo-code-review

Copy link
Copy Markdown

The following review comments were reviewed and a decision was made:

conftest.py:1288 (qodo rule violation) — Required toehold keys are read with .get() before validation

Addressed: Addressed in 9dcdbd2: toehold_config reads the five schema-required keys with direct access (toehold_config_data[param]) — a missing key now fails fast with KeyError per the required-field access rule; the remaining explicit check rejects empty values.

utilities/toehold.py:52 (qodo rule violation) — Client parameters lose type checking

Addressed: Addressed in 9dcdbd2: ocp_admin_client is now typed as DynamicClient (TYPE_CHECKING import, matching utilities/aap.py) in patch_forklift_controller, wait_provider_copy_appliance_template, create_copy_appliance_nbd_puller_rolebinding, patch_cdi_images, _wait_for_controller_rollout, _get_cdi_csv and _wait_for_cdi_rollout.

conftest.py:1377 (qodo rule violation) — Teardown error hides the real setup failure

Addressed: Addressed in 9dcdbd2: patch_forklift_controller restores its own backup when the rollout/condition waits fail (TimeoutExpiredError -> editor.restore() -> raise), and toehold_pre_setup initializes controller_editor to None and guards the finally-block restore — no UnboundLocalError can mask the original failure, and an applied override is rolled back.

conftest.py:1354 (qodo bug) — Failed CDI rollout leaves test images active

Addressed: Addressed in 9dcdbd2: patch_cdi_images restores its CSV backup when _wait_for_cdi_rollout fails (TimeoutExpiredError -> editor.restore() -> raise), so a failed CDI rollout no longer leaves the cluster-wide image overrides active.

Thanks for the update. The four review comments you addressed in 9dcdbd2 are marked resolved in the report: finding 1 (direct key access), finding 6 (DynamicClient typing), finding 7 (teardown guard), and finding 8 (CDI rollback).

One item is still open: finding 5 (README misses the --toehold flag). The current README.md now has a "Toehold (Copy Appliance) Runs" section at lines 443-470 that covers the flag, the toehold provider block, and the flag/provider mismatch. The finding's premise that the README is unchanged looks stale. If you agree, you can dismiss finding 5 from the Qodo report. I haven't dismissed it, since you didn't ask me to.

@qodo-code-review

Copy link
Copy Markdown

The following review comments were reviewed and a decision was made:

utilities/toehold.py:270 (qodo rule violation) — Image rollout polling copied in two places

Addressed: Addressed in 9dcdbd2: extracted _wait_for_deployment_image(deployment, expected_image, timeout) — both _wait_for_controller_rollout and _wait_for_cdi_rollout now call it, so the polling logic lives in one place.

conftest.py:160 (qodo rule violation) — README misses the new --toehold flag

Addressed: Addressed in 9dcdbd2: README.md now has a 'Toehold (Copy Appliance) Runs' section documenting the --toehold flag, the dedicated toehold provider entry, the mismatch fail-fast, the mtv-api-tests run forwarding, and the cluster-exclusivity caveat, with a link to the docs provider-config page.

conftest.py:598 (qodo bug) — Pool runs can use the wrong transfer path

Addressed: Addressed in 9dcdbd2: pool-selected providers are now checked in selected_source_provider via _verify_pool_provider_toehold_agreement — --toehold with pool selection fails fast (setup is attached at collection, before pool selection), and a pool-selected toehold provider without the flag fails fast too. Documented in the --toehold option table.

conftest.py:160 (qodo bug) — The suite command cannot enable toehold

Addressed: Addressed in 9dcdbd2: the mtv-api-tests run command now accepts and forwards --toehold to pytest (cli/mtv_api_tests run.py and init.py), so local runs via the suite command can select the copy appliance path. Documented in README.md and docs/automation-and-release.md.

Your message reads as a summary of decisions on four review comments, not a question, so here is where each stands against the code in this PR.

  • Finding 1 (required toehold keys read with .get()): resolved in 9dcdbd2. The presence check now uses direct indexing.
  • Finding 2 (image rollout polling duplicated): resolved in 9dcdbd2. Both rollout waits call _wait_for_deployment_image in utilities/toehold.py.
  • Finding 3 (pool runs can use the wrong transfer path): resolved in 9dcdbd2. _verify_pool_provider_toehold_agreement in conftest.py checks the pool-selected provider against --toehold.
  • Finding 4 (suite command cannot enable toehold): resolved in 9dcdbd2. The run CLI accepts --toehold and forwards it to pytest.
  • Finding 5 (README misses --toehold): the catalog still shows this as active, but the README now has a "Toehold (Copy Appliance) Runs" section (README.md:443-469) covering the flag and the toehold provider block. The catalog probably predates this change, so a fresh review should close it.

I haven't changed any findings. If you want finding 5 dismissed as addressed, say so and I'll dismiss it (PR author only).

Comment thread conftest.py Resolved
Comment thread cli/mtv_api_tests/run.py Resolved
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 9dcdbd2

@AmenB

AmenB commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

/qodo

The following review comments were reviewed and a decision was made:

conftest.py:160 (qodo rule violation) — README misses the new --toehold flag

Addressed: Addressed in ad2009e: the provider-configuration section of README.md now documents the vSphere toehold block (placement settings, base disk image, optional image overrides, dedicated-entry requirement, --toehold flag pairing) alongside the other per-provider keys, with links to the Toehold runs section and the providers-format docs page. The flag and run examples were already documented in the 'Toehold (Copy Appliance) Runs' section from 9dcdbd2.

@redhat-qe-bot2

Copy link
Copy Markdown

⚠️ CI checks were skipped because this pull request has merge conflicts.

Please resolve the conflicts (rebase/merge) — checks will run automatically on your next push.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit ad2009e

@qodo-code-review

Copy link
Copy Markdown

The following review comments were reviewed and a decision was made:

conftest.py:160 (qodo rule violation) — README misses the new --toehold flag

Addressed: Addressed in ad2009e: the provider-configuration section of README.md now documents the vSphere toehold block (placement settings, base disk image, optional image overrides, dedicated-entry requirement, --toehold flag pairing) alongside the other per-provider keys, with links to the Toehold runs section and the providers-format docs page. The flag and run examples were already documented in the 'Toehold (Copy Appliance) Runs' section from 9dcdbd2.

Your note checks out: README.md now documents the toehold setup, so finding 7 (README misses the new --toehold flag) is no longer accurate.

  • Provider block: lines 207–215 describe the toehold block under the vSphere provider-configuration section. They cover the dedicated-entry requirement, the --toehold pairing, and the mismatch usage error.
  • Run instructions: lines 464–480 show uv run pytest ... --toehold --tc=source_provider:... and list the requirements (dedicated provider entry, no concurrent migration tests during a toehold run).

The published report still lists finding 7 as active because it predates ad2009e. I haven't changed its status. If you want the report refreshed, ask me to rerun the review. If you agree the finding is resolved, the PR author can dismiss it from the Qodo link on that finding.

@redhat-qe-bot1

Copy link
Copy Markdown

⚠️ CI checks were skipped because this pull request has merge conflicts.

Please resolve the conflicts (rebase/merge) — checks will run automatically on your next push.

@AmenB

AmenB commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

/qodo Regarding the 'README misses the new --toehold flag' finding: README.md was updated in commit 9dcdbd2 (new 'Toehold (Copy Appliance) Runs' section documenting the flag, run examples, and the dedicated toehold provider entry) and again in commit ad2009e (the provider-configuration section now documents the vSphere toehold block alongside copyoffload/luks_passphrase and the other per-provider keys). Both the flag and the provider block are documented in the root README. Could you re-check against these commits and let us know if any specific README section is still missing the toehold documentation?

@AmenB

AmenB commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

/qodo

The following review comments were reviewed and a decision was made:

utilities/toehold.py:169 (qodo rule violation) — Controller wait helper looks public

Addressed: addressed — fixed in 6692ac8: the helper is now private (_wait_for_forklift_controller_running) with both call sites in patch_forklift_controller and restore_forklift_controller updated, matching its module-internal scope.

conftest.py:669 (qodo bug) — Setup plans omit appliance preparation

Addressed: addressed — fixed in 753f379: the toehold fixture attach is outside the is_dry_run block, so --setup-plan --toehold reports it; append() (not insert(0)) keeps base_resource_name ahead of the toehold chain.

utilities/toehold.py:651 (qodo bug) — Secrets-wait docstring lists errors it never raises

Addressed: addressed — fixed in f7ffdac: the ValueError entry is gone from _wait_for_provider_copy_appliance_secrets' Raises; the name-length and leftover checks live in copy_appliance_template_name / assert_copy_appliance_template_absent.

conftest.py:1272 (qodo rule violation) — vSphere-only rules sit in shared conftest

Addressed: addressed — fixed pre-rebase: the vSphere gate and the copyAppliance settings patch live in utilities/toehold.py; conftest only delegates.

@qodo-code-review

Copy link
Copy Markdown

The following review comments were reviewed and a decision was made:

utilities/toehold.py:169 (qodo rule violation) — Controller wait helper looks public

Addressed: addressed — fixed in 6692ac8: the helper is now private (_wait_for_forklift_controller_running) with both call sites in patch_forklift_controller and restore_forklift_controller updated, matching its module-internal scope.

conftest.py:669 (qodo bug) — Setup plans omit appliance preparation

Addressed: addressed — fixed in 753f379: the toehold fixture attach is outside the is_dry_run block, so --setup-plan --toehold reports it; append() (not insert(0)) keeps base_resource_name ahead of the toehold chain.

utilities/toehold.py:651 (qodo bug) — Secrets-wait docstring lists errors it never raises

Addressed: addressed — fixed in f7ffdac: the ValueError entry is gone from _wait_for_provider_copy_appliance_secrets' Raises; the name-length and leftover checks live in copy_appliance_template_name / assert_copy_appliance_template_absent.

conftest.py:1272 (qodo rule violation) — vSphere-only rules sit in shared conftest

Addressed: addressed — fixed pre-rebase: the vSphere gate and the copyAppliance settings patch live in utilities/toehold.py; conftest only delegates.

The message you posted reads as a status update rather than a question, so I checked the claimed fixes against the checked-out code.

  • Controller wait helper (finding 9, 923e11d6): Confirmed. utilities/toehold.py:169 now defines _wait_for_forklift_controller_running, and both call sites (:159 and :249) use the private name.
  • Setup plans omit appliance preparation (finding 10, dde2dc9d): Not confirmed. toehold_pre_setup does not appear anywhere under /pr_repo, so the checkout may not match the commit you describe.
  • Secrets-wait docstring (finding 49, fc485582): Not confirmed. I did not inspect the exact docstring for _wait_for_provider_copy_appliance_secrets.
  • vSphere-only rules in conftest (finding 53, e0e5099d): Not confirmed. toehold_pre_setup is absent from conftest.py, so I could not verify the move to utilities/toehold.py.

The published catalog still lists 923e11d6, dde2dc9d, fc485582, and e0e5099d as active. Those statuses will only change after a new review runs. If you point me to the commit you're looking at, I can check those specific lines.

Comment thread utilities/provider_inventory.py Resolved
Comment thread utilities/toehold.py Resolved
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 6692ac8

@AmenB

AmenB commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

/qodo

The following review comments were reviewed and a decision was made:

utilities/provider_inventory.py:369 (qodo bug) — Cloned VM setup crashes on null NICs

Addressed: addressed — fixed in bd75503: same fix as the line-372 reply: null nics is treated as not-yet-converged instead of crashing the setup.

utilities/toehold.py:437 (qodo bug) — Another appliance template can be deleted

Addressed: addressed — fixed in bd75503: same fix as the line-440 reply: the fixed template name is created with adopt_on_conflict=False, closing the race with the provider controller or another actor.

conftest.py:669 (qodo bug) — Setup plans omit appliance preparation

Addressed: addressed — fixed in 753f379: the toehold fixture attach is outside the is_dry_run block, so --setup-plan --toehold reports it; append() (not insert(0)) keeps base_resource_name ahead of the toehold chain.

utilities/toehold.py:651 (qodo bug) — Secrets-wait docstring lists errors it never raises

Addressed: addressed — fixed in f7ffdac: the ValueError entry is gone from _wait_for_provider_copy_appliance_secrets' Raises; the name-length and leftover checks live in copy_appliance_template_name / assert_copy_appliance_template_absent.

conftest.py:1272 (qodo rule violation) — vSphere-only rules sit in shared conftest

Addressed: addressed — fixed pre-rebase: the vSphere gate and the copyAppliance settings patch live in utilities/toehold.py; conftest only delegates.

@qodo-code-review

Copy link
Copy Markdown

The following review comments were reviewed and a decision was made:

utilities/provider_inventory.py:369 (qodo bug) — Cloned VM setup crashes on null NICs

Addressed: addressed — fixed in bd75503: same fix as the line-372 reply: null nics is treated as not-yet-converged instead of crashing the setup.

utilities/toehold.py:437 (qodo bug) — Another appliance template can be deleted

Addressed: addressed — fixed in bd75503: same fix as the line-440 reply: the fixed template name is created with adopt_on_conflict=False, closing the race with the provider controller or another actor.

conftest.py:669 (qodo bug) — Setup plans omit appliance preparation

Addressed: addressed — fixed in 753f379: the toehold fixture attach is outside the is_dry_run block, so --setup-plan --toehold reports it; append() (not insert(0)) keeps base_resource_name ahead of the toehold chain.

utilities/toehold.py:651 (qodo bug) — Secrets-wait docstring lists errors it never raises

Addressed: addressed — fixed in f7ffdac: the ValueError entry is gone from _wait_for_provider_copy_appliance_secrets' Raises; the name-length and leftover checks live in copy_appliance_template_name / assert_copy_appliance_template_absent.

conftest.py:1272 (qodo rule violation) — vSphere-only rules sit in shared conftest

Addressed: addressed — fixed pre-rebase: the vSphere gate and the copyAppliance settings patch live in utilities/toehold.py; conftest only delegates.

Thanks for the update. I read it as a status note on five review threads, not a question, so I haven't changed anything.

The five findings are still active in the findings catalog:

  • finding 9: Cloned VM setup crashes on null NICs (utilities/provider_inventory.py:369). Your reply says null nics is now treated as not-yet-converged.
  • finding 10: Another appliance template can be deleted (utilities/toehold.py:437). Your reply says the template is now created with adopt_on_conflict=False.
  • finding 11: Setup plans omit appliance preparation (conftest.py:669). Your reply says the toehold fixture attach moved outside the is_dry_run block.
  • finding 51: Secrets-wait docstring lists errors it never raises (utilities/toehold.py:651). Your reply says the ValueError entry was removed.
  • finding 53: vSphere-only rules sit in shared conftest (conftest.py:1272). Your reply says the gate and settings patch moved into utilities/toehold.py.

I didn't re-read the code to confirm those fixes in this turn. The catalog status won't change until a new review runs. If you want, I can:

  • Start a fresh review of the PR so these findings can be re-evaluated against the latest commits.
  • Explain any of these five findings in more detail.
  • Dismiss any of them, if you're the PR author and tell me which ones to close.

Comment thread conftest.py Resolved
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit bd75503

@AmenB

AmenB commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

/qodo

The following review comments were reviewed and a decision was made:

conftest.py:699 (qodo bug) — Some plan checks validate the wrong path

Addressed: addressed — fixed in e67b028: took the exclusion route: new _TOEHOLD_OWN_PROVIDER_FIXTURES ({ca_crt_source_provider, insecure_source_provider}) — items whose fixturenames intersect it get a collection-time skip marker and no toehold fixture attach, so their Plan readiness checks can no longer be reported as appliance-path coverage. The appliance is not prepared for providers the setup never sees.

utilities/provider_inventory.py:369 (qodo bug) — Cloned VM setup crashes on null NICs

Addressed: addressed — fixed in bd75503: the MAC checker iterates vm.get("nics") or [], so a present-but-null nics list during a forced refresh is treated as not-yet-converged instead of raising TypeError.

conftest.py:669 (qodo bug) — Setup plans omit appliance preparation

Addressed: addressed — fixed in 753f379: the toehold fixture attach is outside the is_dry_run block, so --setup-plan --toehold reports it; append() (not insert(0)) keeps base_resource_name ahead of the toehold chain.

cli/mtv_api_tests/run.py:210 (qodo rule violation) — Generic runner hardcodes toehold flag

Addressed: addressed — fixed in e67b028: _run_local no longer takes a feature-specific boolean: it takes extra_pytest_args: list[str] | None and appends them, and the caller builds ['--toehold'] if toehold else None. The shared launcher no longer branches on a feature flag, so a future run option does not need a new parameter threaded through it.

utilities/provider_inventory.py:148 (qodo rule violation) — Refresh counter declared mid-module

Addressed: addressed — fixed in e67b028: _last_refresh_timestamp is declared in the module constants block alongside _INVENTORY_REFRESH_READY_TIMEOUT/MAC_CONVERGENCE* instead of mid-module; behaviour unchanged.

utilities/toehold.py:651 (qodo bug) — Secrets-wait docstring lists errors it never raises

Addressed: addressed — fixed in f7ffdac: the ValueError entry is gone from _wait_for_provider_copy_appliance_secrets' Raises; the name-length and leftover checks live in copy_appliance_template_name / assert_copy_appliance_template_absent.

conftest.py:1272 (qodo rule violation) — vSphere-only rules sit in shared conftest

Addressed: addressed — fixed pre-rebase: the vSphere gate and the copyAppliance settings patch live in utilities/toehold.py; conftest only delegates.

@qodo-code-review

Copy link
Copy Markdown

The following review comments were reviewed and a decision was made:

conftest.py:699 (qodo bug) — Some plan checks validate the wrong path

Addressed: addressed — fixed in e67b028: took the exclusion route: new _TOEHOLD_OWN_PROVIDER_FIXTURES ({ca_crt_source_provider, insecure_source_provider}) — items whose fixturenames intersect it get a collection-time skip marker and no toehold fixture attach, so their Plan readiness checks can no longer be reported as appliance-path coverage. The appliance is not prepared for providers the setup never sees.

utilities/provider_inventory.py:369 (qodo bug) — Cloned VM setup crashes on null NICs

Addressed: addressed — fixed in bd75503: the MAC checker iterates vm.get("nics") or [], so a present-but-null nics list during a forced refresh is treated as not-yet-converged instead of raising TypeError.

conftest.py:669 (qodo bug) — Setup plans omit appliance preparation

Addressed: addressed — fixed in 753f379: the toehold fixture attach is outside the is_dry_run block, so --setup-plan --toehold reports it; append() (not insert(0)) keeps base_resource_name ahead of the toehold chain.

cli/mtv_api_tests/run.py:210 (qodo rule violation) — Generic runner hardcodes toehold flag

Addressed: addressed — fixed in e67b028: _run_local no longer takes a feature-specific boolean: it takes extra_pytest_args: list[str] | None and appends them, and the caller builds ['--toehold'] if toehold else None. The shared launcher no longer branches on a feature flag, so a future run option does not need a new parameter threaded through it.

utilities/provider_inventory.py:148 (qodo rule violation) — Refresh counter declared mid-module

Addressed: addressed — fixed in e67b028: _last_refresh_timestamp is declared in the module constants block alongside _INVENTORY_REFRESH_READY_TIMEOUT/MAC_CONVERGENCE* instead of mid-module; behaviour unchanged.

utilities/toehold.py:651 (qodo bug) — Secrets-wait docstring lists errors it never raises

Addressed: addressed — fixed in f7ffdac: the ValueError entry is gone from _wait_for_provider_copy_appliance_secrets' Raises; the name-length and leftover checks live in copy_appliance_template_name / assert_copy_appliance_template_absent.

conftest.py:1272 (qodo rule violation) — vSphere-only rules sit in shared conftest

Addressed: addressed — fixed pre-rebase: the vSphere gate and the copyAppliance settings patch live in utilities/toehold.py; conftest only delegates.

Your last message lists seven review comments and the fixes you say you made. Here is how they map to the published report, with the catalog status and what I found in the checkout:

  • finding 9 (plan checks validate the wrong path, conftest.py:699): the exclusion set _TOEHOLD_OWN_PROVIDER_FIXTURES is in conftest.py:618 and used at conftest.py:692. The catalog still shows it active.
  • finding 10 (cloned VM setup crashes on null NICs, utilities/provider_inventory.py:369): the checker now uses vm.get("nics") or [] (utilities/provider_inventory.py:362). The catalog still shows it active.
  • finding 11 (setup plans omit appliance preparation, conftest.py:669): I did not check the fixture attachment, so I can't confirm this one from the checkout. The catalog still shows it active.
  • finding 51 (generic runner hardcodes toehold flag, cli/mtv_api_tests/run.py:210): I did not check this one. The catalog still shows it active.
  • finding 52 (refresh counter declared mid-module, utilities/provider_inventory.py:148): I did not check this one. The catalog still shows it active.
  • finding 53 (secrets-wait docstring lists errors it never raises, utilities/toehold.py:651): I did not check this one. The catalog still shows it active.
  • finding 54 (vSphere-only rules sit in shared conftest, conftest.py:1272): I did not check this one. The catalog still shows it active.

The catalog statuses only change when the findings are re-evaluated or closed. Your replies don't close them. I haven't dismissed anything, since you didn't ask me to.

I can:

  • Check the remaining findings (11, 51–54) against the checkout.
  • Dismiss the findings you want closed, if you're the PR author and tell me which ones.
  • Re-run the review with start_agentic_review so the catalog reflects the new commits.

Comment thread conftest.py Resolved
Comment thread utilities/resources.py Resolved
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit e67b028

@AmenB

AmenB commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

/qodo

The following review comments were reviewed and a decision was made:

conftest.py:1386 (qodo rule violation) — Test config holds toehold setup logic

Addressed: addressed — fixed in 374e8d3: same fix as the line-1387 reply: the dataclass and the apply/restore helpers live in utilities/toehold.py; conftest contains fixtures and hooks only.

utilities/resources.py:66 (qodo rule violation) — Callers lose the original conflict error type

Addressed: addressed — fixed in 374e8d3: same fix as the line-69 reply: the ValueError is raised from the caught ConflictError, preserving the exception chain.

conftest.py:669 (qodo bug) — Setup plans omit appliance preparation

Addressed: addressed — fixed in 753f379: the toehold fixture attach is outside the is_dry_run block, so --setup-plan --toehold reports it; append() (not insert(0)) keeps base_resource_name ahead of the toehold chain.

conftest.py:618 (qodo rule violation) — Toehold constant defined below a function

Addressed: addressed — fixed in 374e8d3: _TOEHOLD_OWN_PROVIDER_FIXTURES moved into the constants block above the first function instead of sitting after pytest_unconfigure.

utilities/toehold.py:651 (qodo bug) — Secrets-wait docstring lists errors it never raises

Addressed: addressed — fixed in f7ffdac: the ValueError entry is gone from _wait_for_provider_copy_appliance_secrets' Raises; the name-length and leftover checks live in copy_appliance_template_name / assert_copy_appliance_template_absent.

cli/mtv_api_tests/run.py:210 (qodo rule violation) — Generic runner hardcodes toehold flag

Addressed: addressed — fixed in e67b028: _run_local takes extra_pytest_args: list[str] | None instead of a feature-specific boolean, and the caller builds ['--toehold'] if toehold else None.

utilities/provider_inventory.py:148 (qodo rule violation) — Refresh counter declared mid-module

Addressed: addressed — fixed in e67b028: _last_refresh_timestamp is declared in the module constants block with _INVENTORY_REFRESH_READY_TIMEOUT/MAC_CONVERGENCE*.

conftest.py:1272 (qodo rule violation) — vSphere-only rules sit in shared conftest

Addressed: addressed — fixed pre-rebase: the vSphere gate and the copyAppliance settings patch live in utilities/toehold.py; conftest only delegates.

@qodo-code-review

Copy link
Copy Markdown

The following review comments were reviewed and a decision was made:

conftest.py:1386 (qodo rule violation) — Test config holds toehold setup logic

Addressed: addressed — fixed in 374e8d3: same fix as the line-1387 reply: the dataclass and the apply/restore helpers live in utilities/toehold.py; conftest contains fixtures and hooks only.

utilities/resources.py:66 (qodo rule violation) — Callers lose the original conflict error type

Addressed: addressed — fixed in 374e8d3: same fix as the line-69 reply: the ValueError is raised from the caught ConflictError, preserving the exception chain.

conftest.py:669 (qodo bug) — Setup plans omit appliance preparation

Addressed: addressed — fixed in 753f379: the toehold fixture attach is outside the is_dry_run block, so --setup-plan --toehold reports it; append() (not insert(0)) keeps base_resource_name ahead of the toehold chain.

conftest.py:618 (qodo rule violation) — Toehold constant defined below a function

Addressed: addressed — fixed in 374e8d3: _TOEHOLD_OWN_PROVIDER_FIXTURES moved into the constants block above the first function instead of sitting after pytest_unconfigure.

utilities/toehold.py:651 (qodo bug) — Secrets-wait docstring lists errors it never raises

Addressed: addressed — fixed in f7ffdac: the ValueError entry is gone from _wait_for_provider_copy_appliance_secrets' Raises; the name-length and leftover checks live in copy_appliance_template_name / assert_copy_appliance_template_absent.

cli/mtv_api_tests/run.py:210 (qodo rule violation) — Generic runner hardcodes toehold flag

Addressed: addressed — fixed in e67b028: _run_local takes extra_pytest_args: list[str] | None instead of a feature-specific boolean, and the caller builds ['--toehold'] if toehold else None.

utilities/provider_inventory.py:148 (qodo rule violation) — Refresh counter declared mid-module

Addressed: addressed — fixed in e67b028: _last_refresh_timestamp is declared in the module constants block with _INVENTORY_REFRESH_READY_TIMEOUT/MAC_CONVERGENCE*.

conftest.py:1272 (qodo rule violation) — vSphere-only rules sit in shared conftest

Addressed: addressed — fixed pre-rebase: the vSphere gate and the copyAppliance settings patch live in utilities/toehold.py; conftest only delegates.

Thanks for the update. I checked one of the replies against the code, and it holds up:

  • Callers lose the original conflict error type (utilities/resources.py:62-66): the ValueError is raised from the caught ConflictError, so the exception chain is kept.

I did not re-verify the other replies line by line. conftest.py still has 36 toehold references, so the claim that it now holds only fixtures and hooks is worth a quick look.

The published report and findings list still show several items as active, including the ones you replied to (conftest.py:1386, utilities/resources.py:66, conftest.py:669, conftest.py:618, utilities/toehold.py:651, cli/mtv_api_tests/run.py:210, utilities/provider_inventory.py:148, conftest.py:1272). That is expected, because the report predates these commits. If you want the status refreshed, ask me to rerun the review and I'll start it.

Comment thread conftest.py Resolved
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 374e8d3

@AmenB

AmenB commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

/qodo

The following review comments were reviewed and a decision was made:

conftest.py:1386 (qodo rule violation) — Test config holds toehold setup logic

Addressed: addressed — fixed in 374e8d3: the state dataclass and apply/restore helpers live in utilities/toehold.py; conftest holds only the toehold_appliance fixture.

conftest.py:669 (qodo bug) — Setup plans omit appliance preparation

Addressed: addressed — fixed in 753f379: the toehold fixture attach is outside the is_dry_run block, so --setup-plan --toehold reports it; append() (not insert(0)) keeps base_resource_name ahead of the toehold chain.

conftest.py:18 (qodo bug) — Unused dataclass import added to conftest

Addressed: addressed — fixed in 40a0851: the unused from dataclasses import dataclass, field was removed — the dataclass now lives in utilities/toehold.py.

utilities/resources.py:63 (qodo rule violation) — Shared resource helper gains a toehold-only adoption flag

Addressed: addressed — fixed in 40a0851: the boolean is gone: create_and_store_resource() is unchanged again, and a separate explicit API create_new_and_store_resource() serves callers that own a fixed name (a conflict raises ValueError chained from ConflictError). The teardown-registration step is extracted into store_resource_for_teardown(), used by both, so there is no feature-specific branch in the shared helper.

utilities/toehold.py:651 (qodo bug) — Secrets-wait docstring lists errors it never raises

Addressed: addressed — fixed in f7ffdac: the ValueError entry is gone from _wait_for_provider_copy_appliance_secrets' Raises; the name-length and leftover checks live in copy_appliance_template_name / assert_copy_appliance_template_absent.

conftest.py:618 (qodo rule violation) — Toehold constant defined below a function

Addressed: addressed — fixed in 374e8d3: _TOEHOLD_OWN_PROVIDER_FIXTURES is in the constants block above the first function.

cli/mtv_api_tests/run.py:210 (qodo rule violation) — Generic runner hardcodes toehold flag

Addressed: addressed — fixed in e67b028: _run_local takes extra_pytest_args: list[str] | None instead of a feature-specific boolean.

utilities/provider_inventory.py:148 (qodo rule violation) — Refresh counter declared mid-module

Addressed: addressed — fixed in e67b028: _last_refresh_timestamp is declared in the module constants block.

conftest.py:1272 (qodo rule violation) — vSphere-only rules sit in shared conftest

Addressed: addressed — fixed pre-rebase: the vSphere gate and the copyAppliance settings patch live in utilities/toehold.py.

Comment thread utilities/resources.py Resolved
Comment thread utilities/resources.py Resolved
Comment thread utilities/toehold.py Resolved
Comment thread conftest.py Resolved
Comment thread conftest.py Resolved
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 40a0851

@AmenB

AmenB commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

/wip

@AmenB

AmenB commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

/qodo

The following review comments were reviewed and a decision was made:

conftest.py:1428 (qodo bug) — Teardown fails on a deleted provider

Addressed: addressed — fixed in b3740b1: same fix as the line-1430 reply: the provider-settings restore is skipped when the provider no longer exists.

utilities/toehold.py:231 (qodo rule violation) — Appliance sizing overrides are never set

Addressed: addressed — fixed in b3740b1: same fix as the line-234 reply: dead sizing overrides removed and the CDI keys are required (direct access).

utilities/resources.py:95 (qodo rule violation) — Template creation skips the shared helper

Addressed: addressed — fixed in b3740b1: same fix as the line-97 reply: one creation path, generic on_conflict policy, no second helper.

utilities/resources.py:96 (qodo rule violation) — Failed template deploy escapes teardown

Addressed: addressed — fixed in b3740b1: same fix as the line-98 reply: registration happens before deploy, so a failed existence wait cannot orphan the template.

conftest.py:693 (qodo bug) — Fallback tests miss direct transfer

Addressed: addressed — fixed in b3740b1: same fix as the line-696 reply: the fallback scenarios now carry vddk_baseline and are excluded from --toehold runs at collection time.

utilities/toehold.py:651 (qodo bug) — Secrets-wait docstring lists errors it never raises

Addressed: addressed — fixed in f7ffdac: the ValueError entry is gone from _wait_for_provider_copy_appliance_secrets' Raises.

conftest.py:618 (qodo rule violation) — Toehold constant defined below a function

Addressed: addressed — fixed in 374e8d3: _TOEHOLD_OWN_PROVIDER_FIXTURES is in the constants block above the first function.

cli/mtv_api_tests/run.py:210 (qodo rule violation) — Generic runner hardcodes toehold flag

Addressed: addressed — fixed in e67b028: _run_local takes extra_pytest_args instead of a feature-specific boolean.

utilities/provider_inventory.py:148 (qodo rule violation) — Refresh counter declared mid-module

Addressed: addressed — fixed in e67b028: _last_refresh_timestamp is declared in the module constants block.

conftest.py:1272 (qodo rule violation) — vSphere-only rules sit in shared conftest

Addressed: addressed — fixed pre-rebase: the vSphere gate and the copyAppliance settings patch live in utilities/toehold.py.

@qodo-code-review

Copy link
Copy Markdown

The following review comments were reviewed and a decision was made:

conftest.py:1428 (qodo bug) — Teardown fails on a deleted provider

Addressed: addressed — fixed in b3740b1: same fix as the line-1430 reply: the provider-settings restore is skipped when the provider no longer exists.

utilities/toehold.py:231 (qodo rule violation) — Appliance sizing overrides are never set

Addressed: addressed — fixed in b3740b1: same fix as the line-234 reply: dead sizing overrides removed and the CDI keys are required (direct access).

utilities/resources.py:95 (qodo rule violation) — Template creation skips the shared helper

Addressed: addressed — fixed in b3740b1: same fix as the line-97 reply: one creation path, generic on_conflict policy, no second helper.

utilities/resources.py:96 (qodo rule violation) — Failed template deploy escapes teardown

Addressed: addressed — fixed in b3740b1: same fix as the line-98 reply: registration happens before deploy, so a failed existence wait cannot orphan the template.

conftest.py:693 (qodo bug) — Fallback tests miss direct transfer

Addressed: addressed — fixed in b3740b1: same fix as the line-696 reply: the fallback scenarios now carry vddk_baseline and are excluded from --toehold runs at collection time.

utilities/toehold.py:651 (qodo bug) — Secrets-wait docstring lists errors it never raises

Addressed: addressed — fixed in f7ffdac: the ValueError entry is gone from _wait_for_provider_copy_appliance_secrets' Raises.

conftest.py:618 (qodo rule violation) — Toehold constant defined below a function

Addressed: addressed — fixed in 374e8d3: _TOEHOLD_OWN_PROVIDER_FIXTURES is in the constants block above the first function.

cli/mtv_api_tests/run.py:210 (qodo rule violation) — Generic runner hardcodes toehold flag

Addressed: addressed — fixed in e67b028: _run_local takes extra_pytest_args instead of a feature-specific boolean.

utilities/provider_inventory.py:148 (qodo rule violation) — Refresh counter declared mid-module

Addressed: addressed — fixed in e67b028: _last_refresh_timestamp is declared in the module constants block.

conftest.py:1272 (qodo rule violation) — vSphere-only rules sit in shared conftest

Addressed: addressed — fixed pre-rebase: the vSphere gate and the copyAppliance settings patch live in utilities/toehold.py.

Your latest message doesn't include a direct question, so here's where the review thread stands based on your replies and the findings catalog.

Replies you marked as addressed (fixed in b3740b1, f7ffdac, 374e8d3, e67b028, or before the rebase):

  • Teardown on a deleted provider (finding 1): the catalog shows it as implemented.
  • Appliance sizing overrides (finding 10): the catalog still shows it as active. Your reply says the dead overrides were removed and the CDI keys are now required.
  • Template creation through the shared helper (finding 11) and the failed-deploy teardown gap (finding 12): the catalog shows both as implemented.
  • Fallback tests missing direct transfer (finding 13): the catalog shows it as implemented. Your reply says these scenarios now carry vddk_baseline and are skipped under --toehold.
  • Secrets-wait docstring (finding 49): the catalog shows it as implemented.
  • Toehold constant placement (finding 50), generic runner flag (finding 51), refresh counter placement (finding 52), and vSphere-only rules in conftest (finding 53): your replies say these are fixed, but the catalog still lists all four as active. They may need a re-review to close.

If you meant something else, such as a specific finding, a re-review, or a fix, tell me which one and I'll act on it.

@AmenB

AmenB commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

/wip cancel

@AmenB

AmenB commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

/verified

@AmenB

AmenB commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

/verified cancel

@AmenB

AmenB commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

/wip

This branch has not been deployed

No deployments
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.

5 participants