feat(cli): migrate flow-run command to cyclopts (wave 3b)#20673
Draft
feat(cli): migrate flow-run command to cyclopts (wave 3b)#20673
Conversation
cc1b16f to
920a790
Compare
Native cyclopts implementation of all flow-run subcommands: inspect, ls, delete, cancel, retry, logs, execute. Includes the _get_flow_run_by_id_or_name helper for retry-by-name support. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
920a790 to
4219809
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Native cyclopts implementation of all
flow-runsubcommands, replacing the delegation stub that forwarded to typer.flow-runis an atomic unit — once registered as a native app, all subcommands must exist — so this includes all 7 commands in one PR (635 LOC, above the usual 500 target).What changed
src/prefect/cli/_cyclopts/flow_run.py— inspect, ls, delete, cancel, retry, logs, execute +_get_flow_run_by_id_or_namehelper"flow-run"from_DELEGATED_COMMANDS, added to_CYCLOPTS_COMMANDSmock_webbrowserfixture patcheswebbrowser.open_new_tabon the module directly (works for both import paths);deleteusesprefect.cli._prompts.confirminstead oftyper.confirmflow_run_appusesversion_flags=[],help_flags=["--help"]to prevent flag interceptionTest plan
uv run pytest tests/cli/test_flow_run.py— 73 passed, 1 skipped (typer)PREFECT_CLI_FAST=1 uv run pytest tests/cli/test_flow_run.py— 73 passed, 1 skipped (cyclopts)uv run pytest tests/cli/test_cyclopts_parity.py— 18 passed🤖 Generated with Claude Code