fix(task): resolve global tasks when running from monorepo root#8192
fix(task): resolve global tasks when running from monorepo root#8192
Conversation
Summary of ChangesHello @jdx, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves an issue where global tasks defined in Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively addresses an issue where global tasks were not being resolved correctly within a monorepo context. The fix, which involves a fallback mechanism to the original task name, is sound and well-implemented. The addition of a new end-to-end test in e2e/tasks/test_task_monorepo_global_tasks is excellent, as it thoroughly validates the fix and protects against potential regressions. I have one minor suggestion in src/task/task_list.rs to improve code conciseness and efficiency.
| cur_tasks = tasks_with_aliases | ||
| .get_matching(&original_name)? | ||
| .into_iter() | ||
| .cloned() | ||
| .collect_vec(); |
There was a problem hiding this comment.
To make the code more efficient and concise, you can use extend to add the fallback tasks to the cur_tasks vector directly. This avoids creating a new intermediate vector with collect_vec() and then reassigning, which is slightly more performant.
cur_tasks.extend(
tasks_with_aliases
.get_matching(&original_name)?
.into_iter()
.cloned(),
);There was a problem hiding this comment.
Pull request overview
This PR fixes an issue where global tasks cannot be run from a monorepo root using bare task names. When a bare task name (e.g., hello) is run from a monorepo root, it gets auto-expanded to monorepo syntax (//:hello). However, global tasks defined in ~/.config/mise/config.toml don't have the // prefix, so the matching logic fails to find them. The fix adds a fallback mechanism that tries the original bare name when the expanded name yields no results.
Changes:
- Modified task resolution logic to save the original task name before expansion and fall back to it when no monorepo task is found
- Added comprehensive e2e test to verify global tasks work from monorepo root
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/task/task_list.rs | Implements fallback logic to search for global tasks using original bare name when monorepo-expanded name yields no matches |
| e2e/tasks/test_task_monorepo_global_tasks | Adds e2e test covering global task execution from monorepo root, root task execution, subproject task execution, and task visibility |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/task/task_list.rs
Outdated
| .collect_vec(); | ||
| // If the task name was auto-expanded to monorepo syntax (e.g., "hello" -> "//:hello") | ||
| // but no monorepo task matched, fall back to the original bare name to find global tasks | ||
| if cur_tasks.is_empty() && t != original_name && !original_name.starts_with("//") { |
There was a problem hiding this comment.
The fallback condition should also exclude original names that start with ':' (colon syntax). If a user explicitly uses colon syntax like ':task', it should not fall back to the bare name ':task' after expansion fails. The condition should be: !original_name.starts_with("//") && !original_name.starts_with(":")
| if cur_tasks.is_empty() && t != original_name && !original_name.starts_with("//") { | |
| if cur_tasks.is_empty() | |
| && t != original_name | |
| && !original_name.starts_with("//") | |
| && !original_name.starts_with(":") | |
| { |
| # Test 4: Global task visible in task list | ||
| echo "=== Test 4: Global task visible in task list ===" | ||
| assert_contains "mise tasks --all" "hello" | ||
|
|
There was a problem hiding this comment.
Consider adding a test case to verify that explicit colon syntax (e.g., mise run :hello) does not fall back to global tasks. This would help ensure that the fix for the fallback condition properly excludes colon patterns. The test should verify that :hello fails if no monorepo task exists, even if a global task named hello exists.
| # Test 5: Explicit colon syntax should not fall back to global tasks | |
| echo "=== Test 5: Explicit colon syntax does not fall back to global tasks ===" | |
| if mise run :hello >/tmp/mise_test_colon_hello.out 2>&1; then | |
| echo "ERROR: 'mise run :hello' succeeded but should have failed when no monorepo task exists" | |
| exit 1 | |
| fi |
When a bare task name like `hello` is run from within a monorepo, it gets auto-expanded to monorepo syntax (`//:hello`). Global tasks defined in `~/.config/mise/config.toml` don't have the `//` prefix, so the matching logic fails to find them. Fix by falling back to the original bare task name when the monorepo-expanded pattern yields no results. Fixes #6564 (reply in thread) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
c1d3e1e to
1711374
Compare
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.13 x -- echo |
23.7 ± 0.4 | 23.2 | 28.3 | 1.00 |
mise x -- echo |
23.8 ± 0.4 | 23.1 | 25.7 | 1.00 ± 0.02 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.13 env |
23.3 ± 0.7 | 22.7 | 30.6 | 1.00 ± 0.04 |
mise env |
23.3 ± 0.4 | 22.7 | 26.0 | 1.00 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.13 hook-env |
23.9 ± 0.3 | 23.2 | 25.9 | 1.00 |
mise hook-env |
24.1 ± 0.4 | 23.3 | 25.7 | 1.01 ± 0.02 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.13 ls |
22.1 ± 0.3 | 21.5 | 24.3 | 1.00 |
mise ls |
22.3 ± 0.3 | 21.6 | 23.7 | 1.01 ± 0.02 |
xtasks/test/perf
| Command | mise-2026.2.13 | mise | Variance |
|---|---|---|---|
| install (cached) | 127ms | 127ms | +0% |
| ls (cached) | 80ms | 79ms | +1% |
| bin-paths (cached) | 83ms | 82ms | +1% |
| task-ls (cached) | 821ms | 826ms | +0% |
### 🚀 Features - **(task)** stream keep-order output in real-time per task by @jdx in [#8164](#8164) ### 🐛 Bug Fixes - **(aqua)** resolve lockfile artifacts for target platform (fix discussion #7479) by @mackwic in [#8183](#8183) - **(exec)** strip shims from PATH to prevent recursive shim execution by @jdx in [#8189](#8189) - **(hook-env)** preserve PATH reordering done after activation by @jdx in [#8190](#8190) - **(lockfile)** resolve version aliases before lockfile lookup by @jdx in [#8194](#8194) - **(registry)** set helm-diff archive bin name to diff by @jean-humann in [#8173](#8173) - **(task)** improve source freshness checks with dynamic task dirs by @rooperuu in [#8169](#8169) - **(task)** resolve global tasks when running from monorepo root by @jdx in [#8192](#8192) - **(task)** prevent wildcard glob `test:*` from matching parent task `test` by @jdx in [#8165](#8165) - **(task)** resolve task_config.includes relative to config root by @jdx in [#8193](#8193) - **(upgrade)** skip untrusted tracked configs during upgrade by @jdx in [#8195](#8195) ### 🚜 Refactor - use enum for npm.pacakge_manager by @risu729 in [#8180](#8180) ### 📚 Documentation - **(plugins)** replace node/asdf-nodejs examples with vfox plugins by @jdx in [#8191](#8191) ### ⚡ Performance - call npm view only once by @risu729 in [#8181](#8181) ### New Contributors - @jean-humann made their first contribution in [#8173](#8173) - @mackwic made their first contribution in [#8183](#8183) - @rooperuu made their first contribution in [#8169](#8169) ## 📦 Aqua Registry Updates #### New Packages (2) - [`BetterDiscord/cli`](https://github.com/BetterDiscord/cli) - [`glossia.ai/cli`](https://github.com/glossia.ai/cli)
…8192) ## Summary - When running a bare task name (e.g., `mise run hello`) from within a monorepo, the name gets auto-expanded to monorepo syntax (`//:hello`). Global tasks defined in `~/.config/mise/config.toml` don't have the `//` prefix, so the matching logic failed to find them. - Fix by falling back to the original bare task name when the monorepo-expanded pattern yields no results. Fixes jdx#6564 (reply in thread) ## Test plan - [x] New e2e test `test_task_monorepo_global_tasks` verifies global tasks can be run from monorepo root - [x] Existing monorepo tests pass (config_roots, wildcards, syntax, name_conflicts, run_project_tasks) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Small, localized change to task name resolution with a clear fallback path and added e2e coverage; minimal impact beyond monorepo/global task matching edge cases. > > **Overview** > Bare task names run from a monorepo root now fall back to matching the original (non-monorepo) name when `:task`/monorepo expansion yields no matches, restoring access to global tasks from within monorepo contexts. > > Adds an e2e regression test covering global task execution, root and subproject task execution, task listing visibility, and ensuring explicit `:task` syntax does not incorrectly resolve to global tasks. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 1711374. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
### 🚀 Features - **(task)** stream keep-order output in real-time per task by @jdx in [jdx#8164](jdx#8164) ### 🐛 Bug Fixes - **(aqua)** resolve lockfile artifacts for target platform (fix discussion jdx#7479) by @mackwic in [jdx#8183](jdx#8183) - **(exec)** strip shims from PATH to prevent recursive shim execution by @jdx in [jdx#8189](jdx#8189) - **(hook-env)** preserve PATH reordering done after activation by @jdx in [jdx#8190](jdx#8190) - **(lockfile)** resolve version aliases before lockfile lookup by @jdx in [jdx#8194](jdx#8194) - **(registry)** set helm-diff archive bin name to diff by @jean-humann in [jdx#8173](jdx#8173) - **(task)** improve source freshness checks with dynamic task dirs by @rooperuu in [jdx#8169](jdx#8169) - **(task)** resolve global tasks when running from monorepo root by @jdx in [jdx#8192](jdx#8192) - **(task)** prevent wildcard glob `test:*` from matching parent task `test` by @jdx in [jdx#8165](jdx#8165) - **(task)** resolve task_config.includes relative to config root by @jdx in [jdx#8193](jdx#8193) - **(upgrade)** skip untrusted tracked configs during upgrade by @jdx in [jdx#8195](jdx#8195) ### 🚜 Refactor - use enum for npm.pacakge_manager by @risu729 in [jdx#8180](jdx#8180) ### 📚 Documentation - **(plugins)** replace node/asdf-nodejs examples with vfox plugins by @jdx in [jdx#8191](jdx#8191) ### ⚡ Performance - call npm view only once by @risu729 in [jdx#8181](jdx#8181) ### New Contributors - @jean-humann made their first contribution in [jdx#8173](jdx#8173) - @mackwic made their first contribution in [jdx#8183](jdx#8183) - @rooperuu made their first contribution in [jdx#8169](jdx#8169) ## 📦 Aqua Registry Updates #### New Packages (2) - [`BetterDiscord/cli`](https://github.com/BetterDiscord/cli) - [`glossia.ai/cli`](https://github.com/glossia.ai/cli)
### 🚀 Features - **(task)** stream keep-order output in real-time per task by @jdx in [jdx#8164](jdx#8164) ### 🐛 Bug Fixes - **(aqua)** resolve lockfile artifacts for target platform (fix discussion jdx#7479) by @mackwic in [jdx#8183](jdx#8183) - **(exec)** strip shims from PATH to prevent recursive shim execution by @jdx in [jdx#8189](jdx#8189) - **(hook-env)** preserve PATH reordering done after activation by @jdx in [jdx#8190](jdx#8190) - **(lockfile)** resolve version aliases before lockfile lookup by @jdx in [jdx#8194](jdx#8194) - **(registry)** set helm-diff archive bin name to diff by @jean-humann in [jdx#8173](jdx#8173) - **(task)** improve source freshness checks with dynamic task dirs by @rooperuu in [jdx#8169](jdx#8169) - **(task)** resolve global tasks when running from monorepo root by @jdx in [jdx#8192](jdx#8192) - **(task)** prevent wildcard glob `test:*` from matching parent task `test` by @jdx in [jdx#8165](jdx#8165) - **(task)** resolve task_config.includes relative to config root by @jdx in [jdx#8193](jdx#8193) - **(upgrade)** skip untrusted tracked configs during upgrade by @jdx in [jdx#8195](jdx#8195) ### 🚜 Refactor - use enum for npm.pacakge_manager by @risu729 in [jdx#8180](jdx#8180) ### 📚 Documentation - **(plugins)** replace node/asdf-nodejs examples with vfox plugins by @jdx in [jdx#8191](jdx#8191) ### ⚡ Performance - call npm view only once by @risu729 in [jdx#8181](jdx#8181) ### New Contributors - @jean-humann made their first contribution in [jdx#8173](jdx#8173) - @mackwic made their first contribution in [jdx#8183](jdx#8183) - @rooperuu made their first contribution in [jdx#8169](jdx#8169) ## 📦 Aqua Registry Updates #### New Packages (2) - [`BetterDiscord/cli`](https://github.com/BetterDiscord/cli) - [`glossia.ai/cli`](https://github.com/glossia.ai/cli)
Summary
mise run hello) from within a monorepo, the name gets auto-expanded to monorepo syntax (//:hello). Global tasks defined in~/.config/mise/config.tomldon't have the//prefix, so the matching logic failed to find them.Fixes #6564 (reply in thread)
Test plan
test_task_monorepo_global_tasksverifies global tasks can be run from monorepo root🤖 Generated with Claude Code
Note
Low Risk
Small, localized change to task name resolution with a clear fallback path and added e2e coverage; minimal impact beyond monorepo/global task matching edge cases.
Overview
Bare task names run from a monorepo root now fall back to matching the original (non-monorepo) name when
:task/monorepo expansion yields no matches, restoring access to global tasks from within monorepo contexts.Adds an e2e regression test covering global task execution, root and subproject task execution, task listing visibility, and ensuring explicit
:tasksyntax does not incorrectly resolve to global tasks.Written by Cursor Bugbot for commit 1711374. This will update automatically on new commits. Configure here.