Add JSON Schemas for features - #62
Open
ppkarwasz wants to merge 1 commit into
Open
Conversation
Member
Author
|
Personally I would like to validate the |
Member
|
Nice. I think this schema could also be used to validate asf.yaml when it is parsed. And I think - keeping the schema in here in github with "raw" URL is probably not a bad idea? |
ppkarwasz
force-pushed
the
feat/json-schema
branch
from
August 13, 2026 11:48
dac2d49 to
f2452ef
Compare
Documents the .asf.yaml configuration format as draft-07 JSON Schemas. Each feature's schema lives next to the Python module that validates it, and the root schema composes them through relative $ref, so a feature and its schema can evolve in the same place. The $id of each file is its raw.githubusercontent.com URL and mirrors its path in the repository, which makes the refs resolve both on disk and over HTTP. A new test module checks every schema against the draft-07 metaschema, enforces the $id/path mirroring, and validates known-good and known-bad .asf.yaml samples against the root schema with all refs resolved offline. Assisted-By: Claude Fable 5 <noreply@anthropic.com>
ppkarwasz
force-pushed
the
feat/json-schema
branch
from
August 13, 2026 11:51
f2452ef to
2967607
Compare
ppkarwasz
marked this pull request as ready for review
August 13, 2026 16:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change documents the available
.asf.yamloptions as composable draft-07 JSON Schemas.Since features live in separate Python modules, the schemas are composable too: each feature's schema sits next to the module that validates it (e.g.
asfyaml/feature/notifications.schema.json,asfyaml/feature/github/rulesets.schema.json), and the rootasfyaml/asfyaml.schema.jsonwires them together through relative$refs. The$idof every file is itsraw.githubusercontent.comURL and mirrors its path in the repository, so refs resolve both on disk and over HTTP. Editors can therefore validate a repository's.asf.yamlwith a single comment:# yaml-language-server: $schema=https://raw.githubusercontent.com/apache/infrastructure-asfyaml/refs/heads/main/asfyaml/asfyaml.schema.jsonCoverage matches the current validators on
main: all root keys (meta,notifications,project,github,pelican,jekyll,publish,staging), the fullgithubfeature set (branch protection, rulesets in both raw and convenience styles, deployment environments, merge buttons, custom subjects, pull requests, Copilot code review, etc.), and constraints that are only enforced at runtime today (enums, label limits,wait_timerrange, ASF mailing list pattern).A new test module (
tests/json_schema.py) checks every schema against the draft-07 metaschema, enforces the$id/path mirroring, and validates known-good and known-bad.asf.yamlsamples with all refs resolved offline.jsonschemais added as a test-only dependency.