Skip to content

feat(schema): add backend-specific tool options#9665

Closed
risu729 wants to merge 6 commits into
jdx:mainfrom
risu729:codex/schema-backend-tool-options
Closed

feat(schema): add backend-specific tool options#9665
risu729 wants to merge 6 commits into
jdx:mainfrom
risu729:codex/schema-backend-tool-options

Conversation

@risu729

@risu729 risu729 commented May 7, 2026

Copy link
Copy Markdown
Contributor

Stacked on #9649.

Note: this branch is based on #9649. GitHub would not let me open the PR with codex/schema-tool-options as the base because that branch only exists on the fork, and I do not have permission to create the matching base branch on jdx/mise.

Summary

  • add backend-specific schema branches for explicit [tools] keys using patternProperties
  • cover known backend options for aqua:, cargo:, conda:, forgejo:, github:, gitlab:, go:, http:, npm:, pipx:, s3:, spm:, and ubi:
  • cover core tool options for python, rust, and dotnet
  • keep registry shorthand, [tool_alias], vfox, and asdf plugin tools on the generic fallback because standalone JSON Schema cannot resolve those to a concrete backend
  • expand the Tombi schema regression to exercise valid backend-specific opts and invalid typed values

Validation

  • mise run render:schema
  • jq empty schema/mise.json schema/mise-task.json
  • git diff --check
  • mise run test:e2e e2e/config/test_schema_tombi

This PR was generated by an AI coding assistant.

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

Copy link
Copy Markdown
Contributor

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 refactors the mise and mise-task JSON schemas to provide specialized validation for various tool backends using patternProperties. It also updates E2E tests with comprehensive examples and new failure cases. Feedback suggests reducing schema redundancy by centralizing platform-specific property definitions into reusable components.

Comment thread schema/mise.json Outdated
@greptile-apps

greptile-apps Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds backend-specific JSON Schema branches to schema/mise.json using patternProperties, covering 13 explicit backends (aqua:, cargo:, conda:, forgejo:, github:, gitlab:, go:, http:, npm:, pipx:, s3:, spm:, ubi:) plus core tool patterns for python, rust, and dotnet. It also refactors schema/mise-task.json to centralise shared tool option fields into a reusable tool_options def and expands the Tombi e2e test with valid backend-specific fixtures and typed-constraint failure cases.

  • schema/mise.json: Introduces a layered def hierarchy (tool_optionstool_install_optionstool_object_base → backend-specific *_object types) and routes [tools] keys through patternProperties; additionalProperties correctly falls back to the generic tool_value for unrecognised backends.
  • schema/mise-task.json: Task tool schemas gain the new tool_options def without backend-specific patternProperties; extra task-tool properties remain restricted to strings only, intentionally blocking nested objects like backend_options.
  • e2e/config/test_schema_tombi: Adds one valid fixture exercising every new backend pattern and two failure fixtures covering typed-constraint violations and object values in task tools.

Confidence Score: 5/5

Safe to merge — purely additive schema changes with comprehensive test coverage and no runtime logic touched.

All changes are JSON Schema definitions and an e2e test script. The patternProperties / additionalProperties split is semantically correct, unevaluatedProperties usage correctly traverses allOf chains, and the tombi e2e suite validates both positive and negative cases for every new backend pattern.

No files require special attention beyond optionally verifying the filter_bins type for release backends against the actual Rust implementation.

Reviews (4): Last reviewed commit: "refactor(schema): reuse platform alias s..." | Re-trigger Greptile

Comment thread schema/mise.json
@risu729

risu729 commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

Earlier in this run, autofix failed in schema validation on schema/mise-registry-tool.json with an unresolved #/definitions/toolId reference. That file is not part of this branch diff.

The current head now has autofix passing, so there are no current unrelated CI failures to ignore.

This comment was generated by an AI coding assistant.

@risu729

risu729 commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the AI review suggestion about tool_release_options duplicating shared artifact fields. The release backend schema now composes tool_artifact_platform_options via $ref, matching the http and s3 backend option structure.

Validated again locally with:

  • mise run render:schema
  • jq empty schema/mise.json schema/mise-task.json
  • git diff --check
  • mise run test:e2e e2e/config/test_schema_tombi

This comment was generated by an AI coding assistant.

@risu729

risu729 commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

benchmark failed on the latest head in the hyperfine comparison step. The log shows it set failed=true because hook-env measured 14% slower than mise-2026.5.1; the same run reported ls as a 14% improvement before exiting.

This PR only changes generated JSON schema files and schema-validation e2e fixtures, with no CLI runtime path changes, so I am treating this benchmark failure as unrelated to the schema change.

This comment was generated by an AI coding assistant.

@risu729

risu729 commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

Too much work. This should be helpful in the IDE for completions, but it's hard to support tools in the registry, so I don't think this is worth for this schema changes.

@risu729 risu729 closed this May 7, 2026
@risu729 risu729 deleted the codex/schema-backend-tool-options branch May 7, 2026 13:20
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.

1 participant