Skip to content

馃悰 fix(schema): declare prefix in the labeled factor group's not clause - #4051

Merged
gaborbernat merged 2 commits into
tox-dev:mainfrom
gaborbernat:fix-schema-strict-required
Aug 28, 2026
Merged

馃悰 fix(schema): declare prefix in the labeled factor group's not clause#4051
gaborbernat merged 2 commits into
tox-dev:mainfrom
gaborbernat:fix-schema-strict-required

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Aug 28, 2026

Copy link
Copy Markdown
Member

The JSON Schema tox publishes for editors stopped compiling under SchemaStore's validator, so the 4.61.0 sync failed and editors still get the schema from 4.56.0 (SchemaStore/schemastore#6265).

The rule that keeps a bare range from reading as a labeled factor group had a form their validator tolerated by luck. Giving labeled groups ranges and value tables in 4.61 tipped it over. The rule now takes a form they accept, and what the schema allows does not change: a labeled list, a labeled range, a labeled values table, a bare range dict and a two-key table each validate as before.

Nothing on the way to a release compiled the schema the way SchemaStore does, so this could only appear after the tag shipped. Every pull request that changes the schema now runs it through their validator, and the release sync runs it again before opening a pull request there, so a schema they would reject can no longer reach a release.

SchemaStore compiles the published schema with ajv strict mode, which
refuses a `required` naming a property the schema never declares. The
labeled factor group has said `not: {required: [prefix]}` since April to
keep a bare range dict from reading as a label, and ajv had been
satisfied by `prefix` reaching it from an inlined sibling. Adding the
range and values shapes to its `additionalProperties` in 4.61 changed
how ajv inlines, the property stopped arriving, and the release sync PR
failed to compile.

Declaring `prefix` inside the `not` with an empty schema names it for
strict mode while constraining nothing, so validation is unchanged. The
new test walks the committed schema for the same defect, since neither
the freshness check nor the tombi lint compiles the schema this way.
@gaborbernat gaborbernat added bug:normal affects many people or has quite an impact area:configuration labels Aug 28, 2026
The schema reached SchemaStore only on a release tag, and nothing on the
way there compiled it the way SchemaStore does: the freshness test
compares generator output against the committed file, and the tombi
tests validate TOML documents rather than the schema itself. A schema
that ajv strict mode rejects therefore surfaced as a failed sync pull
request after the release had shipped.

The sync workflow now clones SchemaStore, stages tox's schema and runs
their checker for it, on every pull request touching the schema and
again before the release sync opens a pull request.
@gaborbernat
gaborbernat force-pushed the fix-schema-strict-required branch from 7e6b28f to f6e47a7 Compare August 28, 2026 22:42
@gaborbernat
gaborbernat marked this pull request as ready for review August 28, 2026 22:46
@gaborbernat
gaborbernat enabled auto-merge (squash) August 28, 2026 22:46
@gaborbernat
gaborbernat merged commit cd8c1fa into tox-dev:main Aug 28, 2026
32 checks passed
@gaborbernat
gaborbernat deleted the fix-schema-strict-required branch August 28, 2026 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:configuration bot:chronographer:provided bug:normal affects many people or has quite an impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant