Repository navigation
One TOML task whose usage fails to load breaks completion of every task #15462
Unanswered
powerman
asked this question in
Troubleshooting and bug reports
Replies: 2 comments
|
Thanks for the detailed report; your code pointers were right on all three. A TOML task's usage error was fatal where a file task's Fix in #15465: a broken TOML-task spec now warns and uses an empty spec in AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: unavailable. |
0 replies
|
Implemented in #15465: fix(task): keep other tasks working when one TOML task's usage fails to load |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
When the
usageof one TOML task cannot be loaded, mise fails as a whole instead of skipping that task:mise run, falls back to files;mise tasks --usageandmise generate task-docsexit with an error;raw_args = true.A file task with a broken
#USAGEonly gets a warning and an empty spec, so the other tasks keep working and the task itself still runs.This happens with a missing
includefile, a spec that does not parse (e.g. because it uses a node or property from a newer usage version than the one built into mise), an undefined Tera variable, or$VARin an include path.kongusage (a Kong → usage spec exporter) documents
usage = 'include file="…generated.usage.kdl"'as one way to give a task its spec; a missing generated file (e.g. in a fresh clone) then breaks completion of every task of the project.The same
include file="{{ config_root }}/shared.usage.kdl"form is recommended in Share flags between tasks.Reproduce
The same happens with any of these instead of the
includeabove:For comparison, these do not affect other tasks:
mise-tasks/badfilewith#USAGE arg "<x" {{or#USAGE include file="$NOPE/x.kdl": a warning,--goodandgoodstill complete,and
mise run badfile xruns;usage = 'mount run="false"': only the completion ofbaditself falls back to files.Expected
The same as for a file task with a broken
#USAGE: completion,mise tasks --usageandmise generate task-docswarn about the broken task and use an empty spec for it, so every other task keeps working.A
raw_args = truetask does not need its spec to run, so it should run too.mise tasks validateshould still fail, as it does now.Versions
mainat8b83357 (usage-lib 7.3.0): identical results.
Code pointers (main @ 8b83357)
src/cli/tasks/ls.rs#L287-L295:display_usagepropagates the first task's error with?,so
mise tasks --usage(which completion mounts) fails as a whole.src/task/mod.rs#L2111-L2134:parse_usage_spec_for_display_innerwarns for a file task (parse_task_script_usage_or_warn)but returns the error for a TOML task (
parse_run_scripts_for_spec_only(...).await?).src/task/task_executor.rs#L3306-L3318:parse_usage_spec_and_init_envparses the spec with?before it checksshould_bypass_usage_parser(), although the spec is not used when the parser is bypassed.Related
tasks validatewhen a file task's #USAGE spec does not parse #13672:mise tasks validatebecame strict for a broken file-task#USAGE;this report keeps that, and asks for the lenient side elsewhere for TOML tasks.
fixed by skipping it, the same "one bad task must not break the rest" principle.
mise doctorAI-assisted — Tool: Claude Code; model: anthropic/claude-opus-5-5; version: 2.1.316.
All reactions