← Back to issue list

Simplify the Dispatcher usage

View original Github issue

Metadata

Project
craft-cli
Number
#56
Type
issue
State
open
Author
facundobatista
Labels
Status: Triaged Type: Refactor
Created
Updated
Closed
—

Current evaluation

Maintainer-filed refactor to simplify the Dispatcher's 3-step usage (pre_parse_args → load_command → run); two competing designs proposed, neither implemented yet.

Suggested action: keep open

Reason: The issue is maintainer-authored and explicitly triaged (labels 'Status: Triaged', 'Type: Refactor') with a tracked ticket CRAFT-4790, so it has been assessed and remains valid — age (1710 days) is not a reason to close. Verified it is not yet implemented: no `simple_run` exists anywhere in the repo, `docs/tutorials/run-a-command-application.rst:93-97` still documents all three calls, and `dispatcher.run()` still raises "Need to load the command (call 'load_command') before running it" (dispatcher.py:571-573), mirrored by tests at test_dispatcher.py:178/192. Confidence is capped because the proposal is under-specified: it offers two competing models (explicit `simple_run` vs. implicit auto-invocation) and concedes the method name is 'to be determined', with no follow-up comment recording a maintainer decision — the last activity379 days ago is only a Jira sync bot.

Evaluated by: mr-cal-bot

Impact: 42 Quick Win: 11 Complexity: 45 Confidence: 72 Actionability: 48

Issue body

Currently, before instantiaton, the following steps are needed: - `pre_parse_args`: will parse all arguments and return all global args, *very* useful for the app to react on custom global arguments - `load_command`: useful to pass the loaded app config - `run`: finally run the command We could have a more simple usage. Two models are described below: **The explicit one:** Let's provide a `simple_run` method (name to be determined) that will be the equivalent to: ``` dispatcher.pre_parse_args(sys.argv[1:]) # sys.argv usage by default, and no use of returned global args dispatcher.load_command(None) # no app config passed dispatcher.run() ``` **The implicit one:** We can assume no special needs in the previous step, and run it implicitly in case it was not run explicitly before: - if the developer called `load_command` without calling `pre_parse_args` before, just call `pre_parse_args(sys.argv[1:])`. - if the developer called `run` without calling `load_command`, just call `load_command(None)` (which may trigger previous item too)

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 42
Quick Win: 11
Complexity: 45
Confidence: 72
Actionability: 48
keep open Maintainer-filed refactor to simplify the Dispatcher's 3-step usage (pre_parse_args → load_command → run); two competing designs proposed, neither implemented yet.
qwen/qwen3.6-35b-a3b
Impact: 35
Quick Win: 14
Complexity: 45
Confidence: 70
Actionability: 75
keep open Refactor to simplify the Dispatcher's three-step usage (pre_parse_args → load_command → run) into a simpler API, proposed two models: explicit simple_run method or implicit auto-calling.
qwen/qwen3.8-27b
Impact: 35
Quick Win: 16
Staleness: 55
Complexity: 55
Confidence: 70
Support Request: 5
keep open Refactor request to simplify craft-cli Dispatcher usage by adding a simple_run helper or implicit pre_parse_args/load_command calls before run. Triaged by maintainer, synced to internal ticket CRAFT-4790, but no code change implemented yet.
qwen/qwen3.6-35b-a3b
Staleness: 80
Complexity: 55
Confidence: 75
Support Request: 10
keep open Proposal to simplify the Dispatcher API by adding a simple_run method or implicit chaining of existing steps. Labeled as triaged refactor, but inactive for ~10 months with no maintainer discussion or decision.
qwen3.6-35b-a3b-mtp-q6
Staleness: 92
Complexity: 45
Confidence: 85
Support Request: 5
close stale Proposal to simplify Dispatcher usage by adding a simple_run method or making initialization steps implicit. Triaged as a refactor but inactive for over 9 months with no maintainer discussion or progress.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.