Skip to content

fix(schema): add task_templates, extends, and timeout#8145

Merged
jdx merged 2 commits intojdx:mainfrom
risu729:task-template-schema
Feb 15, 2026
Merged

fix(schema): add task_templates, extends, and timeout#8145
jdx merged 2 commits intojdx:mainfrom
risu729:task-template-schema

Conversation

@risu729
Copy link
Contributor

@risu729 risu729 commented Feb 14, 2026

Closes #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

Copilot AI review requested due to automatic review settings February 14, 2026 05:59
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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 mise configuration by introducing task templates and inheritance. It allows users to define reusable sets of task properties and extend them, reducing redundancy and making task configurations more modular. New properties like extends and timeout provide more control over task behavior, while the underlying schema generation process has been updated to reflect these structural improvements.

Highlights

  • Task Definition Refactoring: The task definition in both mise.json and mise-task.json has been refactored to utilize an allOf construct, referencing a new task_template definition. This change aims to reduce property duplication and improve schema maintainability.
  • New Task Properties: The extends property has been added to task definitions, allowing tasks to inherit properties from defined task templates. Additionally, a timeout property has been introduced for tasks, enabling specification of a timeout duration.
  • Task Templates Introduction: A new top-level task_templates property has been added to mise.json, which allows defining reusable task templates. These templates can then be extended by individual tasks.
  • Schema Generation Update: The schema rendering script (xtasks/render/schema.ts) has been updated to ensure the new task_template definition is correctly copied into mise-task.json during schema generation.
Changelog
  • schema/mise-task.json
    • Refactored task definition to use allOf with a new task_template definition.
    • Added extends property to task definitions.
    • Introduced a new $defs/task_template definition containing common task properties and a new timeout property.
  • schema/mise.json
    • Refactored task definition to use allOf with a new task_template definition.
    • Added extends property to task definitions.
    • Introduced a new $defs/task_template definition containing common task properties and a new timeout property.
    • Added a top-level task_templates property to define reusable task templates.
  • xtasks/render/schema.ts
    • Updated the script to copy the new task_template definition when generating mise-task.json.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@risu729 risu729 changed the title fix: add task_templates, extends, and timeout to JSON schema fix(schema): add task_templates, extends, and timeout Feb 14, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_template schema definition is missing additionalProperties: 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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 timeout property to task definitions via the new task_template schema definition
  • Added extends property to tasks to reference and extend task templates
  • Added task_templates as a top-level configuration property for defining reusable task templates
  • Refactored task object schema to use allOf composition with task_template to 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
@risu729 risu729 force-pushed the task-template-schema branch from 53cfcee to 62fdbac Compare February 14, 2026 08:18
@risu729 risu729 requested a review from Copilot February 14, 2026 08:20
@risu729
Copy link
Contributor Author

risu729 commented Feb 14, 2026

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. The merge logic for array-based properties in templates can be counter-intuitive. I've left a detailed comment in src/task/task_template.rs with a suggestion for improvement.
  2. The documentation for the new per-task timeout property seems to be missing from docs/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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jdx jdx merged commit c763ad6 into jdx:main Feb 15, 2026
33 checks passed
@risu729 risu729 deleted the task-template-schema branch February 15, 2026 13:54
mise-en-dev added a commit that referenced this pull request Feb 16, 2026
### 🚀 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)
@senekor
Copy link

senekor commented Feb 18, 2026

This change produces a lot of warnings with tombi LSP. example:

└─In strict mode, `tasks.foo` does not allow "run" key.
   Please add `"additionalProperties": true` to the location where `tasks.build:base_station` is defined in https://mise.jdx.dev/schema/mise.
   json,
   or add `#:tombi schema.strict = false` as a document comment directive at the top of your document,
   or set `schema.strict = false` in your `tombi.toml`.

@s4nji
Copy link

s4nji commented Feb 18, 2026

Came here to say the same thing as @senekor; my mise.toml is now full of yellow lines with the same warning.

lucasew pushed a commit to lucasew/CONTRIB-mise that referenced this pull request Feb 18, 2026
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`
lucasew pushed a commit to lucasew/CONTRIB-mise that referenced this pull request Feb 18, 2026
### 🚀 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)
@risu729
Copy link
Contributor Author

risu729 commented Feb 19, 2026

It seems it's a Tombi issue.
tombi-toml/tombi#1507

I'll have a look at removing the use of some problematic features, but feel free to raise another PR.
I might not have time to work on this soon.

@senekor
Copy link

senekor commented Feb 19, 2026

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.

@risu729
Copy link
Contributor Author

risu729 commented Feb 19, 2026

It could be, but I'm not too sure if that'll be accepted.

Also, I believe we can replace unevaluatedProperties with some other features, then it would be fine.

risu729 added a commit to risu729/mise that referenced this pull request Feb 19, 2026
jdx added a commit that referenced this pull request Feb 21, 2026
…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>
risu729 pushed a commit to risu729/mise that referenced this pull request Feb 27, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants