fix(task): resolve dependencies before prepare to fix monorepo glob deps#8353
fix(task): resolve dependencies before prepare to fix monorepo glob deps#8353
Conversation
When a root task depends on a monorepo glob pattern like `//...:check`, the prepare step was only collecting config files from the top-level tasks returned by `get_task_lists()`. Since the root task has no `cf` field, subdirectory prepare providers were never discovered. Fix by calling `resolve_depends()` before running prepare, so transitive dependencies from monorepo subdirectories are included when collecting config files for the prepare engine. Reported-by: NfNitLoop (NfNitLoop@4b462b6) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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 addresses a critical bug in how 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 fixes an issue where prepare steps for tasks in monorepo subdirectories were not being executed when those tasks were included via a glob dependency from a root task. The fix involves resolving all transitive dependencies before the prepare step to discover all necessary prepare providers. The change is accompanied by a new end-to-end test that validates the fix.
The implementation is correct and solves the problem. However, it introduces a performance inefficiency by calling resolve_depends twice. I've left a comment with a suggestion for a refactoring to address this, which could be handled in a follow-up.
src/cli/run.rs
Outdated
| let subdir_configs: Vec<_> = task_list | ||
| // Resolve transitive dependencies to discover all tasks (including | ||
| // those from monorepo subdirectories referenced via glob patterns) | ||
| let all_tasks = resolve_depends(&config, task_list.clone()).await?; |
There was a problem hiding this comment.
This call to resolve_depends is necessary to fix the issue with monorepo glob dependencies for prepare steps. However, this introduces a performance issue as resolve_depends is called again inside parallelize_tasks (via prepare_tasks), leading to redundant dependency resolution.
To avoid this, consider resolving dependencies once before the prepare step and passing the fully resolved task list to parallelize_tasks. This would require modifying prepare_tasks to not call resolve_depends again.
Example refactoring:
In Run::run:
// ...
let task_list = get_task_lists(&config, &args, true, self.skip_deps).await?;
// ... (handle args_last)
let all_tasks = resolve_depends(&config, task_list).await?;
if !self.no_prepare {
// ... use all_tasks to get subdir_configs and run prepare engine
}
// ...
self.parallelize_tasks(config, all_tasks).await?Then, in Run::prepare_tasks, you would remove the resolve_depends call. Since prepare_tasks is not in this diff, this could be a good follow-up refactoring to improve performance.
Greptile SummaryFixes PrepareEngine to discover transitive task dependencies in monorepo mode by calling Key changes:
Note: This introduces a second call to Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Run
participant TaskList
participant PrepareEngine
participant Tasks
User->>Run: mise run //:check
Run->>TaskList: get_task_lists (root tasks)
TaskList-->>Run: [root task with depends="//...:check"]
Note over Run,PrepareEngine: NEW: Early dependency resolution
Run->>TaskList: resolve_depends (discover transitive deps)
TaskList-->>Run: all_tasks (includes subapp tasks)
Run->>Run: Extract cf (config files) from all_tasks
Run->>PrepareEngine: add_config_files (subdir configs)
Run->>PrepareEngine: run (auto_only=true)
PrepareEngine-->>Run: Prepare steps executed
Note over Run,Tasks: Existing flow continues
Run->>Run: parallelize_tasks (with original task_list)
Run->>TaskList: resolve_depends (again in prepare_tasks)
TaskList-->>Run: Resolved tasks for execution
Run->>Tasks: Execute tasks
Last reviewed commit: b83b833 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.20 x -- echo |
28.5 ± 0.5 | 27.6 | 32.5 | 1.03 ± 0.03 |
mise x -- echo |
27.7 ± 0.5 | 26.8 | 30.3 | 1.00 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.20 env |
27.0 ± 0.6 | 26.2 | 31.3 | 1.00 |
mise env |
27.0 ± 0.4 | 26.2 | 28.9 | 1.00 ± 0.03 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.20 hook-env |
27.8 ± 0.5 | 26.9 | 32.5 | 1.00 |
mise hook-env |
27.9 ± 0.5 | 27.0 | 29.9 | 1.00 ± 0.02 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.20 ls |
24.9 ± 0.4 | 24.1 | 26.5 | 1.00 |
mise ls |
25.1 ± 0.5 | 24.1 | 30.6 | 1.01 ± 0.03 |
xtasks/test/perf
| Command | mise-2026.2.20 | mise | Variance |
|---|---|---|---|
| install (cached) | 167ms | 167ms | +0% |
| ls (cached) | 95ms | 94ms | +1% |
| bin-paths (cached) | 99ms | 98ms | +1% |
| task-ls (cached) | 838ms | 842ms | +0% |
Move resolve_depends() call before the prepare step and pass the already-resolved task list to parallelize_tasks/prepare_tasks, avoiding the duplicate dependency resolution work. Also removes the need to clone task_list. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
### 🐛 Bug Fixes - **(exec)** respect PATH order for virtualenv resolution in mise x by @jdx in [#8342](#8342) - **(task)** revert process group changes that cause hangs with nested mise tasks by @jdx in [#8347](#8347) - **(task)** resolve vars from subdirectory configs for monorepo tasks by @jdx in [#8343](#8343) - **(task)** resolve dependencies before prepare to fix monorepo glob deps by @jdx in [#8353](#8353) - python noarch with Conda backend by @wolfv in [#8349](#8349) ### New Contributors - @wolfv made their first contribution in [#8349](#8349) ## 📦 Aqua Registry Updates #### New Packages (3) - [`alexhallam/tv`](https://github.com/alexhallam/tv) - [`arcanist-sh/hx`](https://github.com/arcanist-sh/hx) - [`dathere/qsv`](https://github.com/dathere/qsv) #### Updated Packages (3) - [`astral-sh/ruff`](https://github.com/astral-sh/ruff) - [`caarlos0/fork-cleaner`](https://github.com/caarlos0/fork-cleaner) - [`rhysd/actionlint`](https://github.com/rhysd/actionlint)
…eps (jdx#8353) ## Summary - When a root task depends on a monorepo glob pattern like `//...:check`, the prepare step was only collecting config files from top-level tasks (which have no `cf` field for subdirectory configs) - Fix by calling `resolve_depends()` before running prepare, so transitive dependencies from monorepo subdirectories are discovered and their prepare providers are included - Adds e2e test covering the glob dependency case Reported by @NfNitLoop in NfNitLoop@4b462b6 ## Test plan - [x] `mise run test:e2e test_prepare` passes including new test case - [x] New test verifies that `mise run //:check` (root task depending on `//...:check`) triggers subapp prepare steps 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes task resolution/execution ordering and dependency handling in `mise run`, which could affect which tasks run and when; covered by an added e2e regression test. > > **Overview** > Fixes `mise run` in monorepos where root tasks depending on monorepo glob patterns (e.g. `//...:check`) could skip subdirectory auto-prepare steps. > > `run` now resolves transitive dependencies once up front and uses that resolved task list both to collect subdirectory config files for `PrepareEngine` and to drive execution, and `prepare_tasks` no longer re-resolves dependencies internally. Adds an e2e regression test ensuring subapp prepare runs when the subtask is pulled in via `depends = "//...:check"`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 6db4594. 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>
### 🐛 Bug Fixes - **(exec)** respect PATH order for virtualenv resolution in mise x by @jdx in [jdx#8342](jdx#8342) - **(task)** revert process group changes that cause hangs with nested mise tasks by @jdx in [jdx#8347](jdx#8347) - **(task)** resolve vars from subdirectory configs for monorepo tasks by @jdx in [jdx#8343](jdx#8343) - **(task)** resolve dependencies before prepare to fix monorepo glob deps by @jdx in [jdx#8353](jdx#8353) - python noarch with Conda backend by @wolfv in [jdx#8349](jdx#8349) ### New Contributors - @wolfv made their first contribution in [jdx#8349](jdx#8349) ## 📦 Aqua Registry Updates #### New Packages (3) - [`alexhallam/tv`](https://github.com/alexhallam/tv) - [`arcanist-sh/hx`](https://github.com/arcanist-sh/hx) - [`dathere/qsv`](https://github.com/dathere/qsv) #### Updated Packages (3) - [`astral-sh/ruff`](https://github.com/astral-sh/ruff) - [`caarlos0/fork-cleaner`](https://github.com/caarlos0/fork-cleaner) - [`rhysd/actionlint`](https://github.com/rhysd/actionlint)
Summary
//...:check, the prepare step was only collecting config files from top-level tasks (which have nocffield for subdirectory configs)resolve_depends()before running prepare, so transitive dependencies from monorepo subdirectories are discovered and their prepare providers are includedReported by @NfNitLoop in NfNitLoop@4b462b6
Test plan
mise run test:e2e test_preparepasses including new test casemise run //:check(root task depending on//...:check) triggers subapp prepare steps🤖 Generated with Claude Code
Note
Medium Risk
Changes task resolution/execution ordering and dependency handling in
mise run, which could affect which tasks run and when; covered by an added e2e regression test.Overview
Fixes
mise runin monorepos where root tasks depending on monorepo glob patterns (e.g.//...:check) could skip subdirectory auto-prepare steps.runnow resolves transitive dependencies once up front and uses that resolved task list both to collect subdirectory config files forPrepareEngineand to drive execution, andprepare_tasksno longer re-resolves dependencies internally. Adds an e2e regression test ensuring subapp prepare runs when the subtask is pulled in viadepends = "//...:check".Written by Cursor Bugbot for commit 6db4594. This will update automatically on new commits. Configure here.