fix(schema): add task_templates, extends, and timeout#8145
Conversation
Summary of ChangesHello @risu729, 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 the flexibility and organization of task definitions within the 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 task templates, a great feature for reducing duplication in task definitions. The changes include updating the JSON schemas for mise.json and mise-task.json to support task_templates and the extends property, implementing the merge logic in Rust, and adding documentation for the new feature.
The refactoring of the schema to use allOf and $ref is a good improvement. I've found a couple of areas for improvement:
- The new
task_templateschema definition is missingadditionalProperties: false, which could allow unknown properties. - The documentation for template merging could be enhanced with a note explaining why certain boolean flags are not inherited.
Overall, this is a well-implemented feature. My suggestions are aimed at improving schema strictness and documentation clarity.
There was a problem hiding this comment.
Pull request overview
This PR adds support for task templates in the JSON schema, enabling reusable task definitions that can be extended by individual tasks. The changes align with the existing Rust implementation of the task templates feature.
Changes:
- Added
timeoutproperty to task definitions via the newtask_templateschema definition - Added
extendsproperty to tasks to reference and extend task templates - Added
task_templatesas a top-level configuration property for defining reusable task templates - Refactored task object schema to use
allOfcomposition withtask_templateto eliminate property duplication
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| xtasks/render/schema.ts | Adds copying of the task_template definition to the mise-task.json schema generation |
| schema/mise.json | Introduces task_template definition, refactors task object to use composition, adds task_templates top-level property, and includes extends and timeout properties |
| schema/mise-task.json | Mirrors the mise.json changes with the same task_template definition and task object refactoring |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Closes jdx#8140 - Add `extends` and `timeout` to task definition - Add `task_templates` as top-level property referencing strict `task_template` def - Refactor task and task_template to use shared `task_props` base - Apply `unevaluatedProperties: false` to enforce strict validation - Update render script to copy definitions to mise-task.json
53cfcee to
62fdbac
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces task templates, a great feature for reusability, along with adding extends and timeout properties. The JSON schema refactoring is well done and improves maintainability.
I have two main points of feedback:
- The merge logic for array-based properties in templates can be counter-intuitive. I've left a detailed comment in
src/task/task_template.rswith a suggestion for improvement. - The documentation for the new per-task
timeoutproperty seems to be missing fromdocs/tasks/task-configuration.md. It would be great to add it for completeness.
Overall, this is a solid contribution. Addressing the merge logic will make the feature more robust and easier to use.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
### 🚀 Features - **(vfox)** allow plugins to request env var redaction via MiseEnvResult by @jdx in [#8166](#8166) - add a default_host setting for rust by @aacebedo in [#8154](#8154) - add github_content package support for aqua backend by @risu729 in [#8147](#8147) - support devEngines.runtime in deno by @risu729 in [#8144](#8144) ### 🐛 Bug Fixes - **(asset_matcher)** penalize vsix files by @risu729 in [#8151](#8151) - **(edit)** strip formatting whitespace from TOML values in `mise edit` by @jdx in [#8162](#8162) - **(install)** improve --locked support for python and ubi backends by @jdx in [#8163](#8163) - **(npm)** suppress npm update notifier while npm install by @risu729 in [#8152](#8152) - **(schema)** add task_templates, extends, and timeout by @risu729 in [#8145](#8145) ### 🚜 Refactor - **(registry)** remove [key=value] options syntax from backends by @risu729 in [#8146](#8146) ### 📚 Documentation - **(settings)** remove wrong tip for github_attestations by @risu729 in [#8158](#8158) ### Chore - **(release-plz)** delete embedded plugins directory before update by @risu729 in [#8149](#8149) - adds necessary env var to the mcp help message in cli by @joaommartins in [#8133](#8133) ### New Contributors - @joaommartins made their first contribution in [#8133](#8133) ## 📦 Aqua Registry Updates #### New Packages (5) - [`containers/podlet`](https://github.com/containers/podlet) - [`hickford/git-credential-azure`](https://github.com/hickford/git-credential-azure) - [`hickford/git-credential-oauth`](https://github.com/hickford/git-credential-oauth) - [`kovetskiy/mark`](https://github.com/kovetskiy/mark) - [`openbao/openbao/bao`](https://github.com/openbao/openbao/bao)
|
This change produces a lot of warnings with tombi LSP. example: |
|
Came here to say the same thing as @senekor; my |
Closes jdx#8140 ## Changes - Add `extends` and `timeout` properties to the task definition in `mise.json` - Add `task_templates` as a top-level property referencing a new `task_template` def - Refactor task object variant to use `allOf` with `task_template` to avoid property duplication between task and task_template - Update `xtasks/render/schema.ts` to copy `task_template` def into `mise-task.json`
### 🚀 Features - **(vfox)** allow plugins to request env var redaction via MiseEnvResult by @jdx in [jdx#8166](jdx#8166) - add a default_host setting for rust by @aacebedo in [jdx#8154](jdx#8154) - add github_content package support for aqua backend by @risu729 in [jdx#8147](jdx#8147) - support devEngines.runtime in deno by @risu729 in [jdx#8144](jdx#8144) ### 🐛 Bug Fixes - **(asset_matcher)** penalize vsix files by @risu729 in [jdx#8151](jdx#8151) - **(edit)** strip formatting whitespace from TOML values in `mise edit` by @jdx in [jdx#8162](jdx#8162) - **(install)** improve --locked support for python and ubi backends by @jdx in [jdx#8163](jdx#8163) - **(npm)** suppress npm update notifier while npm install by @risu729 in [jdx#8152](jdx#8152) - **(schema)** add task_templates, extends, and timeout by @risu729 in [jdx#8145](jdx#8145) ### 🚜 Refactor - **(registry)** remove [key=value] options syntax from backends by @risu729 in [jdx#8146](jdx#8146) ### 📚 Documentation - **(settings)** remove wrong tip for github_attestations by @risu729 in [jdx#8158](jdx#8158) ### Chore - **(release-plz)** delete embedded plugins directory before update by @risu729 in [jdx#8149](jdx#8149) - adds necessary env var to the mcp help message in cli by @joaommartins in [jdx#8133](jdx#8133) ### New Contributors - @joaommartins made their first contribution in [jdx#8133](jdx#8133) ## 📦 Aqua Registry Updates #### New Packages (5) - [`containers/podlet`](https://github.com/containers/podlet) - [`hickford/git-credential-azure`](https://github.com/hickford/git-credential-azure) - [`hickford/git-credential-oauth`](https://github.com/hickford/git-credential-oauth) - [`kovetskiy/mark`](https://github.com/kovetskiy/mark) - [`openbao/openbao/bao`](https://github.com/openbao/openbao/bao)
|
It seems it's a Tombi issue. I'll have a look at removing the use of some problematic features, but feel free to raise another PR. |
|
I've experimented a little and I think the easiest solution would be to enable templates to extend other templates, which seems like a natural feature anyway. Then the tables "tasks" and "task_templates" have the exact same props and one doesn't have to jump through hoops to avoid duplication in the schema. |
|
It could be, but I'm not too sure if that'll be accepted. Also, I believe we can replace |
…)" This reverts commit c763ad6.
…8285) ## Summary - Replace `unevaluatedProperties` with `additionalProperties` in the task/task_template JSON schema definitions to fix Tombi TOML LSP compatibility - Move `extends` property into `task_props` so `allOf`/`$ref` indirection is no longer needed - Add e2e test validating the schema with `tombi lint` in strict mode Fixes #8254 ## Context PR #8145 refactored the task schema to use `allOf` + `$ref` + `unevaluatedProperties: false`. While valid JSON Schema 2019-09, Tombi doesn't support `unevaluatedProperties` with `allOf`/`$ref`, causing it to reject valid task properties (`description`, `depends`, `run`, `dir`, `quiet`, `usage`, etc.) in strict mode. The fix moves `extends` into `task_props` directly and uses `additionalProperties: false`, eliminating the need for `allOf` wrappers entirely. This also means `task_template` gains an `extends` property, which as noted in the discussion is a natural feature (templates extending other templates). ## Test plan - [x] Verified with `tombi lint --strict` that valid task properties are accepted - [x] Verified that invalid properties are still rejected - [x] Verified against upstream schema that the original bug reproduces - [x] `mise run lint` passes - [x] e2e test `config/test_schema_tombi` passes - [x] Schema lint passes (`schema/mise.json` and `schema/mise-task.json` valid) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Schema-only changes plus a new e2e check; main risk is inadvertently tightening/loosening task validation for editors/LSPs due to the schema shape rewrite. > > **Overview** > Fixes Tombi strict-mode compatibility for task schemas by replacing the `allOf` + `unevaluatedProperties` pattern with fully inlined task/task_template `properties` and `additionalProperties: false`, ensuring valid task fields are accepted while unknown fields are rejected. > > Updates `xtasks/render/schema.ts` to synthesize `task_template` from `task_props` and rewrite the object variant of `task` to include `extends` without schema indirection, and adds `e2e/config/test_schema_tombi` to regression-test both the valid and invalid cases with `tombi lint`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 9d64bb5. 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>
…dx#8285) ## Summary - Replace `unevaluatedProperties` with `additionalProperties` in the task/task_template JSON schema definitions to fix Tombi TOML LSP compatibility - Move `extends` property into `task_props` so `allOf`/`$ref` indirection is no longer needed - Add e2e test validating the schema with `tombi lint` in strict mode Fixes jdx#8254 ## Context PR jdx#8145 refactored the task schema to use `allOf` + `$ref` + `unevaluatedProperties: false`. While valid JSON Schema 2019-09, Tombi doesn't support `unevaluatedProperties` with `allOf`/`$ref`, causing it to reject valid task properties (`description`, `depends`, `run`, `dir`, `quiet`, `usage`, etc.) in strict mode. The fix moves `extends` into `task_props` directly and uses `additionalProperties: false`, eliminating the need for `allOf` wrappers entirely. This also means `task_template` gains an `extends` property, which as noted in the discussion is a natural feature (templates extending other templates). ## Test plan - [x] Verified with `tombi lint --strict` that valid task properties are accepted - [x] Verified that invalid properties are still rejected - [x] Verified against upstream schema that the original bug reproduces - [x] `mise run lint` passes - [x] e2e test `config/test_schema_tombi` passes - [x] Schema lint passes (`schema/mise.json` and `schema/mise-task.json` valid) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Schema-only changes plus a new e2e check; main risk is inadvertently tightening/loosening task validation for editors/LSPs due to the schema shape rewrite. > > **Overview** > Fixes Tombi strict-mode compatibility for task schemas by replacing the `allOf` + `unevaluatedProperties` pattern with fully inlined task/task_template `properties` and `additionalProperties: false`, ensuring valid task fields are accepted while unknown fields are rejected. > > Updates `xtasks/render/schema.ts` to synthesize `task_template` from `task_props` and rewrite the object variant of `task` to include `extends` without schema indirection, and adds `e2e/config/test_schema_tombi` to regression-test both the valid and invalid cases with `tombi lint`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 9d64bb5. 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>
Closes #8140
Changes
extendsandtimeoutproperties to the task definition inmise.jsontask_templatesas a top-level property referencing a newtask_templatedefallOfwithtask_templateto avoid property duplication between task and task_templatextasks/render/schema.tsto copytask_templatedef intomise-task.json