feat(tasks): change task_config.includes resolution from override to additive#8740
feat(tasks): change task_config.includes resolution from override to additive#8740
Conversation
Summary of ChangesHello, 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 focuses on improving the consistency and predictability of task configuration within the mise tool. By changing the Highlights
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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refactors the task_config.includes mechanism to be additive and hierarchical, allowing multiple configuration files to contribute to the included task files and directories, with corresponding updates to documentation and a new end-to-end test. The test tooling was enhanced to redirect stderr to stdout and strip ANSI escape codes from command output for more robust assertions. Many registry .toml files were updated to simplify their test commands by removing 2>&1 redirection, though a potential issue exists in registry/btop.toml where removing the sed command might cause test failures if btop --version outputs ANSI codes. Additionally, the documentation for task_config.includes could be improved by linking directly to its section and rephrasing its description for better clarity.
…additive Resolves the inconsistency of task loading orders between global tasks and local tasks where 'task_config.includes' overrode default includes instead of adding to them. Reverts jdx#6159
a0407ab to
24bc4f4
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request modifies the behavior of task_config.includes to be additive instead of overriding, resolving an inconsistency in task loading orders. The changes include documentation updates, a new end-to-end test to verify the additive behavior, and modifications to the code that loads file tasks.
Greptile SummaryThis PR changes Key changes:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[task_includes_for_dir / load_file_tasks] --> B[Start with default_task_includes\ne.g. .mise/tasks, mise-tasks]
B --> C{For each config\nin precedence order}
C --> D{Has task_config.includes?}
D -- Yes --> E[Extend list with\ncustom includes\nresolved from config root]
D -- No --> F[Skip]
E --> C
F --> C
C -- Done --> G[Deduplicate via .unique]
G --> H[Resolved include paths]
subgraph "load_tasks_in_dir — git_includes (NOT YET ADDITIVE)"
I[configs.iter.rev.find_map] --> J[First config\nwith any includes]
J --> K[Filter for git:: prefix]
K --> L[git_includes vec\n⚠ misses git URLs\nfrom other configs]
end
|
|
I think this should probably go the other way — make global tasks use override semantics to match local, rather than making local additive to match global. The ability to set The If the inconsistency between global and local is the issue, I'd prefer fixing global to be consistently override, or alternatively adding something like This comment was generated by Claude Code. |
|
I see, thanks. I think it might be enough to update the documentation to reflect the current behaviour, what do you think? |
|
yeah probably |
## Summary Follow-up to #8740. That PR proposed changing `task_config.includes` semantics, but the conclusion in the discussion was to document the current behavior instead of making a breaking change. This updates the task docs to reflect how `task_config.includes` works today: - explicit `task_config.includes` replaces the default file-task directories for that config scope - if users want the defaults plus custom paths, they must list the defaults explicitly - for local/monorepo task discovery, the nearest config with `task_config.includes` wins - global config files are loaded independently, so each global config file uses its own `includes` or the defaults It also updates the file-tasks page so the default directories are clearly described as defaults rather than always-on search paths. ## Verification - `git diff --check` - `mise run docs:build` --------- Co-authored-by: jdx <216188+jdx@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
## Summary Follow-up to jdx#8740. That PR proposed changing `task_config.includes` semantics, but the conclusion in the discussion was to document the current behavior instead of making a breaking change. This updates the task docs to reflect how `task_config.includes` works today: - explicit `task_config.includes` replaces the default file-task directories for that config scope - if users want the defaults plus custom paths, they must list the defaults explicitly - for local/monorepo task discovery, the nearest config with `task_config.includes` wins - global config files are loaded independently, so each global config file uses its own `includes` or the defaults It also updates the file-tasks page so the default directories are clearly described as defaults rather than always-on search paths. ## Verification - `git diff --check` - `mise run docs:build` --------- Co-authored-by: jdx <216188+jdx@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
While I was reading the code of
task_config.includes, I found an architectural inconsistency in its resolution depending on whether tasks were global or local.Before this PR:
load_global_tasksiterated over every single global config file and extended the tasks array by independently evaluatingload_file_tasks(and thereforedefault_task_includes) for each one. This meant global includes stacked together.task_includes_for_dirutilized afind_mapto find the first config with a customincludesarray and completely ignored the rest, throwing away default includes if any custom ones were present. Onlytask_config.includesin the config with the highest precedence (child over parent) was evaluated.I think it should at least be overridable, but it would be more intuitive and also make the implementation simple if we standardize the behaviour by changing it from overriding to additive everywhere.
This resolves the inconsistency of task loading orders between environments, fixing the test assertions that previously relied on the overriding side-effect.
Reverts #6159
Replaces #6636