feat(tasks): monorepo vars and per-task vars#8248
Conversation
Summary of ChangesHello @halms, 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 significantly enhances variable management within the task system. It resolves a previous issue 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 introduces support for vars in monorepo tasks and per-task vars, which is a great enhancement for task configuration and templating. The changes correctly handle vars inheritance in monorepos and allow overriding them at the task level. The documentation and schema updates are also comprehensive.
I've added one suggestion for a potential refactoring to reduce code duplication, which could improve long-term maintainability. Overall, this is a solid contribution.
There was a problem hiding this comment.
Pull request overview
This PR adds support for per-task variables and fixes monorepo vars inheritance. Tasks can now define local vars that override config-level vars, and monorepo child config vars are properly inherited when tasks are called from the root.
Changes:
- Added
varsfield to Task and TaskTemplate structs with deep merge semantics (template vars + task vars, task overrides) - Implemented vars resolution for monorepo tasks by loading the full config hierarchy from the task's directory
- Added caching for resolved monorepo vars to improve performance
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/task/task_template.rs | Adds vars field to TaskTemplate with deep merge logic and test |
| src/task/mod.rs | Adds vars field to Task, implements resolve_base_vars and resolve_task_vars methods with caching |
| src/config/mod.rs | Adds test validating per-task vars are resolved in task descriptions |
| schema/mise.json | Adds vars schema reference to task definitions |
| schema/mise-task.json | Adds vars schema reference to task definitions |
| docs/tasks/task-configuration.md | Documents task-local vars with examples |
| docs/tasks/monorepo.md | Documents vars layering behavior in monorepo contexts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1f32bb7 to
50f7a31
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for per-task variables (vars) and fixes an issue with vars inheritance in monorepos. The changes include updates to documentation, JSON schemas, and the core logic for task and configuration handling. Overall, the implementation is solid, but I've found a bug in how task-level variables are resolved which prevents them from referencing config-level variables. I've also noted a small improvement for consistency in lock handling.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8a44caf to
96e0d5d
Compare
jdx
left a comment
There was a problem hiding this comment.
Nice work! The extraction of resolve_vars_from_config_files is clean and the template merge logic correctly mirrors the existing env pattern. A few observations:
E2E test coverage: There are unit tests for template merging and config-level rendering, but no E2E tests. An E2E test with a monorepo setup (child mise.toml defining vars + a task using {{vars.foo}}) would help catch integration issues.
Double tera_ctx.insert("vars", ...) in tera_ctx(): The two-phase insert (base vars first, then extend with task vars) is correct — it lets task-level var templates reference base vars. A brief comment explaining why it's done twice would help future readers.
resolve_task_vars calls ts.full_env() on every invocation: Since the result depends only on config + toolset, this could be passed in from the caller or cached if many tasks use per-task vars. Not blocking but worth noting.
Docs example at task-configuration.md ~line 625: The example now shows both config-level e2e_args = '--headless' and task-level vars = { e2e_args = '--headed' } but doesn't explicitly call out the override behavior. A one-liner like "The task-level var overrides the config-level value" would clarify.
This review was AI-generated by Claude Code
|
I'll look into the feedback the coming days. |
360260d to
addfa55
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
addfa55 to
bb12e02
Compare
### 🚀 Features - **(hooks)** add task references to hooks and watch_files by @jdx in [#8400](#8400) - **(prepare)** add git-submodule built-in provider by @jdx in [#8407](#8407) - **(prepare)** add human-readable stale reasons to prepare output by @jdx in [#8408](#8408) - **(prepare)** add dependency ordering to prepare steps by @jdx in [#8401](#8401) - **(prepare)** add --explain flag for provider diagnostics by @jdx in [#8409](#8409) - **(prepare)** add per-provider timeout support by @jdx in [#8405](#8405) - **(prepare)** add blake3 content-hash freshness checking by @jdx in [#8404](#8404) - **(tasks)** monorepo vars and per-task vars by @halms in [#8248](#8248) ### 🐛 Bug Fixes - **(aqua)** restore bin_paths disk cache with fresh_file invalidation by @jdx in [#8398](#8398) - **(idiomatic)** use generic parser for idiomatic files by @risu729 in [#8171](#8171) - **(install)** apply precompiled options to all platforms in lockfile by @jdx in [#8396](#8396) - **(install)** normalize "v" prefix when matching lockfile versions by @jdx in [#8413](#8413) - **(prepare)** improve git submodule parser and fix check_staleness error handling by @jdx in [#8412](#8412) - **(python)** respect precompiled settings in lock file generation by @jdx in [#8399](#8399) - **(python)** clarify uv_venv_auto docs + prevent uv shim recursion in venv creation by @halms in [#8402](#8402) - **(task)** remove deprecated `# mise` task header syntax by @jdx in [#8403](#8403) - **(vfox)** avoid eager metadata loading during config file detection by @jdx in [#8397](#8397) - clarify GitHub attestations to be artifact ones by @scop in [#8394](#8394) - ignore comments in idiomatic version files by @iloveitaly in [#7682](#7682) ### 🚜 Refactor - unify archive detection by @risu729 in [#8137](#8137) ### 📚 Documentation - remove duplicated docs for npm.package_manager by @risu729 in [#8414](#8414)
Technically partially a fix and partially a new feature, but since it touches similar code, I put it into a single PR.
Currently
vars(unlikeenv) are not correctly inherited for monorepo tasks.So vars defined in monorepo child are not available for it's tasks when called from monorepo root.
Also: adding
varskey totomltask definition so that we can specify per-task variables. This especially becomes useful with the new task templates.