Skip to content

Fix support for multiple discover phases in upgrade execute plugin#4633

Merged
happz merged 3 commits into
mainfrom
tcornell-multi-discover-upgrade
Mar 4, 2026
Merged

Fix support for multiple discover phases in upgrade execute plugin#4633
happz merged 3 commits into
mainfrom
tcornell-multi-discover-upgrade

Conversation

@tcornell-bus

@tcornell-bus tcornell-bus commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

Extract task iterator logic for upgrade plugin into a dedicated tasks method following the same pattern as internal (tmt) execute.

Allow upgrade execute plugin to handle multiple discover phases by iterating through each phase when running tests before and after upgrade.

Fix test name restoration to occur per-phase to avoid iteration order issues.

Assisted-by: Cursor

Fixes: #3894

Pull Request Checklist

  • implement the feature
  • write the documentation
  • extend the test coverage
  • update the specification
  • adjust plugin docstring
  • mention the version
  • include a release note

@tcornell-bus tcornell-bus added step | execute Stuff related to the execute step plugin | upgrade The upgrade execute plugin labels Mar 2, 2026
@github-project-automation github-project-automation Bot moved this to backlog in planning Mar 2, 2026
@tcornell-bus tcornell-bus moved this from backlog to implement in planning Mar 2, 2026
Comment thread tests/execute/upgrade/main.fmf Outdated

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the task gathering logic in the execute step by introducing a gather_tasks method in ExecutePlugin, which is then implemented for both internal and upgrade executors. The upgrade executor is also updated to correctly handle multiple discover phases, ensuring test names are restored on a per-phase basis. The changes are well-tested and improve the modularity of the execution step. My feedback includes a suggestion to improve the robustness of state restoration in the upgrade plugin by using try...finally blocks.

Note: Security Review is unavailable for this PR.

Comment thread tmt/steps/execute/upgrade.py Outdated
Comment thread tmt/steps/execute/__init__.py Outdated
Comment thread tmt/steps/execute/upgrade.py Outdated
@tcornell-bus tcornell-bus moved this from implement to review in planning Mar 2, 2026
@tcornell-bus tcornell-bus added the ci | full test Pull request is ready for the full test execution label Mar 2, 2026
@psss psss added this to the 1.69 milestone Mar 3, 2026
@tcornell-bus

Copy link
Copy Markdown
Contributor Author

packit /test

@happz happz force-pushed the tcornell-multi-discover-upgrade branch from cf99977 to b2ba77b Compare March 3, 2026 14:22
Comment thread tmt/steps/execute/__init__.py Outdated
Comment thread tmt/steps/execute/__init__.py Outdated
Comment thread tmt/steps/execute/upgrade.py Outdated
Comment thread tmt/steps/execute/upgrade.py Outdated
Comment thread tmt/steps/execute/upgrade.py Outdated
execute plugin.

Extract task gathering logic for upgrade plugin into a
dedicated gather_tasks method following the same pattern as
internal (tmt) execute.

Allow upgrade execute plugin to handle multiple discover phases by
iterating through each phase when running tests before and after
upgrade.

Fix test name restoration to occur per-phase to avoid
iteration order issues.

Assisted-by: Cursor
Turned gather_tasks() into tasks() iterator
Moved child function docstrings for tasks() into the function body
Moved the extra discover phase to full.sh test to save time
Add TODOs decribing possible future refactors.
Fix the upgrade tests by making the extra-phase plan
its own plan.
@tcornell-bus tcornell-bus force-pushed the tcornell-multi-discover-upgrade branch from b2ba77b to 0502fee Compare March 3, 2026 17:51
@tcornell-bus tcornell-bus requested review from LecrisUT and happz March 3, 2026 18:47

@skycastlelily skycastlelily left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM,and all the tests passed locally :)

@LecrisUT LecrisUT left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great, thanks a lot for the context and trackers

@happz happz merged commit 24a111d into main Mar 4, 2026
31 checks passed
@happz happz deleted the tcornell-multi-discover-upgrade branch March 4, 2026 13:06
@github-project-automation github-project-automation Bot moved this from review to done in planning Mar 4, 2026
@psss psss removed their assignment Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci | full test Pull request is ready for the full test execution plugin | upgrade The upgrade execute plugin step | execute Stuff related to the execute step

Projects

Status: done

Development

Successfully merging this pull request may close these issues.

Support multiple discover phases in upgrade execute

5 participants