cli/compose/schema: migrate to github.com/santhosh-tekuri/jsonschema/v6 - #7195
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
9b7a816 to
6c0a976
Compare
6c0a976 to
a5df6d7
Compare
There was a problem hiding this comment.
Pull request overview
Migrates Compose schema validation to jsonschema/v6, updating error formatting and vendored dependencies.
Changes:
- Replaces
gojsonschemavalidation and custom error handling. - Updates schema and loader test expectations.
- Vendors
jsonschema/v6and requiredx/textpackages.
Reviewed changes
Copilot reviewed 5 out of 123 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| vendor/modules.txt | Updated as part of this pull request. |
| vendor/golang.org/x/text/message/message.go | Updated as part of this pull request. |
| vendor/golang.org/x/text/message/doc.go | Updated as part of this pull request. |
| vendor/golang.org/x/text/message/catalog/dict.go | Updated as part of this pull request. |
| vendor/golang.org/x/text/message/catalog.go | Updated as part of this pull request. |
| vendor/golang.org/x/text/language/tags.go | Updated as part of this pull request. |
| vendor/golang.org/x/text/language/doc.go | Updated as part of this pull request. |
| vendor/golang.org/x/text/language/coverage.go | Updated as part of this pull request. |
| vendor/golang.org/x/text/internal/tag/tag.go | Updated as part of this pull request. |
| vendor/golang.org/x/text/internal/stringset/set.go | Updated as part of this pull request. |
| vendor/golang.org/x/text/internal/number/roundingmode_string.go | Updated as part of this pull request. |
| vendor/golang.org/x/text/internal/number/number.go | Updated as part of this pull request. |
| vendor/golang.org/x/text/internal/number/common.go | Updated as part of this pull request. |
| vendor/golang.org/x/text/internal/match.go | Updated as part of this pull request. |
| vendor/golang.org/x/text/internal/language/tags.go | Updated as part of this pull request. |
| vendor/golang.org/x/text/internal/language/match.go | Updated as part of this pull request. |
| vendor/golang.org/x/text/internal/language/coverage.go | Updated as part of this pull request. |
| vendor/golang.org/x/text/internal/language/compose.go | Updated as part of this pull request. |
| vendor/golang.org/x/text/internal/language/compact/tags.go | Updated as part of this pull request. |
| vendor/golang.org/x/text/internal/language/compact/compact.go | Updated as part of this pull request. |
| vendor/golang.org/x/text/internal/language/compact.go | Updated as part of this pull request. |
| vendor/golang.org/x/text/internal/language/common.go | Updated as part of this pull request. |
| vendor/golang.org/x/text/internal/internal.go | Updated as part of this pull request. |
| vendor/golang.org/x/text/internal/format/format.go | Updated as part of this pull request. |
| vendor/golang.org/x/text/internal/catmsg/varint.go | Updated as part of this pull request. |
| vendor/golang.org/x/text/feature/plural/message.go | Updated as part of this pull request. |
| vendor/golang.org/x/text/feature/plural/common.go | Updated as part of this pull request. |
| vendor/github.com/xeipuuv/gojsonschema/utils.go | Updated as part of this pull request. |
| vendor/github.com/xeipuuv/gojsonschema/types.go | Updated as part of this pull request. |
| vendor/github.com/xeipuuv/gojsonschema/subSchema.go | Updated as part of this pull request. |
| vendor/github.com/xeipuuv/gojsonschema/schemaType.go | Updated as part of this pull request. |
| vendor/github.com/xeipuuv/gojsonschema/schemaReferencePool.go | Updated as part of this pull request. |
| vendor/github.com/xeipuuv/gojsonschema/schemaPool.go | Updated as part of this pull request. |
| vendor/github.com/xeipuuv/gojsonschema/schemaLoader.go | Updated as part of this pull request. |
| vendor/github.com/xeipuuv/gojsonschema/result.go | Updated as part of this pull request. |
| vendor/github.com/xeipuuv/gojsonschema/LICENSE-APACHE-2.0.txt | Updated as part of this pull request. |
| vendor/github.com/xeipuuv/gojsonschema/jsonContext.go | Updated as part of this pull request. |
| vendor/github.com/xeipuuv/gojsonschema/internalLog.go | Updated as part of this pull request. |
| vendor/github.com/xeipuuv/gojsonschema/glide.yaml | Updated as part of this pull request. |
| vendor/github.com/xeipuuv/gojsonschema/.travis.yml | Updated as part of this pull request. |
| vendor/github.com/xeipuuv/gojsonschema/.gitignore | Updated as part of this pull request. |
| vendor/github.com/xeipuuv/gojsonreference/reference.go | Updated as part of this pull request. |
| vendor/github.com/xeipuuv/gojsonreference/README.md | Updated as part of this pull request. |
| vendor/github.com/xeipuuv/gojsonreference/LICENSE-APACHE-2.0.txt | Updated as part of this pull request. |
| vendor/github.com/xeipuuv/gojsonpointer/README.md | Updated as part of this pull request. |
| vendor/github.com/xeipuuv/gojsonpointer/pointer.go | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/vocab.go | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/schema.go | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/root.go | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/README.md | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/position.go | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/output.go | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2020-12/schema | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2020-12/meta/validation | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2020-12/meta/unevaluated | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2020-12/meta/meta-data | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2020-12/meta/format-assertion | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2020-12/meta/format-annotation | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2020-12/meta/core | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2020-12/meta/content | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2020-12/meta/applicator | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2019-09/schema | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2019-09/meta/validation | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2019-09/meta/meta-data | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2019-09/meta/format | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2019-09/meta/core | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2019-09/meta/content | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2019-09/meta/applicator | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft-07/schema | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft-06/schema | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft-04/schema | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/loader.go | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/LICENSE | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/go.work.sum | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/go.work | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/content.go | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/.pre-commit-hooks.yaml | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/.golangci.yml | Updated as part of this pull request. |
| vendor/github.com/santhosh-tekuri/jsonschema/v6/.gitmodules | Updated as part of this pull request. |
| vendor.sum | Updated as part of this pull request. |
| vendor.mod | Updated as part of this pull request. |
| cli/compose/schema/schema_test.go | Updated as part of this pull request. |
| cli/compose/loader/loader_test.go | Updated as part of this pull request. |
Suppressed comments (2)
cli/compose/schema/schema.go:129
reflect.Value.String()returns the underlying value only for string-kind values; for an integer or interface map key it produces placeholders such as"<int Value>"or"<interface {} Value>". That changes/collapses non-string keys during conversion and can make malformed nested YAML mappings validate under permissivepatternProperties. Convert supported key values explicitly (or reject non-string keys) instead of usingValue.String().
cli/compose/schema/schema.go:97- The migrated validator registers a custom
durationformat here, but the schema and loader tests do not exercise either an accepted or rejected duration. Add a regression case such as an invalidstop_grace_periodso this format registration andtime.ParseDurationpath are covered.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
a5df6d7 to
8c9a7cd
Compare
8c9a7cd to
8ce3fa0
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 123 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
cli/compose/schema/schema.go:93
- The Compose schemas mark every
exposeitem withformat: "expose", but this compiler only registersportsandduration. In jsonschema/v6 an unknown format leavesSchema.Formatunset, so invalid values such as65536or8080:9090are accepted here and no later loader step validatesexpose. Please register a checker implementing the Compose expose grammar (or remove the schema annotation if this validation is intentionally unsupported).
cli/compose/schema/schema.go:237 - This selection stops at a nested
oneOfbecauseflattenErrorsdeliberately treatskind.OneOfas a leaf. For example, the invalidnetworks.default: bridgecase inTestNonMappingObjectreaches the inner object/nulloneOf, sogetDescriptionreceives that combinator aserr.parentand reportsnetworks.default: 'oneOf' failed, none matchedinstead of the test's expected type description. Descend through nestedoneOf/anyOfcauses before formatting the selected error.
8ce3fa0 to
1513c59
Compare
1513c59 to
394d340
Compare
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
29d6ac2 to
eed270f
Compare
|
Thx! This module is now also used by the upcoming CDI release, so using the same can prevent some duplicates :) |
Size is slightly larger, but not dramatic (+514,560 bytes);
Before/after
- What I did
- How I did it
- How to verify it
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)