fix(task): resolve task_config.includes relative to config root#8193
fix(task): resolve task_config.includes relative to config root#8193
Conversation
Include paths in task_config.includes were being resolved relative to the config file's parent directory. For configs like `mise/config.toml`, this meant includes like `"bindist/tasks"` resolved to `mise/bindist/tasks` instead of `bindist/tasks`. Use `config_root()` instead, which correctly computes the project root for all config path patterns (e.g., `mise/config.toml` → grandparent). Fixes #8187 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 where 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 correctly fixes the resolution of [task_config].includes paths to be relative to the config root instead of the config file's parent directory. The changes in src/config/mod.rs are logical and consistently apply cf.config_root() for path resolution in both load_file_tasks and task_includes_for_dir. A notable improvement is the removal of a risky .unwrap() in load_file_tasks, which prevents a potential panic and enhances the code's robustness. The accompanying updates to the e2e tests validate the new behavior effectively. Overall, this is a solid fix that improves correctness and stability.
|
|
||
| let mut tasks = vec![]; | ||
| let config_root = Arc::new(config_root.to_path_buf()); | ||
| let cf_dir = cf.get_path().parent().unwrap(); |
There was a problem hiding this comment.
Using .unwrap() here is risky and could lead to a panic if the config file is located at the root of the filesystem (e.g., /config.toml). In such a case, parent() would eventually return None, causing the unwrap() to fail.
The change to use cf.config_root() is a great improvement as it not only fixes the path resolution logic but also makes the code more robust by avoiding this potential panic.
There was a problem hiding this comment.
Pull request overview
Fixes relative path resolution for [task_config].includes so includes are interpreted from the config root (project root) rather than the config file’s parent directory—important for configs stored under mise/config.toml and monorepo layouts.
Changes:
- Resolve task include paths using
ConfigFile::config_root()instead ofcf.get_path().parent(). - Update the monorepo e2e test include paths to match the new resolution base.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/config/mod.rs | Switches include-path expansion to use config_root() for correct project-root-relative includes. |
| e2e/tasks/test_task_monorepo_includes_relative_path | Updates include paths/comments to reflect config-root-relative resolution in monorepo scenarios. |
Comments suppressed due to low confidence (1)
e2e/tasks/test_task_monorepo_includes_relative_path:54
- This test file now treats includes as relative to the config root, but the header comment / example monorepo layout earlier in the file still describes includes as relative to the config file’s directory (and shows the old
../../../...path). Please update those earlier comments to match the new semantics so the test remains self-explanatory.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| .rev() | ||
| .find_map(|cf| { | ||
| cf.task_config().includes.clone().map(|includes| { | ||
| // Resolve relative paths from the config file's directory, not the search directory | ||
| let cf_dir = cf.get_path().parent().unwrap_or(dir); | ||
| (includes, cf_dir.to_path_buf()) | ||
| // Resolve relative paths from the config root, not the config file's directory | ||
| (includes, cf.config_root()) |
There was a problem hiding this comment.
The comment immediately above this block still says includes are resolved relative to the config file’s directory, but the implementation now resolves relative to cf.config_root(). Update/remove the stale comment so it matches the new behavior to avoid future confusion.
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.13 x -- echo |
23.5 ± 0.6 | 22.9 | 32.9 | 1.00 |
mise x -- echo |
23.6 ± 0.8 | 22.9 | 31.1 | 1.00 ± 0.04 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.13 env |
23.0 ± 0.4 | 22.5 | 28.9 | 1.00 |
mise env |
23.0 ± 0.2 | 22.5 | 24.2 | 1.00 ± 0.02 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.13 hook-env |
23.7 ± 0.3 | 23.2 | 28.4 | 1.00 |
mise hook-env |
23.7 ± 0.4 | 23.0 | 27.8 | 1.00 ± 0.02 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.13 ls |
21.9 ± 0.2 | 21.4 | 23.4 | 1.00 |
mise ls |
22.2 ± 0.2 | 21.7 | 23.5 | 1.01 ± 0.01 |
xtasks/test/perf
| Command | mise-2026.2.13 | mise | Variance |
|---|---|---|---|
| install (cached) | 125ms | 131ms | -4% |
| ls (cached) | 79ms | 80ms | -1% |
| bin-paths (cached) | 82ms | 84ms | -2% |
| task-ls (cached) | 833ms | 827ms | +0% |
Update test_task_monorepo_nested_config to place task files at config_root-relative paths instead of config-file-parent-relative paths, matching the new include resolution behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
### 🚀 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)
…8193) ## Summary - Fix `[task_config].includes` paths being resolved relative to the config file's parent directory instead of the config root - For configs like `mise/config.toml`, includes like `"bindist/tasks"` were incorrectly resolving to `mise/bindist/tasks` instead of `bindist/tasks` - Use `config_root()` which correctly computes the project root for all config path patterns - Rename monorepo includes test to drop `_slow` suffix (no tool compilation/installation) Fixes jdx#8187 ## Test plan - [x] Reproduced with https://codeberg.org/mdekstrand/opserve.git — all 4 tasks now discovered - [x] `test_task_monorepo_includes_relative_path` e2e test passes (updated include paths to be relative to config root) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes core task discovery/path resolution behavior, which may alter which task files are loaded for existing projects relying on the previous (incorrect) relative-base behavior. > > **Overview** > Fixes `[task_config].includes` path resolution by switching relative include expansion from the config file’s directory to the config’s computed `config_root()` in `load_file_tasks` and `task_includes_for_dir`. > > Updates e2e tests to reflect the new semantics and cover nested config layouts (e.g. `.config/mise/config.toml`, `.mise/config.toml`) plus deeper monorepo nesting, ensuring tasks load from the config-root-relative include locations and *not* from config-file-parent-relative fallbacks. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 2ede60c. 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
[task_config].includespaths being resolved relative to the config file's parent directory instead of the config rootmise/config.toml, includes like"bindist/tasks"were incorrectly resolving tomise/bindist/tasksinstead ofbindist/tasksconfig_root()which correctly computes the project root for all config path patterns_slowsuffix (no tool compilation/installation)Fixes #8187
Test plan
test_task_monorepo_includes_relative_pathe2e test passes (updated include paths to be relative to config root)🤖 Generated with Claude Code
Note
Medium Risk
Changes core task discovery/path resolution behavior, which may alter which task files are loaded for existing projects relying on the previous (incorrect) relative-base behavior.
Overview
Fixes
[task_config].includespath resolution by switching relative include expansion from the config file’s directory to the config’s computedconfig_root()inload_file_tasksandtask_includes_for_dir.Updates e2e tests to reflect the new semantics and cover nested config layouts (e.g.
.config/mise/config.toml,.mise/config.toml) plus deeper monorepo nesting, ensuring tasks load from the config-root-relative include locations and not from config-file-parent-relative fallbacks.Written by Cursor Bugbot for commit 2ede60c. This will update automatically on new commits. Configure here.