refactor(schema): extract tool options definition#9649
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the project's JSON schemas and the schema generation script to use "unevaluatedProperties": false instead of "additionalProperties": false. This refactoring allows for better property sharing via $refs in task definitions, leveraging improvements in Tombi v0.9.19+. The E2E tests have been updated to use a pinned Tombi version and include new test cases for validating nested properties like backend_options and profile. I have no feedback to provide as there were no review comments.
Greptile SummaryThis PR extracts the shared
Confidence Score: 5/5Safe to merge — a structural schema refactoring with deliberately expanded root-tool permissiveness that is covered by explicit tests. The refactoring is logically consistent across both schema files: unevaluatedProperties correctly inherits evaluated properties from $ref targets under allOf, required: ["version"] inside tool_options propagates through the composition, and the task-tool path still rejects non-string extras as before. The only substantive behavior change — allowing array/object backend extras on root tools — is intentional and validated by the updated e2e fixtures. No schema constraints are accidentally dropped or inverted. No files require special attention. The schema files are consistent with each other and the test script fully covers the new permissiveness boundaries. Reviews (3): Last reviewed commit: "[autofix.ci] apply automated fixes" | Re-trigger Greptile |
|
Greptile note on the root This comment was generated by an AI coding assistant. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
e780ea1 to
4897354
Compare
### 🚀 Features - **(cli)** add minimum release age flag to lock and ls-remote by @risu729 in [#9269](#9269) - **(config)** add run field for hooks by @risu729 in [#9718](#9718) - **(github)** add native oauth token source by @jdx in [#9654](#9654) - **(oci)** scope build to project config by default by @jdx in [#9766](#9766) - add support for prefixed latest version queries in outdated checks by @roele in [#9767](#9767) ### 🐛 Bug Fixes - **(activate)** guard bash chpwd hook under nounset by @risu729 in [#9716](#9716) - **(backend)** date-check latest stable fast path by @risu729 in [#9650](#9650) - **(config)** parse core tool options consistently by @risu729 in [#9742](#9742) - **(exec)** propagate __MISE_DIFF so nested mise recovers pristine PATH by @jdx in [#9765](#9765) - **(forgejo)** include prereleases when opted in by @risu729 in [#9717](#9717) - **(github)** avoid caching empty release assets by @risu729 in [#9616](#9616) - **(java)** resolve lockfile URLs from metadata by @risu729 in [#9719](#9719) - **(lock)** cache unavailable github attestations by @risu729 in [#9741](#9741) - **(pipx)** preserve options when reinstalling tools by @risu729 in [#9663](#9663) - **(python)** skip redundant lockfile provenance verification by @risu729 in [#9739](#9739) - **(vfox)** run pre_uninstall hook by @risu729 in [#9662](#9662) ### 🚜 Refactor - **(schema)** extract tool options definition by @risu729 in [#9649](#9649) ### ⚡ Performance - **(aqua)** bake rkyv aqua package blobs by @risu729 in [#9535](#9535) ### 📦️ Dependency Updates - lock file maintenance by @renovate[bot] in [#9773](#9773) ### 📦 Registry - add vector ([github:vectordotdev/vector](https://github.com/vectordotdev/vector)) by @kquinsland in [#9761](#9761) - add oc and openshift-install (http backend) by @konono in [#9669](#9669) ### New Contributors - @konono made their first contribution in [#9669](#9669) - @kquinsland made their first contribution in [#9761](#9761)
## Why This is the same follow-up enabled by #9582 and extended by #9649: now that Tombi correctly tracks evaluated properties through referenced schemas, repeated env directive property schemas can be shared instead of copied into every object variant. The env schema has many repeated pieces: primitive env values, path/path-array handling, `tools`, `redact`, `required`, and age encryption fields. Keeping those inline makes the schema large and makes it easy for one directive form to drift from another. Reusing definitions keeps env object validation consistent across the main config schema and the generated task schema. ## What changed - Adds shared env schema definitions for primitive env values, path/path arrays, `tools`, `redact`, `required`, and age value/format fields. - Replaces repeated inline env and env-directive property schemas with refs to those definitions. - Expands Tombi coverage for env value objects, env file/source/path directives, age format validation, and directive `required` validation. - Inherits the #9649 test harness change that treats Tombi warnings as failures. ## Validation - `git diff --check` - Direct Tombi validation with `tombi@0.9.22` and `--error-on-warnings` for valid env value/directive cases and invalid age/directive cases. - Full e2e should run in CI; my earlier local targeted e2e run was stopped after the build step stalled behind another active cargo build on this machine. This PR was generated by an AI coding assistant. --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Why
#9582 restored the schema pattern we wanted for task objects: shared property definitions composed with
allOf, then closed withunevaluatedProperties. With Tombi pinned to a version that handles evaluated properties correctly, we can use the same pattern for tool option objects.The top-level
[tools]schema and tasktoolsschema both describe the same{ version, os }object shape, but with different extra-property rules. Duplicating the common part makes it easy for those two locations to drift. This PR extracts the sharedversion/ospiece and lets each call site keep its own closure behavior.What changed
$defs.tool_optionsschema for the commonversionandosfields.Validation
git diff --checktombi@0.9.22and--error-on-warningsfor valid root/task tool options and invalid task tool extra options.This PR was generated by an AI coding assistant.