Releases: cue-lang/cue
v0.13.0-alpha.1
This release brings a new cue trim
algorithm, a performance fix for field ordering, two new commands, and many fixes.
Changes which may break some users are marked below with:
Evaluator
A great deal of work has happened in the new evaluator, which can be used via CUE_EXPERIMENT=evalv3
. Marcel recently posted another update on performance progress.
An entirely new algorithm for cue trim
and tools/trim
has been implemented for CUE_EXPERIMENT=evalv3
, which resolves all known bugs when trimming CUE. Give it a try and report any issues you find.
The parser now correctly allows keywords as required field labels such as if!: _
, fixing a discrepancy with the spec.
cmd/cue
The new cue refactor imports
command rewrites import paths, making it easy to migrate between module locations and major versions.
The new cue mod mirror
command copies modules from one registry to another.
cue get go
should no longer attempt to import types from the Go standard library as CUE, which caused errors.
Hidden files and files with build tags should now be correctly filtered when loading a single CUE package.
Encodings
Loading binary files, such as via @embed(file="foo", type=binary)
, no longer requires the input to be valid UTF-8.
encoding/jsonschema.Config.DefineSchema
.
Go API
cue.Runtime
methods Parse
, FromExpr
, CompileFile
, and CompileExpr
are now removed.
module.SplitPathVersion
and module.ParseImportPath
have been deprecated in favor of cue/ast.SplitPackageVersion
and cue/ast.ParseImportPath
package to consolidate the API.
The new mod/module.Version.Compare
method is added in favor of module.Sort
, which is now deprecated.
The new mod/modfile.File.ModuleForImportPath
function allows resolving a module and default major version for a package without consulting a registry.
The new mod/modregistry.Client.Mirror
method implements the logic behind the new cue mod mirror
command.
Full list of changes since v0.12.0
- encoding/jsonschema: support x-kubernetes-embedded-resource by @rogpeppe in 0cd0a0c
- encoding/jsonschema: initial support for Kubernetes CRDs by @rogpeppe in 0dcaff5
- cmd/cue: mention --inject-vars/-T flag for injection help by @myitcv in 90c1965
- cue/load: respect build tags when determining package by @rogpeppe in 58e09ee
- internal/mod/modimports: exclude hidden CUE files by @rogpeppe in 8f2c89c
- cmd/cue, internal/mod/modimports: add test cases for issue 3795 by @rogpeppe in 2742aba
- cue/load: use iterator range by @rogpeppe in 9ba4189
- mod/module: add Version.Compare by @mvdan in 931fecb
- all: start making more use of strings.Cut by @mvdan in 7d62514
- all: unconvert -apply ./... by @mvdan in cbed854
- internal/ci: update Go and goreleaser by @mvdan in bebbaa9
- core/toposort: stop trying to order structinfos/structlits by @cuematthew in bc6c485
- internal/cuetxtar: Append \n to generated txtar file content by @cuematthew in 5d2da07
- cmd/cue: adjust the detection of Go standard library packages by @mvdan in 153fc8a
- cmd/cue: actually drop unsupported Go std types in
get go
by @mvdan in 97cbf7e - cmd/cue: add testscript reproducing get go issues with std packages by @mvdan in 9a53c81
- internal/_e2e: remove unused CUE_REGISTRY_TOKEN env var by @mvdan in 239f3d3
- encoding/jsonschema: delete code for Go 1.22 by @mvdan in 24e90ed
- update golang.org/x dependencies by @mvdan in b6618cc
- update various dependencies unlikely to cause breakage by @mvdan in 66f9e79
- all: use a few more newer std APIs by @mvdan in 538fb69
- core/toposort: Do not calculate cycles within an SCC by @cuematthew in d73e690
- cue/parser: allow
if
as a label for a required field by @haoqixu in 18367a6 - encoding/jsonschema: support single schema not at root by @rogpeppe in cdc4123
- cmd/cue: fix refactor imports over multiple modules by @rogpeppe in 7cc1de3
- cue.mod: use exp3 curated modules by @myitcv in fca4a5f
- internal/core/adt: fix counter issue by @mpvl in a0c6dfe
- internal/core/adt: fix edge case in structural cycles with structure sharing by @mpvl in 966a504
- internal/core/adt: fix structural cycle stack overflow by @mpvl in a66eaf3
- internal/core/adt: remove Inline check by @mpvl in 7bb676e
- internal/core/adt: make inline expressions addressable by @mpvl in 35ec59b
- encoding/openapi: convert remaining cue->json tests to txtar by @cuematthew in ba1084a
- encoding/openapi: convert test suite to txtar by @cuematthew in 374c59e
- internal/core/adt: do not hasNonCycle in one case by @mpvl in 52c02d0
- internal/core/adt: refactor unifyNode by @mpvl in e55c7a8
- internal/core/adt: add tests for issue 3634 by @mpvl in 8ed768a
- internal/encoding: don't interpret files as UTF8 with the binary encoding by @nichtsundniemand in 0b36c4e
- cue/interpreter/embed: remove obsolete TODOs by @mvdan in 8585568
- cmd/cue/cmd: show incorrect handling of binary files when embedded by @nichtsundniemand in 073d23c
- encoding/jsonschema: pass comments to DefineSchema by @rogpeppe in 880023b
- Revert "encoding/jsonschema: pass comments to DefineSchema" by @mvdan in b6f250e
- internal/core/adt: propagate default marker in single nested value by @mpvl in 26a698f
- cmd/cue: stop marking the login command as experimental by @mvdan in 324b3da
- internal/core/adt: add tests for issue 3779 by @mpvl in 8b80c3d
- cmd/cue: embed support is no longer experimental by @mvdan in dce7fda
- encoding/jsonschema: pass comments to DefineSchema by @rogpeppe in 7a3708e
- cue/parser: allow
for
as label for required field by @haoqixu in fc8791f - mod/modregistrytest: move from internal/registrytest by @mvdan in b14cfde
- internal/core/adt: fix FromDef by @mpvl in df327a6
- cmd/cue/cmd: add test for edge case by @mpvl in 587d5a1
- internal/core/adt: shorten closeContext graph depth by @mpvl in b17ea50
- all: start using slices.Backward by @mvdan in 66d4c35
- internal/vcs: use os.CopyFS from Go 1.23 by @mvdan in 873afd5
- cue: tweak cue.Value.Decode with Go std changes by @mvdan in 4e0cc47
- internal/core/adt: remove unnecessary clearing of CloseInfo by @mpvl in 3ed6d8d
- internal/core/adt: hoist feature checking logic by @mpvl in ae5a017
- internal/core/adt: do not add arc dependencies for some nodes by @mpvl in 98a3f93
- internal/core/adt: prepare for shortening root by @mpvl in 58b3e7d
- internal/core/adt: add test for closeContext graph shortening by @mpvl in 0d33c2e
- internal/core/adt: simplify ellipsis logic by @mpvl in 694d295
- internal/core/adt: fix bug when merging closing struct with ellipsis by @mpvl in 7822519
- internal/core/adt: add ...
v0.12.0
This release fixes dozens of bugs in the new evaluator, enables the embed
and toposort
experiments by default, further improves JSON Schema support, and introduces cue exp gengotypes
.
Changes which may break some users are marked below with:
Evaluator
CL 1205861 enables the Embedding proposal via CUE_EXPERIMENT=embed
by default, given that the proposal was accepted in late December.
Since v0.11.0, an experimental "topological sorting" of struct fields has been available via CUE_EXPERIMENT=toposort
; this release enables the experiment by default. Topological sorting produces a more principled ordering of fields as produced by cue export
and cue eval
. The intent is to ensure the old and new evaluators order struct fields in the same way, in order to build confidence and ease the transition to the new evaluator.
We encourage all CUE users to update to this release and switch to topological sorting for their CUE outputs. An issue for gathering feedback is available, should you run into any issues.
A great deal of work has happened in the new evaluator, which can be used via CUE_EXPERIMENT=evalv3
. Marcel also recently posted another update on performance progress. Below is a selection of particularly relevant changes in the new evaluator.
CLs 1204490, 1204669, and 1205368 resolve a number of significant performance issues spotted in the new evaluator.
CLs 1206123, 1206178, 1206284, 1206321, 1206385, and 1207910 fix a number of disjunction issues leading to incorrect behavior in the new evaluator.
CLs 1206327, 1206383, and 1206384 fix a number of cycle issues leading to incorrect errors in the new evaluator.
CLs 1206823, 1207237, 1207314, 1204365, 1205361, 1205363, and 1207714 fix a number of closedness issues which resulted in missing or incorrect errors in the new evaluator.
CL 1207912 fixes a regression which could cause "not properly initialized" errors in the new evaluator.
CLs 1206926, 1207169, 1207263, 1207545, and 1207715 fix panics which were recently discovered.
CL 1205862 sorts conjuncts in binary expressions to reduce ordering differences between evaluator versions.
CL 1207908 ensures that conversions of Go values to CUE respect struct field order, for the sake of topological sorting.
CL 1207907 ensures that converting Go arrays to CUE uses list.Repeat
rather than the now-removed list arithmetic syntax.
CL 1204491 introduces CUE_DEBUG=openinline
, enabled by default, which emulates the old evaluator's incorrect closedness behavior in some edge cases. This should help the transition towards the new evaluator, and allow us to fix the behavior of these edge cases in future CUE releases.
CL 1204608 introduces CUE_DEBUG=sortfields
which sorts all struct fields lexicographically. This replaces CUE_DEBUG_SORT_ARCS=1
, which did not work with the new evaluator.
Go API
CUE_EXPERIMENT=decodeint64
by default, causing cue.Value.Decode
to choose int64
rather than int
as the default Go type for CUE integer values.
CL 1206368 adds a cue/token.Pos.Compare
method to allow comparing two positions, for example to sort via slices.SortFunc
.
CL 1207007 adds encoding/jsonschema.Config.AllowNonExistentRoot
to prevent an error when no value is found at the Config.Root
path.
Builtins
CL 1204378 teaches list.UniqueItems
to handle incomplete values correctly, fixing a bug in JSON Schema.
CL 1204425 fixes list.MatchN
so that it matches final values, like the matchN
evaluator built-in, fixing a bug in JSON Schema.
cue.Value.IsClosed
method.
cue.Instance.Doc
method.
cue/load.Config.BuildTags
field.
cmd/cue
CL 1207142 adds the new command cue mod rename
to aid in changing the module path of the current module.
cue eval
and cue vet
.
CL 1204111 fixes some edge cases where CUE comments were lost or duplicated, particularly with cue def
.
CL 1204874 re-enables command suggestions when a user makes a typo like cue exprot
.
CL 1206784 fixes an issue where arguments and flags in cue cmd
could not be interspersed, unlike other subcommands.
Encodings
The new experimental command cue exp gengotypes
allows generating Go type definitions derived from exported CUE schemas. This can be a nice alternative to cue get go
for projects developing both CUE and Go, if one wishes to maintain the source of truth for shared schemas in CUE. cue exp gengotypes
is generally more reliable than cue get go
, given that Go's type system is not as powerful.
JSON Schema spec compatibility is improved further by fixing a number of bugs and adding missing features. Notably, it now supports arbitrary references to internal structure in $ref
. JSON Schema's spec test suite has gone from a "pass" rate of 75% to 79% thanks to these efforts.
Full list of changes since v0.11.0
- core/toposort: Correct CloseInfo Decl by @cuematthew in db9cc73
- cmd/cue: stop help text implying support for globs by @jpluscplusm in 870bfc2
- core/convert: Correct conversion of array types by @cuematthew in 8dc16dd
- cue/testdata: update out/eval/stats after concurrent merges by @mvdan in e9ad52f
- core/convert: Ensure Go -> CUE conversion respects struct field order by @cuematthew in 60c33d8
- internal/core/adt: force finalizing of shared values by @mpvl in f752335
- internal/core/adt: add tests for 3648 by @mpvl in 72c7c27
- internal/core/adt: finalize disjunctions once known by @mpvl in 4f4e4d5
- internal/core/adt: add test for issue 3699 by @mpvl in 06f2f87
- cue: clean up how we marshal CUE numbers as JSON by @mvdan in 5cf504f
- internal/core/adt: fix completion-related counter issue by @mpvl in 98692a5
- internal/core/adt: fix sharing-related counter issue by @mpvl in 105b8b7
- internal/core/adt: fix EVAL counter issue by @mpvl in a833722
- internal/core/adt: fix disjunction counter issue by @mpvl in ad7b84b
- internal/core/adt: fix disjunction error counter issue by @mpvl in 079442c
- core/toposort: Stop using RawString by @cuematthew in f53f655
- internal/core/adt: remove closedness for ToDataAll by @mpvl in 1ac3fe0
- internal/core/adt: add tests for issue 3694 by @mpvl in f02d1f1
- enable one more staticcheck check by @mvdan in 17c5d0b
- update golang.org/x/... by @mvdan in 2efb244
- internal/ci: update pinned Go for the next release by @mvdan in 775ce67
- internal/core/adt: fix name of method by @mpvl in ac4c7d0
- internal/core/adt: several logging improvements by @mpvl in 62b3005
- internal/core/dep: fix handling sharing in non-rooted nodes by @mpvl in c8170aa
- all: enable toposort by default by @cuematthew in f8defbb
- internal/core: search harder for BinExprs in toposort by @cuematthew in 9caec6f
- cmd/cue: reject login --token="" by @mvdan in 6ada21c
- cmd/cue: add test for 3646 by @mpvl in 18f0ae8
- internal/core/adt: prevent e...
v0.12.0-rc.1
This release fixes more bugs in the new evaluator and toposort, in preparation for a final release.
Evaluator
A great deal of work has happened in the new evaluator, which can be used via CUE_EXPERIMENT=evalv3
. Marcel also recently posted another update on performance progress. Below is a selection of particularly relevant changes in the new evaluator since the last release.
CL 1207714 fixes a closedness issue which resulted in incorrect errors.
CL 1207910 fixes a disjunction issue which could cause incorrect "undefined field" errors.
CL 1207912 fixes a regression which could cause "not properly initialized" errors.
CL 1207715 fixes a panic which could occur in the new topological sorting of fields.
CL 1207908 ensures that conversion of Go values to CUE respect struct field order, for the sake of topological sorting.
CL 1207907 ensures that converting Go arrays to CUE uses list.Repeat
rather than the now-removed list arithmetic syntax.
v0.12.0-alpha.2
This release fixes many bugs in the new evaluator, enables the toposort experiment by default, and introduces cue exp gengotypes
.
Changes which may break some users are marked below with:
Evaluator
A great deal of work has happened in the new evaluator, which can be used via CUE_EXPERIMENT=evalv3
. Marcel also recently posted another update on performance progress. Below is a selection of particularly relevant changes in the new evaluator.
CLs 1206123, 1206178, 1206284, 1206321, and 1206385 fix a number of disjunction issues leading to incorrect behavior.
CLs 1206327, 1206383, and 1206384 fix a number of cycle issues leading to incorrect errors.
CLs 1206823, 1207237, and 1207314 fix a number of closedness issues which resulted in missing or incorrect errors.
CLs 1206926, 1207169, 1207263, and 1207545 fix panics which were recently discovered.
CL 1205862 sorts conjuncts in binary expressions to reduce ordering differences between evaluator versions.
Since v0.11.0, an experimental "topological sorting" of struct fields has been available via CUE_EXPERIMENT=toposort
. This release enables the experiment by default, in preparation for v0.12.0. Topological sorting produces a more principled ordering of fields as produced by cue export
and cue eval
. The intention is to ensure the old and new evaluators order struct fields in the same way, in order to build confidence and ease the transition to the new evaluator. An issue for gathering feedback is available.
Go API
CL 1206368 adds a cue/token.Pos.Compare
method to allow comparing two positions, for example to sort via slices.SortFunc
.
CL 1207007 adds encoding/jsonschema.Config.AllowNonExistentRoot
to prevent an error when no value is found at the Config.Root
path.
cmd/cue
CL 1207142 adds the new command cue mod rename
to aid in changing the module path of the current module.
CL 1206784 fixes an issue where arguments and flags in cue cmd
could not be interspersed, unlike other subcommands.
cue eval
and cue vet
.
Encodings
The new experimental command cue exp gengotypes
allows generating Go type definitions derived from exported CUE schemas. This can be a nice alternative to cue get go
for projects developing both CUE and Go, if one wishes to maintain the source of truth for shared schemas in CUE. cue exp gengotypes
is generally more reliable than cue get go
, given that Go's type system is not as powerful.
Full list of changes since v0.12.0-alpha.1
- update golang.org/x/... by @mvdan in 2efb244
- internal/ci: update pinned Go for the next release by @mvdan in 775ce67
- internal/core/adt: fix name of method by @mpvl in ac4c7d0
- internal/core/adt: several logging improvements by @mpvl in 62b3005
- internal/core/dep: fix handling sharing in non-rooted nodes by @mpvl in c8170aa
- all: enable toposort by default by @cuematthew in f8defbb
- internal/core: search harder for BinExprs in toposort by @cuematthew in 9caec6f
- cmd/cue: reject login --token="" by @mvdan in 6ada21c
- cmd/cue: add test for 3646 by @mpvl in 18f0ae8
- internal/core/adt: prevent early decrements in comprehensions by @mpvl in bdc2929
- internal/core/adt: decrement DEFER dependencies in overlay by @mpvl in 6b292d4
- internal/core/adt: break notification dependency on structural cycle by @mpvl in ae730eb
- internal/core/adt: fix counter related to close builtin by @mpvl in aa6781f
- internal/cueexperiment: keep all past experiments around by @mvdan in 74c12e0
- internal/core/adt: handle dependencies fully in overlay by @mpvl in e34f770
- internal/encoding/gotypes: ignore definitions or fields via
@go(-)
by @mvdan in 58a8351 - internal/encoding/gotypes: better support for CUE versus Go package names by @mvdan in a1d8099
- internal/core/adt: hoist dependency code by @mpvl in 7d159b3
- internal/core/adt: split ccArc by @mpvl in 4d3eafa
- internal/core/adt: prepare to differentiate types of arcs and notify by @mpvl in 44a2e75
- internal/core/adt: hoist dependency breaking code by @mpvl in ba0639e
- internal/core/adt: rename cc to dst by @mpvl in 43a313a
- internal/core/adt: split addDependency by @mpvl in 06f5289
- internal/core/adt: hoist dependency-related code into dep.go by @mpvl in f3d367a
- internal/core/adt: hoist closedness related code by @mpvl in db6a8b9
- internal/core/adt: move block of code by @mpvl in 6a60de5
- internal/core/adt: hoist dependency code from debug by @mpvl in fc9720c
- internal/core/adt: split closeContext.arcs by @mpvl in c2ebfdb
- internal/core/adt: simplify linkNotify by @mpvl in 13f38c9
- internal/core/adt: fix EVAL counter issue by @mpvl in 9f913e0
- internal/core/adt: fix counter issue by @mpvl in 0efb5e8
- internal/core/adt: add disjunction info as blob to debug output by @mpvl in c880efb
- internal/core/adt: fix constraints deduplication by @mpvl in 053f47b
- internal/core/adt: add test for 3638 by @mpvl in b1eaedd
- internal/core/adt: copy sharedID across disjunctions by @mpvl in 635d23b
- internal/core/adt: add test for 3679 by @mpvl in bdebb8a
- internal/core/adt: propagate completion signal if disjunction is resolved by @mpvl in 5ce7ba4
- internal/core/adt: add test for 3681 by @mpvl in 682462a
- internal/core/adt: always do decrement accounting by @mpvl in 8a73d2b
- internal/core/adt: add tests for 3672 and 3606 by @mpvl in d57d885
- internal/core/adt: add disjunction information in log header by @mpvl in fbfff68
- cmd/cue: fix a regression with
cue get go
dropping CUE files by @mvdan in b193af0 - cmd/cue: add a test case to reproduce #3644 by @mvdan in c94fd55
- internal/encoding/gotypes: disjunctions of many kinds are not TODOs by @mvdan in 4d852c8
- internal/encoding/gotypes: generate disjunctions of structs as a map by @mvdan in 97b24b2
- internal/core/adt: hoist logging-related code into separate file by @mpvl in d113c59
- internal/core/adt: initialize erroneous optional fields in disjunctions by @mpvl in 0ad6826
- internal/core/adt: remove pattern optimization by @mpvl in 05f5d76
- internal/core/adt: add test for 3670 by @mpvl in 9ee56f7
- internal/core/adt: fix validator closedness issue by @mpvl in 9e85cd7
- internal/core/adt: add tests for 3639 and 3661 by @mpvl in d0564de
- internal/core/adt: do not free vertex by @mpvl in 393e9fa
- internal/core/adt: reduce counter issues by @mpvl in ed235a8
- internal/core/adt: do not force externalDeps for disjunctions by @mpvl in 12437a2
- internal/core/adt: use explicit hole id by @mpvl in 681ec9f
- internal/encoding/gotypes: obey
@go(,type=)
for optional fields by @mvdan in f62bb36 - cmd/cue: add gengotypes test cases overriding a pointer type by @mvdan in 1b787cd
- cmd/cue: new command: cue mod rename by @rogpeppe in 416adfc
- encoding/jsonschema: do not generate defaults by @rogpeppe in fdf92d1...
v0.11.2
This release includes fixes for bugs which were uncovered and resolved in the last few weeks.
Evaluator
CL 1206279 fixes a regression in the old evaluator which could lead to "conflicting value" errors.
cmd/cue
CL 1207330 fixes a regression where cue get go
stopped copying some CUE files from Go package directories.
CL 1207402 fixes a regression where cue def --inline-imports
could result in invalid CUE which failed to evaluate.
Full list of changes since v0.11.1
- internal/cueversion: bump LanguageVersion for the next release by @mvdan in 079dc4a
- internal/ci: update pinned Go for the next release by @mvdan in b1a57a5
- internal/core/dep: fix handling sharing in non-rooted nodes by @mpvl in 8d97e7a
- cmd/cue: add test for 3646 by @mpvl in 815cb30
- cmd/cue: fix a regression with
cue get go
dropping CUE files by @mvdan in 5b0e411 - cmd/cue: add a test case to reproduce #3644 by @mvdan in 801f976
- internal/core/adt: fix let issue for eval v2 by @mpvl in a1fbeaa
- internal/core/adt: add tests for 3590 and 3591 by @mpvl in 0ae498f
v0.12.0-alpha.1
This release fixes many bugs in the new evaluator, enables the embedding experiment by default, and further improves JSON Schema support.
Changes which may break some users are marked below with:
Evaluator
CLs 1204365, 1205361, and 1205363 fix a number of closedness issues in the new evaluator, which were spotted thanks to user reports and Unity testing.
CLs 1204490, 1205368, and 1205368 resolve a number of significant performance issues spotted in the new evaluator.
CL 1205861 enables the Embedding proposal via CUE_EXPERIMENT=embed
by default, now that the proposal has been moved to a "likely accept" state for v0.12.
CL 1204491 introduces CUE_DEBUG=openinline
, enabled by default, which emulates the old evaluator's incorrect closedness behavior in some edge cases. This should help the transition towards the new evaluator, and allow us to fix the behavior of these edge cases in future CUE releases.
CL 1204608 introduces CUE_DEBUG=sortfields
which sorts all struct fields lexicographically. This replaces CUE_DEBUG_SORT_ARCS=1
, which did not work with the new evaluator.
Go API
CUE_EXPERIMENT=decodeint64
by default, causing cue.Value.Decode
to choose int64
rather than int
as the default Go type for CUE integer values.
Builtins
CL 1204378 teaches list.UniqueItems
to handle incomplete values correctly, fixing a bug in JSON Schema.
CL 1204425 fixes list.MatchN
so that it matches final values, like the matchN
evaluator built-in, fixing a bug in JSON Schema.
cue.Value.IsClosed
method.
cue.Instance.Doc
method.
cue/load.Config.BuildTags
field.
cmd/cue
CL 1204111 fixes some edge cases where CUE comments were lost or duplicated, particularly with cue def
.
CL 1204874 re-enables command suggestions when a user makes a typo like cue exprot
.
Encodings
JSON Schema spec compatibility is improved further by fixing a number of bugs and adding missing features. Notably, it now supports arbitrary references to internal structure in $ref
. JSON Schema's spec test suite has gone from a "pass" rate of 75% to 79% thanks to these efforts.
Full list of changes since v0.11.0
- cmd/cue: remove support for CUE_DEBUG_SORT_ARCS by @mvdan in f2775f8
- internal/ci: update Go and goreleaser versions for the next release by @mvdan in 962fafa
- update most dependencies ahead of v0.12.0-alpha.1 by @mvdan in 18669a7
- internal/cueexperiment: enable embed experiment by default by @mvdan in 1b2d11c
- encoding/jsonschema: respect Config.PkgName by @rogpeppe in 4f8b741
- encoding/jsonschema: add test for Config.PkgName by @rogpeppe in d5de8d4
- encoding/jsonschema: implement
Config.DefineSchema
by @rogpeppe in 0112a33 - evaluator: add regression test to lock in evalv3 wrt #3567 by @myitcv in 92b8f6f
- cmd/cue: fix spelling of CUE_EXPERIMENT for evalv2 by @myitcv in 54c734c
- encoding/jsonschema: update external test errors by @rogpeppe in c4ef079
- encoding/jsonschema: refactor reference handling by @rogpeppe in 028c6f3
- encoding/jsonschema: add structBuilder type by @rogpeppe in ccaee22
- cue/load: assume that Config.Registry is set when SkipImports is false by @mvdan in 33945a2
- all: sunset CUE_EXPERIMENT=modules by @mvdan in c8033e9
- internal/astinternal: add IncludePointers by @rogpeppe in 950f7fb
- encoding/openapi: fix updating golden files in tests by @rogpeppe in 6e34b9e
- encoding/jsonschema: define isTop and isBottom functions by @rogpeppe in 5fdf0c2
- encoding/jsonschema: do not use explicit phase for TODO constraints by @rogpeppe in 9639ed8
- cue/ast/astutil: ensure imports always start a new section by @rogpeppe in 226aac1
- cue/ast/astutil: add test for file-level comments joining with imports by @rogpeppe in def8bcf
- cue/ast: remove outdated docs by @rogpeppe in 1ea52f1
- internal/mod/modload: sort module versions when adding a new dependency by @mvdan in 2be40ea
- all: CUE_EXPERIMENT=modules no longer needs to be set in tests by @mvdan in eaea301
- cue: enable CUE_EXPERIMENT=decodeint64 by default by @mvdan in 0005c22
- internal/core/adt: remove resolved TODO by @mvdan in 5bf869e
- cmd/cue: add new CUE_EXPERIMENT and CUE_DEBUG flags to
help environment
by @mvdan in 4e92634 - cue: add more godoc links by @mvdan in 0e99c20
- cue: remove Instance.Doc by @mvdan in 54dc544
- cue/load: remove Config.BuildTags by @mvdan in 49a53d2
- README: update version number in installation example by @elzapp in 1f15584
- internal/core/adt: more pruning in partial disjunction check by @mpvl in a03ed2e
- internal/core/adt: support simplifying string bounds by @mpvl in 6d15591
- internal/core/adt: order bound error messages by @mpvl in d298a53
- internal/core/adt: fix bug in bound simplification by @mpvl in f9e5b6a
- internal/core/adt: revert recent change by @mpvl in 00fa80a
- internal/core/adt: patch performance issue related to error reporting by @mpvl in f1ea2ff
- internal/core/adt: alternative algorithm for splitting trees by @mpvl in 6c86b41
- internal/core/adt: fix closedness bug with patterns by @mpvl in 4ae75f8
- internal/core/adt: pass closeContext to openDebugGraph by @mpvl in 8aa5769
- internal/core/adt: always create new closeContext on reference by @mpvl in 9b61fc0
- cue: use embedding for UnifyAccept in V3 by @mpvl in d471ca1
- internal/core/adt: add various closedness tests by @mpvl in cce50f4
- internal/core/adt: cleanup some todos by @mpvl in 5195004
- internal/core/adt: also handle __no_sharing for V2 by @mpvl in 06cf5f4
- internal/ci: use pull_request_target for PR CI jobs by @mvdan in 5149ebd
- internal/core/adt: fix dropping of field by @mpvl in 432c114
- internal/core/adt: make Conjuncts type ConjunctGroup by @mpvl in 787d04c
- cmd/cue: add regression test for #3616 by @myitcv in f99441a
- internal/core/adt: simplify code by @mpvl in f7d3973
- internal/core/adt: add test for dropped field issue by @mpvl in 4c7ee01
- internal/core/adt: allow selectively turning off sharing by @mpvl in dc1ef63
- cue/parser: always allow predeclared identifiers on RHS by @mpvl in ec9117a
- cmd/cue: deduplicate the use of CUE_EXPERIMENT=evalv3 by @mvdan in 46c1cb2
- internal/core/runtime: consistently follow CUE_DEBUG env var flags by @mvdan in d5527cf
- cmd/cue: add a testscript for CUE_DEBUG=sortfields working with the Go API by @mvdan in 4258e9a
- internal/core/adt: close previously fixed issue by @mpvl in 5ac1b8a
- internal/core/adt: add tests for Issue 3535 by @mpvl in 698da05
- internal/ci: use the new tipdeploy workflow in cuelang.org by @myitcv in 9f217e1
- cue/errors: simplify printError by @mvdan in 4ce128d
- cue: use Value.ctx helper method consistently by @mvdan in 5d8f2cd
- internal/astinternal: make it easier to debug references by @rogpeppe in 0b06bd5
- encoding/jsonschema: remove isSchema field by @rogpeppe in 781f140
- enable and fix "value never used" staticcheck rule by @mvdan in 6ef4f68
- enable and fix "non-generic receiver names" staticcheck rule by @mvdan in 55166dd...
v0.11.1
This release includes fixes for bugs which were uncovered and resolved in the last few weeks.
Modules
CL 1205761 fixes a crash which could occur when using cue mod get
on a module with existing dependencies.
CL 1204614 fixes a regression where loading a CUE package whose directory name ends with .cue
was no longer working.
Full list of changes since v0.11.0
- internal/ci: update Go and goreleaser versions for the next release by @mvdan in f9cb3ee
- internal/cueversion: bump for v0.11.1 by @mvdan in be16614
- internal/mod/modload: sort module versions when adding a new dependency by @mvdan in 845f7e2
- cue/load: support loading a CUE package whose directory ends with .cue by @mvdan in a725c38
- doc: don't vendor a copy of DCO, as it is under another license by @jas4711 in 971ce58
v0.11.0
This release includes the new matchN
and matchIf
validators, many fixes to evalv3
including a new cycle algorithm, a new experimental toposort
field ordering, and many improvements to JSON Schema support.
Changes which may break some users are marked below with:
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 1201897 lands a new cycle algorithm in CUE_EXPERIMENT=evalv3
, which is much simpler than the old algorithm and is needed to unlock further bug fixes and performance improvements.
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 1200942 adds a new matchIf
builtin, similar to matchN
, which makes it significantly easier to implement the if
, then
, and else
keywords in JSON Schema.
CL 1202685 tweaks cuecontext.New
to follow CUE_EVALUATOR=evalv3
when the cuecontext.EvaluatorVersion
option is not used.
CLs 1202903, 1203264, 1203267, and 1203528 fix a number of bugs where CUE_EXPERIMENT=embed
was not working as described in the proposed design.
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.
cue fix
to rewrite most of them. We have added a doc page with more details and examples.
CL 1202746 teaches CUE_STATS_FILE
to start reporting the evaluator version being used, which is useful information when looking at performance stats.
Field ordering
A new experiment is introduced via CUE_EXPERIMENT=toposort
which enables a more principled ordering of CUE fields as produced by cue export
and cue eval
. The intention is to ensure the old and new evaluators order fields of structs in the same way, in order to build confidence and ease the transition to the new evaluator. There are still a few wrinkles to work out, and the question of iteration order in comprehensions over structs remains to be tackled. An issue for gathering feedback is available.
Modules
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.
CL 1201522 fixes a bug where imports did not work properly when using cue/load.Config.Package = "*"
.
Go API
CUE_EXPERIMENT=decodeint64
which causes cue.Value.Decode
to default to int64
rather than int
when decoding CUE integer values. This ensures consistent behavior with 32-bit architectures.
cue.Index
so that it accepts int64
as well as int
for consistency with 32-bit architectures.
CL 1202744 tweaks cuecontext.EvalVersion
so that the zero value is not a valid evaluator version, as that could lead to unintentional behavior.
cue.Value
API to consider open lists as concrete, aligning with the spec.
encoding/openapi
Go API which have been deprecated for some time and already have reasonable alternatives available.
cue/build.Instance
and cue/load.Config
which have been deprecated and unused for some time.
encoding/json
and encoding/yaml
which have been deprecated for some time and already have reasonable alternatives available.
cue.Value.Subsumes
and cue.Value.Split
methods, which have been deprecated and hidden for years.
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
and matchIf
builtins. 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.
The TOML support first released in v0.10.0 is further polished by decoding CUE nodes with positions as well as adding support for TOML dates and times.
CUE_EXPERIMENT=yamlv3decoder=0
, allowing the 8400 lines of code in internal/third_party/yaml
to be removed.
CL 1200901 improves filetype tags, as described by cue help inputs
, so that unknown tag=value
pairs cause failures, and invalid pair combinations aren't silently ignored.
CLs 1200899 and 1200924 split JSON Schema's strictness option into StrictFeatures
and StrictKeywords
which allows erroring when unimplemented features are used, but not when unknown keywords are used. --strict
is also superseded by jsonschema+strict:
.
CL 1201111 teaches default filetype tags to be applied in the default auto
interpretation mode as well.
CL 1201113 adds the StrictFeatures
and StrictKeywords
options to OpenAPI, mirroring the options added to JSON Schema.
CL 1201910 allows configuring how encoding/jsonschema
maps URLs to values within a package.
CL 1201935 refactors encoding/openapi
so that it can directly use the existing CUE value encoder for JSON, rather than a parallel encoder of CUE syntax trees to JSON which had to be maintained separately.
CLs 1201807, 1201808, 1201824, and 1201826 improve the performance of encoding CUE values to JSON, resulting in as much as a 10x improvement in wall time and memory usage for deeply nested CUE values.
Builtins
CL 1201474 adds a new encoding/toml
package with Marshal
and Unmarshal
APIs, following the addition of TOML support in v0.10.0.
CL 1202104 adds the net.URL
and net.AbsURL
validators, needed by JSON Schema.
strconv.ParseComplex
, which never worked in any past CUE release and does not seem like an useful API to have in its current form.
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.
uuid.Valid
so that it is consistent with uuid.Parse
in terms of what UUID formats are accepted.
cmd/cue
cuepls
to cue lsp
, enabling users to install one binary rather than two, and avoiding potential version discrepancies.
cue cmd
; users of cue foo
should now call cue cmd foo
.
CL 1204223 adds a cue login --token
flag to log into a CUE registry with a token which was generated via the web interface or API, for use in automated environments like CI.
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.
CL 1201709 fixes a minor regression introduced in CUE v0.9.0 where cue help cmd mycmd ./mypkg
stopped showing a valid command's h...
v0.11.0-rc.1
This release includes a few more encoding fixes in preparation for a stable release.
Encodings
JSON Schema spec compatibility is improved further by fixing a number of bugs and adding missing features.
CL 1203877 fixes a panic which could occur when an OpenAPI schema was missing a doc field.
v0.11.0-alpha.5
This release introduces a new toposort
evaluator experiment, fixes multiple bugs with the embed
experiment, and includes more JSON Schema improvements.
Changes which may break some users are marked below with:
Evaluator
A new experiment is introduced via CUE_EXPERIMENT=toposort
which enables a more principled ordering of CUE fields as produced by cue export
and cue eval
. The intention is to ensure the old and new evaluators order fields of structs in the same way, in order to build confidence and ease the transition to the new evaluator. There are still a few wrinkles to work out, and the question of iteration order in comprehensions over structs remains to be tackled. An issue for gathering feedback is available.
CL 1202746 teaches CUE_STATS_FILE
to start reporting the evaluator version being used, which is useful information when looking at performance stats.
CL 1203264 fixes a bug where CUE_EXPERIMENT=embed
would work when outside of a CUE module, which should not work as it can lead to security risks.
CL 1203267 fixes a bug where CUE_EXPERIMENT=embed
would not work with attributes attached to quoted field names.
CL 1203528 fixes a bug where CUE_EXPERIMENT=embed
would not work with the cue cmd
subcommand at all.
Go API
CUE_EXPERIMENT=decodeint64
which causes cue.Value.Decode
to default to int64
rather than int
when decoding CUE integer values. This ensures consistent behavior with 32-bit architectures.
cue.Index
so that it accepts int64
as well as int
for consistency with 32-bit architectures.
CL 1202744 tweaks cuecontext.EvalVersion
so that the zero value is not a valid evaluator version, as that could lead to unintentional behavior.
cmd/cue
cuepls
to cue lsp
, enabling users to install one binary rather than two, and avoiding potential version discrepancies.
Encodings
JSON Schema spec compatibility is improved further by fixing a number of bugs and adding missing features.
Full list of changes since v0.11.0-alpha.4
- internal/core/adt: shorter validator error message by @rogpeppe in af459f1
- update to use latest published githubactions schema by @rogpeppe in 93c1d7e
- internal/core: expose topological sorting API by @cuematthew in 8ff9db9
- encoding/jsonschema: check regexp syntax up front by @rogpeppe in 1476fc7
- encoding/jsonschema: better constraints for
additionalProperties
andpatternProperties
by @rogpeppe in 85f5ca8 - encoding/jsonschema: add test for field with regexp metacharacters by @rogpeppe in 1300a2d
- encoding/jsonschema: add test case for empty field by @rogpeppe in 8850ea7
- encoding/jsonschema: check regressions on a per-version basis by @rogpeppe in 47c1559
- encoding/jsonschema: better treatment of arrays by @rogpeppe in fc9a5a5
- internal/core: add explicit txtar test by @cuematthew in b780c0a
- all: enable new sorting algorithm by @cuematthew in edad6fc
- cue: Keep Vertex if returned from conversion of Go to CUE by @cuematthew in dbef7c5
- internal/core: add support for toposort to evalv2 by @cuematthew in c374e6c
- internal/core: extract sorted features from Vertex by @cuematthew in 65a15e2
- internal/core: sort graph topologically by @cuematthew in c6feea9
- internal/core: calculate elementary cycles by @cuematthew in 9ddb0ec
- internal/core: build graphs of Features by @cuematthew in 5855903
- cue: polish Go docs further by @mvdan in b3eed8b
- cue: teach old cue.Instance APIs to support
@embed
by @mvdan in deed7d5 - cue: improve docs around AnyIndex and AnyString by @mvdan in 73d4e25
- cue/testdata: add regression test for a cycle bug fixed in evalv3 by @mvdan in b96d6c1
- internal/core/runtime: external attributes can use any concrete field name by @rogpeppe in 0f6c51b
- internal/ci: run most tests on 32 bits too by @mvdan in 0516cc6
- cue: add experiment to default to int64 in Value.Decode for integers by @mvdan in 00bd25b
- cmd/cuepls: remove by @myitcv in dd85ce4
- cmd/cue: add hidden lsp command by @myitcv in 9faab39
- update golang.org/x deps for v0.11.0-alpha.5 by @mvdan in e83de3e
- cmd/cue,README: revamp introductory text by @mvdan in c20ee10
- cue/interpreter/embed: error when embed is not in a module by @rogpeppe in edef548
- cue: add test for embedded file not in a module by @rogpeppe in 06d0c73
- cue: support Index calls with int64 by @mvdan in 8b2affe
- cue/stats: start reporting which CUE evaluator version was used by @mvdan in 956d746
- internal/core/adt: catch if OpContext.Version is unset by @mvdan in 52c4418
- internal: separate the zero EvaluatorVersion value from EvalV2 by @mvdan in f17356d