Replace JSON schema validation in CI with Go test#4848
Merged
shreyas-goenka merged 12 commits intomainfrom Mar 27, 2026
Merged
Conversation
Remove the ajv-cli npm dependency from CI and replace it with a Go test using santhosh-tekuri/jsonschema/v6. This validates the generated bundle schema against pass/fail test cases entirely in Go. Co-authored-by: Isaac
Transform the nested $defs structure (which mirrors Go import paths) into flat keys before passing to the Google library, and rewrite $ref values to use JSON Pointer ~1 escaping for the flattened keys. Co-authored-by: Isaac
Co-authored-by: Isaac
Collaborator
|
Commit: f79d99f
17 interesting tests: 10 SKIP, 7 KNOWN
Top 24 slowest tests (at least 2 minutes):
|
Co-authored-by: Isaac
Check value types instead of matching against a keyword list. Intermediate nesting nodes only have map[string]any values, while schema definitions always have at least one non-object value (string, array, bool, etc.). Co-authored-by: Isaac
Co-authored-by: Isaac
$defs keys are Go package paths and never contain ~. Co-authored-by: Isaac
Use a table mapping each fail test file to the expected schema location in the error. Also fail if a new test file is added without a table entry. Co-authored-by: Isaac
Co-authored-by: Isaac
Use a table mapping each fail test file to the expected schema location in the error. Also fail if a new test file is added without a table entry. Co-authored-by: Isaac
Co-authored-by: Isaac
Suggested reviewersBased on git history of the changed files, these people are best suited to review:
Confidence: medium Eligible reviewersBased on CODEOWNERS, these people or teams could also review: @andrewnester, @anton-107, @denik Suggestions based on git history of 4 changed files (3 scored). See CODEOWNERS for path-specific ownership rules. |
shreyas-goenka
commented
Mar 26, 2026
pietern
reviewed
Mar 27, 2026
pietern
approved these changes
Mar 27, 2026
Move google/jsonschema-go require into main deps section, add NOTICE entry under MIT section, and document why fail tests only assert on schema path (oneOf wrapping discards branch-specific errors). Co-authored-by: Isaac
Collaborator
|
Commit: e5c1351
59 interesting tests: 26 flaky, 15 RECOVERED, 9 KNOWN, 7 FAIL, 2 SKIP
Top 50 slowest tests (at least 2 minutes):
|
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.
Summary
ajv-clinpm dependency from CI workflowbundle/schema/validate_test.go) usinggoogle/jsonschema-gothat validates the generated bundle schema against the existing pass/fail test data files$defsstructure (mirroring Go import paths) is flattened into flat keys with$refvalues rewritten to use JSON Pointer~1escaping, for compatibility with the Google libraryTest plan
go test ./bundle/schema/ -vpasses all tests (12 pass cases, 14 fail cases)This pull request was AI-assisted by Isaac.