Skip to content

CherryPicked: [v2.11] feat: add MTV operator upgrade/update migration testing (#487)#525

Merged
myakove merged 1 commit into
RedHatQE:v2.11from
krcmarik:CherryPicked-upgrade-Z8B39
May 29, 2026
Merged

CherryPicked: [v2.11] feat: add MTV operator upgrade/update migration testing (#487)#525
myakove merged 1 commit into
RedHatQE:v2.11from
krcmarik:CherryPicked-upgrade-Z8B39

Conversation

@krcmarik
Copy link
Copy Markdown
Contributor

  • feat: add MTV operator upgrade/update migration testing

Add upgrade test infrastructure:

  • test_upgrade_migration.py: incremental test class that creates migration resources, upgrades MTV operator, verifies post-upgrade state, and runs cold migration
  • utilities/upgrade.py: subprocess-based upgrade runner with fd 3 support for mtv-autodeploy logging, plus pod readiness and plan verification
  • Add @pytest.mark.upgrade to warm migration for post-upgrade warm test
  • Remove tier0 from cold migration (covered by upgrade test)
  • Add upgrade_script_path, mtv_upgrade_to_version, mtv_upgrade_to_source, mtv_upgrade_image_index config parameters
  • Add 'upgrade' marker to pytest.ini
  • Add MtvUpgradeError and ForkliftPodsNotRunningError exceptions

Remove redundant code and simplify upgrade test implementation:

  • Remove redundant wait_for_forklift_pods_ready call from post-upgrade test (upgrade script already handles this)
  • Remove test_verify_pre_upgrade_version test method (redundant with existing session-level validation)
  • Replace verify_plan_ready_after_upgrade() with standard plan.wait_for_condition() pattern
  • Remove _duplicate_stdout_to_fd3() fd3 hack, simplify subprocess call
  • Remove unused functions and their imports from utilities/upgrade.py
  • fix: add timeout guard to MTV upgrade subprocess

Bound the upgrade script execution with a 1-hour timeout to prevent indefinite hangs. Maps TimeoutExpired to MtvUpgradeError.

  • refactor: clone upgrade repo at test time via fixture

Replace CI-provided local script path with a session-scoped fixture that shallow-clones the upgrade repo to tmp_path. Config now takes repo URL, ref, and relative script path instead of an absolute path.

  • refactor: use gitpython for upgrade repo clone

Replace subprocess git clone with Repo.clone_from() and simplify clone directory setup by removing unnecessary subdirectory.

  • refactor: move upgrade resource creation to fixtures and remove config placeholders

Move StorageMap, NetworkMap, and Plan creation from test methods into class-scoped fixtures in conftest.py. The empty-string config placeholders (upgrade_repo_url, upgrade_repo_ref, etc.) were runtime-only --tc parameters, not test data — remove them and use .get() with validation in the fixture instead.

  • refactor: rename upgrade fixtures to pre_upgrade_* for clarity

  • add credential redaction, git runtime dep, and upgrade docs

Redact sensitive fields (password, token, thumbprint) in upgrade log output. Add git package to Dockerfile runtime stage for upgrade test branch operations. Document upgrade test usage in README.

* feat: add MTV operator upgrade/update migration testing

Add upgrade test infrastructure:
- test_upgrade_migration.py: incremental test class that creates migration
  resources, upgrades MTV operator, verifies post-upgrade state, and runs
  cold migration
- utilities/upgrade.py: subprocess-based upgrade runner with fd 3 support
  for mtv-autodeploy logging, plus pod readiness and plan verification
- Add @pytest.mark.upgrade to warm migration for post-upgrade warm test
- Remove tier0 from cold migration (covered by upgrade test)
- Add upgrade_script_path, mtv_upgrade_to_version, mtv_upgrade_to_source,
  mtv_upgrade_image_index config parameters
- Add 'upgrade' marker to pytest.ini
- Add MtvUpgradeError and ForkliftPodsNotRunningError exceptions

* fix: complete Generator type hint and remove unused fixture parameter

* fix: validate upgrade script path exists before execution

* Address PR RedHatQE#487 review comments for upgrade tests

Remove redundant code and simplify upgrade test implementation:
- Remove redundant wait_for_forklift_pods_ready call from post-upgrade
  test (upgrade script already handles this)
- Remove test_verify_pre_upgrade_version test method (redundant with
  existing session-level validation)
- Replace verify_plan_ready_after_upgrade() with standard
  plan.wait_for_condition() pattern
- Remove _duplicate_stdout_to_fd3() fd3 hack, simplify subprocess call
- Remove unused functions and their imports from utilities/upgrade.py

* fix: add timeout guard to MTV upgrade subprocess

Bound the upgrade script execution with a 1-hour timeout to prevent
indefinite hangs. Maps TimeoutExpired to MtvUpgradeError.

* refactor: clone upgrade repo at test time via fixture

Replace CI-provided local script path with a session-scoped fixture
that shallow-clones the upgrade repo to tmp_path. Config now takes
repo URL, ref, and relative script path instead of an absolute path.

* refactor: use gitpython for upgrade repo clone

Replace subprocess git clone with Repo.clone_from() and simplify
clone directory setup by removing unnecessary subdirectory.

* refactor: move upgrade resource creation to fixtures and remove config placeholders

Move StorageMap, NetworkMap, and Plan creation from test methods into
class-scoped fixtures in conftest.py. The empty-string config placeholders
(upgrade_repo_url, upgrade_repo_ref, etc.) were runtime-only --tc
parameters, not test data — remove them and use .get() with validation
in the fixture instead.

* refactor: rename upgrade fixtures to pre_upgrade_* for clarity

* add credential redaction, git runtime dep, and upgrade docs

Redact sensitive fields (password, token, thumbprint) in upgrade
log output. Add git package to Dockerfile runtime stage for
upgrade test branch operations. Document upgrade test usage
in README.
@qodo-code-review
Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • main

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

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: ebf01453-467f-4dcf-a7a6-a3b4ec3f9335

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@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 (approvers only)
  • /hold cancel - Unblock PR merging
  • /verified - Mark PR as verified
  • /verified cancel - Remove verification status
  • /reprocess - Trigger complete PR workflow reprocessing (useful if webhook failed or configuration changed)
  • /regenerate-welcome - Regenerate this welcome message

Review & Approval

  • /lgtm - Approve changes (looks good to me)
  • /approve - Approve PR (approvers only)
  • /automerge - Enable automatic merging when all requirements are met (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

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:

  • myakove
  • solenoci

Reviewers:

  • krcmarik
  • myakove
  • solenoci
Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve
  • automerge
AI Features
  • Conventional Title: Mode: fix (claude/claude-opus-4-6[1m])
  • Cherry-Pick Conflict Resolution: Enabled (claude/claude-opus-4-6[1m])
  • Test Oracle: Triggers: approved (cursor/gpt-5.4-xhigh-fast); /test-oracle can be used anytime

💡 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.

@myakove
Copy link
Copy Markdown
Collaborator

myakove commented May 29, 2026

/lgtm
/approve

@krcmarik
Copy link
Copy Markdown
Contributor Author

/verified

@myakove myakove merged commit f0212eb into RedHatQE:v2.11 May 29, 2026
7 checks passed
@redhat-qe-bot1
Copy link
Copy Markdown

New container for ghcr.io/redhatqe/mtv-api-tests:v2.11 published

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants