fix(task): resolve bare aliases in monorepo with config_roots#8819
fix(task): resolve bare aliases in monorepo with config_roots#8819
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements file-based task alias resolution for monorepo mode, updates the usage spec to include prefixed aliases for completion, and ensures tasks are loaded correctly when no path hint is provided. A review comment suggests adding an E2E test case to verify that bare aliases also resolve correctly from the monorepo root.
85a0135 to
4b36bbf
Compare
Greptile SummaryThis PR fixes two related bugs for monorepo alias resolution in mise:
Key changes:
Confidence Score: 5/5Safe to merge; the fix is targeted, consistent with existing patterns, and backed by both unit tests and e2e coverage. All remaining findings are P2 style/test-quality suggestions. The core logic change is a single-branch correction that brings No files require special attention — the e2e test's grep pattern (line 51) is the only minor point worth a follow-up. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["mise run prl"] --> B["expand_colon_task_syntax('prl')"]
B -->|"monorepo root"| C["'//:prl'"]
C --> D["TaskLoadContext::from_pattern('//:prl')"]
D --> E["extract_path_hint('//:prl')"]
E -->|"empty path → None"| F{"BEFORE fix"}
E -->|"empty path → None"| G{"AFTER fix"}
F -->|"load_all: false ❌"| H["config_roots skipped\nAlias never resolved"]
G -->|"load_all: true ✅"| I["All config_roots scanned"]
I --> J["Task '//:pr:list'\nwith alias 'prl' found"]
J --> K["build_task_ref_map creates\n'//:prl' → task\n'prl' → task"]
K --> L["get_matching('//:prl')\nfinds task ✅"]
subgraph Completion Fix
M["mise tasks --usage"] --> N["display_usage()"]
N --> O["extract_monorepo_path('//:pr:list')\n→ Some('')"]
O --> P["Append '//:prl' to aliases"]
P --> Q["usage spec contains '//:prl'\nfor shell completion ✅"]
end
Reviews (2): Last reviewed commit: "[autofix.ci] apply automated fixes" | Re-trigger Greptile |
When a bare alias like `prl` is used in a monorepo context, it gets expanded to `//:prl` via `expand_colon_task_syntax`. The resulting `TaskLoadContext::from_pattern` was setting `load_all=false`, which skipped config root task discovery — so the actual task was never loaded. Also adds monorepo-prefixed aliases to the usage spec so that tab completion works for patterns like `//:prl`. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
71b7ecc to
1e1f870
Compare
### 🚀 Features - add azd (Azure Developer CLI) to registry by @rajeshkamal5050 in [#8828](#8828) ### 🐛 Bug Fixes - **(aqua)** skip registry lookup for linked versions in list_bin_paths by @nikobockerman in [#8801](#8801) - **(rust)** handle rustup check exit code 100 as non-error by @shalk in [#8832](#8832) - **(task)** resolve bare aliases in monorepo with config_roots by @nkakouros in [#8819](#8819) - show usage help when long_about is defined w/o args/flags by @nkakouros in [#8824](#8824) ### 📚 Documentation - fix serif font in sidebar and increase heading sizes by @jdx in [#8831](#8831) - fix #vscode link in ide integration page by @jedymatt in [#8833](#8833) - fix nested Markdown code fences by @muzimuzhi in [#8835](#8835) ### New Contributors - @shalk made their first contribution in [#8832](#8832) - @jedymatt made their first contribution in [#8833](#8833) - @nikobockerman made their first contribution in [#8801](#8801) - @rajeshkamal5050 made their first contribution in [#8828](#8828) ## 📦 Aqua Registry Updates #### New Packages (2) - [`gastownhall/beads`](https://github.com/gastownhall/beads) - [`getdbt.com/dbt-fusion`](https://github.com/getdbt.com/dbt-fusion) #### Updated Packages (2) - [`Azure/azure-dev`](https://github.com/Azure/azure-dev) - [`magefile/mage`](https://github.com/magefile/mage)
Summary
prlis used in a monorepo,expand_colon_task_syntaxexpands it to//:prl.TaskLoadContext::from_patternwas then settingload_all=false, which skipped config root task discovery entirely, so the actual task (e.g.,//:pr:list) was never loaded and the alias couldn't resolve.//:prl<Tab>) also failed because the usage spec only registered bare aliases, not their//-prefixed forms.Before
After
All four variants work.
Test plan
test_task_file_alias_run: monorepo withconfig_roots=["."], bare/prefixed alias execution,multiple aliases, subproject aliases, usage spec verification
get_matchingwith alias and monorepo alias resolutiontest_task_monorepo_aliasesand all monorepo e2e tests still passcargo clippy --all-features --all-targets -- -D warningscleanmise run lintclean🤖 Generated with Claude Code