refactor: organize workflow CLI commands - #4673
Conversation
Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The reorganization leaves a documented source path stale and introduces a duplicate unreachable forwarder statement.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Reorganizes workflow CLI handlers, nested namespaces, domain modules, and tests to mirror the command hierarchy.
Changes:
- Moves 29 handlers into paired
command_<name>.pymodules. - Establishes singular
step,overlay, and nestedcatalogpackages. - Mirrors the new hierarchy in tests and documents bounded subdomains.
| File | Description |
|---|---|
design/cli.md |
Documents bounded nested subdomains. |
src/specify_cli/__init__.py |
Updates root handler exports. |
src/specify_cli/workflows/__init__.py |
Uses singular step package. |
src/specify_cli/workflows/_commands.py |
Centralizes shared CLI infrastructure and registration. |
src/specify_cli/workflows/_command_resume_state.py |
Extracts resume ownership resolution. |
src/specify_cli/workflows/_command_run_ownership.py |
Extracts run ownership resolution. |
src/specify_cli/workflows/engine.py |
Uses the singular overlay package. |
src/specify_cli/workflows/command_add.py |
Owns workflow add handling. |
src/specify_cli/workflows/command_disable.py |
Owns workflow disable handling. |
src/specify_cli/workflows/command_enable.py |
Owns workflow enable handling. |
src/specify_cli/workflows/command_info.py |
Owns workflow info handling. |
src/specify_cli/workflows/command_list.py |
Owns workflow list handling. |
src/specify_cli/workflows/command_remove.py |
Owns workflow removal handling. |
src/specify_cli/workflows/command_resolve.py |
Owns workflow resolution handling. |
src/specify_cli/workflows/command_resume.py |
Owns workflow resume handling. |
src/specify_cli/workflows/command_run.py |
Owns workflow run handling. |
src/specify_cli/workflows/command_search.py |
Owns workflow search handling. |
src/specify_cli/workflows/command_status.py |
Owns workflow status handling. |
src/specify_cli/workflows/command_update.py |
Owns workflow update handling. |
src/specify_cli/workflows/catalog/__init__.py |
Registers catalog commands and compatibility exports. |
src/specify_cli/workflows/catalog/_domain.py |
Houses workflow catalog domain logic. |
src/specify_cli/workflows/catalog/command_add.py |
Owns catalog add handling. |
src/specify_cli/workflows/catalog/command_list.py |
Owns catalog list handling. |
src/specify_cli/workflows/catalog/command_remove.py |
Owns catalog removal handling. |
src/specify_cli/workflows/overlay/__init__.py |
Registers overlay commands and domain exports. |
src/specify_cli/workflows/overlay/command_add.py |
Owns overlay add handling. |
src/specify_cli/workflows/overlay/command_disable.py |
Owns overlay disable handling. |
src/specify_cli/workflows/overlay/command_enable.py |
Owns overlay enable handling. |
src/specify_cli/workflows/overlay/command_list.py |
Owns overlay list handling. |
src/specify_cli/workflows/overlay/command_remove.py |
Owns overlay removal handling. |
src/specify_cli/workflows/overlay/command_set_priority.py |
Owns priority updates. |
src/specify_cli/workflows/overlay/composer.py |
Moves overlay composition logic. |
src/specify_cli/workflows/overlay/layer_sources.py |
Moves overlay source logic. |
src/specify_cli/workflows/overlay/merge.py |
Moves overlay merge logic. |
src/specify_cli/workflows/overlay/operations.py |
Separates overlay domain operations. |
src/specify_cli/workflows/overlay/resolver.py |
Moves workflow overlay resolution. |
src/specify_cli/workflows/overlay/schema.py |
Moves overlay schema validation. |
src/specify_cli/workflows/step/__init__.py |
Registers the step namespace. |
src/specify_cli/workflows/step/_helpers.py |
Centralizes step command safeguards. |
src/specify_cli/workflows/step/command_add.py |
Owns step add handling. |
src/specify_cli/workflows/step/command_info.py |
Owns step info handling. |
src/specify_cli/workflows/step/command_list.py |
Owns step list handling. |
src/specify_cli/workflows/step/command_remove.py |
Owns step removal handling. |
src/specify_cli/workflows/step/command_search.py |
Owns step search handling. |
src/specify_cli/workflows/step/catalog/__init__.py |
Registers step-catalog commands and exports. |
src/specify_cli/workflows/step/catalog/_domain.py |
Houses step-catalog domain logic. |
src/specify_cli/workflows/step/catalog/command_add.py |
Owns step-catalog add handling. |
src/specify_cli/workflows/step/catalog/command_list.py |
Owns step-catalog list handling. |
src/specify_cli/workflows/step/catalog/command_remove.py |
Owns step-catalog removal handling. |
src/specify_cli/workflows/step/command/__init__.py |
Relocates the command step. |
src/specify_cli/workflows/step/do_while/__init__.py |
Relocates the do-while step. |
src/specify_cli/workflows/step/fan_in/__init__.py |
Relocates the fan-in step. |
src/specify_cli/workflows/step/fan_out/__init__.py |
Relocates the fan-out step. |
src/specify_cli/workflows/step/gate/__init__.py |
Relocates the gate step. |
src/specify_cli/workflows/step/if_then/__init__.py |
Relocates the conditional step. |
src/specify_cli/workflows/step/init/__init__.py |
Relocates the init step. |
src/specify_cli/workflows/step/prompt/__init__.py |
Relocates the prompt step. |
src/specify_cli/workflows/step/shell/__init__.py |
Relocates the shell step. |
src/specify_cli/workflows/step/slot/__init__.py |
Relocates the slot step. |
src/specify_cli/workflows/step/switch/__init__.py |
Relocates the switch step. |
src/specify_cli/workflows/step/while_loop/__init__.py |
Relocates the while step. |
src/specify_cli/workflows/steps/__init__.py |
Removes the obsolete plural package. |
tests/test_commands_package.py |
Updates the step import path. |
tests/unit/test_condition_expression_block.py |
Updates control-step imports. |
tests/workflows/test_overlay_composer.py |
Updates overlay imports. |
tests/workflows/test_overlay_layer_sources.py |
Updates overlay imports. |
tests/workflows/test_overlay_merge.py |
Updates overlay imports. |
tests/workflows/test_overlay_schema.py |
Updates overlay imports. |
tests/workflows/test_resolver_integration.py |
Updates resolver imports. |
tests/workflows/test_slot_step.py |
Updates step and overlay imports. |
tests/specify_cli/workflows/__init__.py |
Defines the workflow test package. |
tests/specify_cli/workflows/conftest.py |
Provides shared workflow fixtures. |
tests/specify_cli/workflows/helpers.py |
Provides shared workflow helpers. |
tests/specify_cli/workflows/test_command_add.py |
Mirrors workflow-add coverage. |
tests/specify_cli/workflows/test_command_disable.py |
Mirrors disable coverage. |
tests/specify_cli/workflows/test_command_enable.py |
Covers workflow enable behavior. |
tests/specify_cli/workflows/test_command_info.py |
Covers workflow info rendering. |
tests/specify_cli/workflows/test_command_list.py |
Covers workflow list behavior. |
tests/specify_cli/workflows/test_command_remove.py |
Mirrors removal coverage. |
tests/specify_cli/workflows/test_command_resolve.py |
Covers workflow resolution. |
tests/specify_cli/workflows/test_command_resume.py |
Mirrors resume coverage. |
tests/specify_cli/workflows/test_command_resume_state.py |
Covers resume ownership safeguards. |
tests/specify_cli/workflows/test_command_run.py |
Mirrors run coverage. |
tests/specify_cli/workflows/test_command_run_ownership.py |
Covers run ownership safeguards. |
tests/specify_cli/workflows/test_command_search.py |
Covers workflow search behavior. |
tests/specify_cli/workflows/test_command_status.py |
Mirrors status coverage. |
tests/specify_cli/workflows/test_command_update.py |
Mirrors update coverage. |
tests/specify_cli/workflows/catalog/__init__.py |
Defines workflow-catalog tests. |
tests/specify_cli/workflows/catalog/test_command_add.py |
Covers catalog addition. |
tests/specify_cli/workflows/catalog/test_command_list.py |
Covers catalog listing. |
tests/specify_cli/workflows/catalog/test_command_remove.py |
Covers catalog removal. |
tests/specify_cli/workflows/overlay/__init__.py |
Defines overlay command tests. |
tests/specify_cli/workflows/overlay/test_command_add.py |
Mirrors overlay-add coverage. |
tests/specify_cli/workflows/overlay/test_command_disable.py |
Covers overlay disabling. |
tests/specify_cli/workflows/overlay/test_command_enable.py |
Covers overlay validation. |
tests/specify_cli/workflows/overlay/test_command_list.py |
Covers overlay listing. |
tests/specify_cli/workflows/overlay/test_command_remove.py |
Covers overlay removal. |
tests/specify_cli/workflows/overlay/test_command_set_priority.py |
Covers priority updates. |
tests/specify_cli/workflows/step/__init__.py |
Defines step command tests. |
tests/specify_cli/workflows/step/test_command_add.py |
Mirrors step-add coverage. |
tests/specify_cli/workflows/step/test_command_info.py |
Covers step info rendering. |
tests/specify_cli/workflows/step/test_command_list.py |
Covers step listing. |
tests/specify_cli/workflows/step/test_command_remove.py |
Covers step removal. |
tests/specify_cli/workflows/step/test_command_search.py |
Covers step search. |
tests/specify_cli/workflows/step/catalog/__init__.py |
Defines step-catalog tests. |
tests/specify_cli/workflows/step/catalog/test_command_add.py |
Covers step-catalog addition. |
tests/specify_cli/workflows/step/catalog/test_command_list.py |
Covers step-catalog listing. |
tests/specify_cli/workflows/step/catalog/test_command_remove.py |
Covers step-catalog removal. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Posted on behalf of @mnriem by GitHub Copilot (model: GPT-5.6 Sol, autonomous); this comment was fully AI-drafted. Addressed the review findings in commit |
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The broad package and registration reorganization warrants final human review despite strong compatibility coverage and no identified defects.
Review effort: Balanced
Findings: 1
Resolved since last review (1)
|
Posted on behalf of @mnriem by GitHub Copilot (model: GPT-5.6 Sol, autonomous); this comment was fully AI-drafted. Review |

Summary
specify workflowcommand into its pairedcommand_<name>.pymodule while keeping shared registration and CLI infrastructure inworkflows/_commands.pyworkflow catalog,workflow step,workflow step catalog, andworkflow overlaynamespaces as mirrored packages, with thestepandoverlaybounded subdomains owning their focused domain modules at their hierarchy rootsdesign/cli.mdValidation
uvx ruff@0.15.0 check src tests: passedgit diff --check: passedspecify workflowhelp surface, including genuine nested namespaces: byte-identical before/afterworkflows/steps,workflows/overlays, and oldworkflows/catalog.pymodules absent_commands.py; no missing or duplicate registrationCompatibility note
The former plural
specify_cli.workflows.steps.*andspecify_cli.workflows.overlays.*paths were internal implementation paths and are intentionally replaced by the singular bounded-domain roots. Repository consumers and tests use the canonical paths; established public root handlers and workflow-catalog compatibility exports remain available.AI disclosure
Authored autonomously by GitHub Copilot (model: GPT-5.6 Sol) on behalf of @mnriem. The implementation, tests, validation, commit, conflict resolutions, and this pull request description were fully AI-generated.