github cue-lang/cue v0.11.0-alpha.1

pre-release13 days ago

This release includes a new matchN built-in validator, many fixes for the new evaluator, and a significant amount of work on JSON Schema.

Evaluator

A number of crashes, regressions, and other bugs have been fixed in the new evaluator, which can be enabled by CUE_EXPERIMENT=evalv3. For more details, see our latest performance update. Thanks to all who have tested the new evaluator and reported bugs!

CL 1198922 adds a new matchN built-in validator, necessary implement a host of validators such as the JSON Schema equivalents of not, oneOf, and anyOf. See the new how-to guide for it.

CL 1199898 relaxes the evaluator to allow referencing required fields via selectors, rather than failing like we do with optional fields. This should help with the transition of CUE schemas from regular to required fields, such as those decoded from JSON Schema.

CL 1200221 removes support for arithmetic operators on lists, and CL 1200221 teaches cue fix to rewrite most of them. We have added a doc page with more details and examples.

CL 1199684 teaches the evaluator to allow non-concrete values to be passed as parameters to certain builtin functions such as yaml.Validate.

CL 1199723 deduplicates errors when pairwise-combining them, as the duplication could result in large memory usage.

Modules

CL 1199541 wraps up the CUE modules experiment by dropping support for CUE_EXPERIMENT=modules=0, now that the new mode has been the default since CUE v0.9.0, and we are not aware of any remaining regressions.

Go API

CL 1200507 deprecates astutil.Cursor.Import, which is now superseded by astutil.Sanitize.

Encodings

A significant amount of work has gone into improving JSON Schema support, fixing many bugs and producing better CUE output, as well as leveraging the new matchN builtin. While this work is still in progress, we already expect an overall improvement compared to v0.10.0. This work will also form the basis for CUE modules for well-known services that will be published to the Central Registry.

CL 1199938 teaches the TOML decoder to produce CUE nodes with positions, allowing errors to include positions within TOML files.

CL 1199541 wraps up the new YAML decoder experiment by dropping support for CUE_EXPERIMENT=yamlv3decoder=0, allowing the 8400 lines of code in internal/third_party/yaml to be removed.

Builtins

CL 1194425 tweaks the yaml.Validate and json.Validate functions to allow non-concrete CUE values as schema parameters.

CL 1199602 adds a list.MatchN function, surfacing the matchN built-in validator for use in the JSON Schema decoder.

CL 1199881 tweaks uuid.Valid so that it is consistent with uuid.Parse in terms of what UUID formats are accepted.

cmd/cue

CL 1199634 drops support for the deprecated short form of cue cmd; users of cue foo should now call cue cmd foo.

CL 1200351 fixes a bug in cue fix where it would not operate on directories with multiple packages.

CL 1200498 fixes a bug in cue fix where added imports would end up with mangled names.

CL 1200554 teaches cue fix to work on standard input and output, like other sub-commands.

Full list of changes since v0.10.0
  • internal/core/adt: add tests for validator dedupping by @mpvl in 2662ebe
  • internal/core/validate: fix validation of disjunctions for evalv3 by @mpvl in 2fb6f45
  • internal/ci: switch to '.yaml' workflow file extension by @myitcv in 2d329b5
  • internal/core/adt: ensure pattern is evaluated by @mpvl in e97c624
  • internal/core/adt: do not copy frozen flags by @mpvl in aeb3bf3
  • internal/core/adt: disable non-critical panic by @mpvl in 8ebddc1
  • internal/ci: set GOTOOLCHAIN=local as part of installGo by @myitcv in bb24c7c
  • encoding/jsonschema: add OpenAPI 3.0 version support by @rogpeppe in d7852d7
  • all: remove support for list arithmetic by @cuematthew in 46fb300
  • internal/astinternal: more compact representation of relative positions by @rogpeppe in 6f4983e
  • encoding/jsonschema: add keyword TODOs by @rogpeppe in 33fe828
  • encoding/jsonschema: implement "not" by @rogpeppe in e7175ba
  • internal/astinternal: simpler internal API by @rogpeppe in 32865bc
  • cmd/cue: remove mention of CUE_EXPERIMENT=modules from help by @rogpeppe in ecbcf34
  • internal/cueexperiment: prevent disabling modules experiment by @rogpeppe in a51a98f
  • pkg/tool/file: use 0o777 as the default Mkdir permissions by @mvdan in a7ccc0a
  • internal/envflag: support deprecated flags by @rogpeppe in 05b9b02
  • all: rely on umask when creating files and directories by @mvdan in 2da59f2
  • encoding/jsonschema: commit external test stats by @rogpeppe in d20e479
  • encoding/jsonschema: encode oneOf etc using matchN by @rogpeppe in bfce150
  • encoding/jsonschema: verify result is concrete in external tests by @rogpeppe in 2e19c1f
  • encoding/jsonschema: run external tests in matrix by @rogpeppe in e2685dd
  • encoding/jsonschema: prepare for matrix test runs by @rogpeppe in 9959a3e
  • encoding/jsonschema: add location information to test output by @rogpeppe in 1a2e26e
  • cmd/cue: support cue fix - to fix CUE via stdin and stdout by @mvdan in c0fdf75
  • all: remove mentions of cue-sh(/tools) by @myitcv in 67443fb
  • ast/astutil: deprecate Cursor.Import by @cuematthew in 691ee74
  • pkg/tool/exec: Run does not exececute shell commands by @mvdan in 1e65cee
  • tools/fix: avoid name-mangled imports by @cuematthew in 1440b9e
  • tools/fix: correct the ast walker so sub-expressions get fixed by @cuematthew in d0617b5
  • cmd/fix: allow fix to load all packages in a directory by @cuematthew in 5936450
  • internal/core/compile: various fixes to matchN by @mpvl in e505402
  • internal/core/adt: add tests for matchN by @mpvl in 30a8854
  • encoding/jsonschema: avoid test regressions by @rogpeppe in 9956f16
  • internal/core/adt: fix validators in embeddings by @mpvl in 3deadce
  • internal/core/adt: add tests to prepare for bug fix by @mpvl in 0ffb5d2
  • encoding/jsonschema: add external test suite by @rogpeppe in 484dd8e
  • internal/cuetdtest: move testing.T out of M by @rogpeppe in 3ae664e
  • cmd/cue: remove obsolete TODO about empty module paths by @mvdan in e48fb9d
  • cue: remove support for legacy protobuf attributes by @mvdan in 985855f
  • encoding/jsonschema: export Version by @rogpeppe in de41586
  • encoding/jsonschema: move txtar tests into subdirectory by @rogpeppe in df2c869
  • tools/fix: rewrite list addition and multiplication by @cuematthew in 3d36560
  • encoding/toml: decode syntax tree nodes with positions by @mvdan in b123f2b
  • encoding/toml: add debugprint txtar tests for the decoder by @mvdan in edc117e
  • internal/astinternal: print relative positions as well by @mvdan in 6e5ec5a
  • internal/astinternal: revise API with more options by @mvdan in ae3ad16
  • internal/core/adt: allow referencing required fields by @mpvl in 710b438
  • all: use a few more godoc links by @mvdan in a4ebf4d
  • internal/core/adt: add tests for referencing required fields by @mpvl in a525801
  • encoding/jsonschema: support minContains and maxContains keywords by @haoqixu in 4093ccf
  • cue: add a regression test for a default elimination bug fixed in evalv3 by @mvdan in dcfc2d4
  • cue: add regression test for a cycle error position bug fixed in evalv3 by @mvdan in 8908d06
  • pkg/list: re-test with CUE_UPDATE=1 by @mvdan in 7e29e3d
  • encoding/jsonschema: add docs about test file conventions by @rogpeppe in 5409884
  • encoding/jsonschema: decode contains as list.MatchN by @haoqixu in 3138301
  • internal/astinternal: don't panic on nil pointers in DebugPrint by @mvdan in 221cfaf
  • internal/astinternal: add DebugPrint cuetxtar tests by @mvdan in 094b9e9
  • internal/astinternal: add DebugPrint from cue-ast-print by @mvdan in 937093c
  • cmd/cue: add mod registry example to help text by @mvdan in 9f620c2
  • all: remove obsolete TODOs assigned to me by @mvdan in eeec3f5
  • cue/literal: use strings.Repeat directly by @mvdan in 0389e8a
  • internal/core/adt: fix bug that ignores field type by @mpvl in a3f1a0f
  • internal/core/adt: require nodes for indexing by @mpvl in 196dc98
  • internal/core/adt: expose v3 optional field bug by @mpvl in 4967eb4
  • pkg/uuid: use google/uuid.Validate in Valid by @mvdan in e525f29
  • pkg/uuid: add more valid and invalid test cases by @mvdan in a19cab1
  • internal/core/adt: switch on DebugDeps for TestEvalAlpha by @mpvl in 9aabfcb
  • pkg/list: add MatchN validator function by @haoqixu in 48431d8
  • all: resolve a few more staticcheck warnings by @mvdan in 2f19b1a
  • all: remove last unnecessary uses of cue.Runtime by @mvdan in 68f856f
  • all: make use of stringer in more places by @mvdan in a20e523
  • internal: adapt to testing.TB.Context in Go 1.24 by @mvdan in b5ac87c
  • internal/encoding: use encoding/yaml rather than pkg/encoding/yaml by @mvdan in 186b6e2
  • cmd/cue: add testscript to cover exporting CUE comments by @mvdan in d2ce0e3
  • internal/pkg: make Schema an alias for cue.Value by @mvdan in c8f5a21
  • cue/benchmarks: move benchmark code out of testdata by @cuematthew in d52859e
  • internal/core/adt: allow any CUE value in json/yaml.Validate by @NoamTD in 1b01c83
  • internal/cuetxtar: simplify ordering by @mpvl in 2a84338
  • internal/cuetxtar: fix ordering bug by @mpvl in eb3b539
  • encoding/jsonschema: support instance tests by @rogpeppe in bbe2f81
  • encoding/jsonschema: more consistent test data by @rogpeppe in cb1dc6b
  • internal/core/adt: fix COMP counter issue by @mpvl in 43d722b
  • internal/core/adt: decrement counter for defunct tasks by @mpvl in 6335c46
  • internal/core/adt: do not finalize let by @mpvl in 3965579
  • internal/cuetxtar: ensure ordering of files in txtar is consistent by @mpvl in 358b945
  • pkg/encoding/yaml: add more validation tests by @mpvl in f889101
  • internal/core/adt: allow non-concrete values in builtins by @mpvl in 8326e67
  • pkg: add some tests that pick defaults in builtins by @mpvl in 0a41a20
  • core/adt: identify duplicate errors when pairwise-combining by @cuematthew in 5a77ce1
  • evaluator: regression test for order independent eval fixed in evalv3 by @myitcv in 81d6f8b
  • internal/core/compile: add matchN builtin validator by @mpvl in 1c2b105
  • internal/core/adt: fix disjunctions in data mode by @mpvl in 769f37a
  • encoding/jsonschema: avoid unnecessary alias to root by @rogpeppe in ae3987d
  • cmd/cue: drop support for the deprecated short form of cue cmd by @mvdan in 4eb3d53
  • cmd/cue: refactor help texts and topics by @mvdan in 7e589e3
  • cmd/cue: skip the mod_registry testscript as it's flakey by @mvdan in 54ef570
  • cmd/cue-ast-print: allow reading stdin by @rogpeppe in b52cd92
  • encoding/jsonschema: support boolean-valued schemas by @rogpeppe in 616f91a
  • encoding/jsonschema: better version support by @rogpeppe in 67f508f
  • internal/ci: update goreleaser version by @mvdan in 98a17d4
  • all: remove two deprecated APIs by @mvdan in ea43f81
  • internal/third_party/yaml: delete the old YAML decoder by @mvdan in 4dbaf28
  • cmd/cue: prepare get go for GODEBUG=gotypesalias=1 by @mvdan in a9ce855
  • internal/cueversion: bump for v0.11 by @mvdan in 0b27120
  • internal/core/export: update via CUE_UPDATE=1 go test by @mvdan in 938c8de

Don't miss a new cue release

NewReleases is sending notifications on new releases.