Skip to content

Releases: cue-lang/cue

v0.12.0-alpha.1

19 Dec 15:02
Compare
Choose a tag to compare
v0.12.0-alpha.1 Pre-release
Pre-release

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

⚠️ CL 1205569 enables 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.

⚠️ CL 1204920 removes the long-deprecated cue.Value.IsClosed method.

⚠️ CL 1205530 removes the long-deprecated cue.Instance.Doc method.

⚠️ CL 1205529 removes the long-deprecated cue/load.Config.BuildTags field.

cmd/go

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...
Read more

v0.11.1

18 Dec 15:57
Compare
Choose a tag to compare

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

19 Nov 16:27
Compare
Choose a tag to compare

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.

⚠️ 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 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

⚠️ 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.

CL 1201522 fixes a bug where imports did not work properly when using cue/load.Config.Package = "*".

Go API

⚠️ CL 1203193 adds a new experiment via 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.

⚠️ CL 1203192 tweaks the signature of 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.

⚠️ CL 1202244 tweaks the cue.Value API to consider open lists as concrete, aligning with the spec.

⚠️ CLs 1201768, 1201933, 1201934, 1201936, and 120193 remove pieces of the encoding/openapi Go API which have been deprecated for some time and already have reasonable alternatives available.

⚠️ CL 1201962 removes fields from cue/build.Instance and cue/load.Config which have been deprecated and unused for some time.

⚠️ CL 1201963 removes APIs from encoding/json and encoding/yaml which have been deprecated for some time and already have reasonable alternatives available.

⚠️ CLs 1202285 and 1202286 remove the 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.

⚠️ 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.

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.

⚠️ CL 1201115 removes 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.

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

cmd/cue

⚠️ CL 1203289 moves cuepls to cue lsp, enabling users to install one binary rather than two, and avoiding potential version discrepancies.

⚠️ CL 1199634 drops support for the deprecated short form of 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...

Read more

v0.11.0-rc.1

14 Nov 21:18
Compare
Choose a tag to compare
v0.11.0-rc.1 Pre-release
Pre-release

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

06 Nov 16:51
Compare
Choose a tag to compare
v0.11.0-alpha.5 Pre-release
Pre-release

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

⚠️ CL 1203193 adds a new experiment via 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.

⚠️ CL 1203192 tweaks the signature of 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/go

⚠️ CL 1203289 moves 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

v0.11.0-alpha.4

25 Oct 08:17
Compare
Choose a tag to compare
v0.11.0-alpha.4 Pre-release
Pre-release

This release fixes dozens of bugs in the old and new evaluators and includes more JSON Shema improvements.

Changes which may break some users are marked below with: ⚠️

Evaluator

Over a dozen closedness and cycle detection bugs have been fixed in CUE_EXPERIMENT=evalv3, including a few which caused panics or endless evaluation.

CL 1202685 tweaks cuecontext.New to follow CUE_EVALUATOR=evalv3 when the cuecontext.EvaluatorVersion option is not used.

CL 1202903 fixes embed.New so that it works without needing to set CUE_EXPERIMENT=embed as well.

CLs 1202120 and 1202211 fix a number of issues where validators like matchN or struct.MinFields would give incorrect results.

Go API

⚠️ CL 1202244 tweaks the cue.Value API to consider open lists as concrete, aligning with the spec.

⚠️ CLs 1202285 and 1202286 remove the cue.Value.Subsumes and cue.Value.Split methods, which have been deprecated and hidden for years.

Encodings

JSON Schema spec compatibility is improved further by fixing a number of bugs and adding missing features.

Builtins

CL 1202104 adds the net.URL and net.AbsURL validators, needed by JSON Schema.

Full list of changes since v0.11.0-alpha.3
  • cue/errors: add package example by @mvdan in 80f4f23
  • internal/core/adt: impove arcType update logic by @mpvl in d28f285
  • internal/core/adt: add tests for issue 3533 by @mpvl in 7e82983
  • internal/core/adt: allow errors in inline structs by @mpvl in 62b21c8
  • internal/core/adt: add test case for selection problem by @mpvl in 9f46e1a
  • internal/core/adt: reimplement close for v3 by @mpvl in 02d5751
  • internal/core/adt: rename Closed to RecursivelyClosed by @mpvl in a6d8d34
  • interpreter/embed: do not require CUE_EXPERIMENT=embed by @rogpeppe in ea70704
  • internal/core/adt: fix logic error leading to panic by @mpvl in e58994d
  • tools/fix: merge calls to list.Concat by @cuematthew in 6167d7d
  • internal/core/adt: remove p1 error by @mpvl in 12ac20b
  • internal/core/adt: remove further evaluatingArcs logic by @mpvl in 8f42ad0
  • internal/core/adt: allow pending arcs to be updated by @mpvl in 9b07aba
  • internal/core/adt: evaluate nodes that are otherwise not evaluated by @mpvl in 5bf9ef4
  • internal/core/adt: get rid of use of evaluatingArcs status by @mpvl in 769017e
  • internal/core/adt: fix some references under projections by @mpvl in 6418113
  • internal/core/dep: fix differences by @mpvl in cc04ebe
  • internal/core/adt: disable possible assertion by @mpvl in 2fc301a
  • internal/core/adt: fix disjunction finalization by @mpvl in 62865d3
  • internal/core/adt: fix bug in notification by @mpvl in 1a30763
  • internal/core/adt: add indirection for closeContext by @mpvl in 0fa94ff
  • internal/core/adt: support bulk adding of conjuncts by @mpvl in b990eb7
  • internal/core/adt: more abstractions over Conjuncts by @mpvl in d21405c
  • internal/core/adt: better error positions by @mpvl in 6e0525b
  • internal/core/adt: introduce HasConjunct by @mpvl in 2bce38d
  • pkg/path: fix path issue by @mpvl in e9c005d
  • cue: resolve a few staticcheck warnings by @mvdan in 537f744
  • cue/interpreter: move test helpers to the right file by @mvdan in d9fda8c
  • cue/load: simplify registry example by @mvdan in 457a112
  • cue/load: fix @if attributes in command line-specified files by @rogpeppe in 4642d77
  • cmd/cue: add test case for issue 3250 by @rogpeppe in 0b6d0da
  • cue/cuecontext: cuecontext.New observes evalv3 experiment by default by @mpvl in be8ed35
  • cmd/cue/cmd: undo panic when multiple commands are run in one process by @mvdan in 860906a
  • cmd/cue/cmd: add a Go test covering the exposed API by @mvdan in 1f8fb57
  • internal/core/adt: fix hang on cyclic pattern constraints by @mpvl in b010875
  • internal/filetypes: default jsonschema strictFeatures to false by @rogpeppe in 3c40786
  • encoding/jsonschema: use allowedTypes in if/then/else constraints by @rogpeppe in 16986b2
  • encoding/jsonschema: add if/then/else test by @rogpeppe in 72023e6
  • encoding/jsonschema: disallow $schema at non-root for earlier versions by @rogpeppe in 2c6ed18
  • encoding/jsonschema: correct treatment of $ref by @rogpeppe in 4543183
  • encoding/jsonschema: simplify matchN expressions with only one possibility by @rogpeppe in 1508ef8
  • encoding/jsonschema: use latest schema version by default by @rogpeppe in 1a4b0d0
  • encoding/jsonschema: remove unused state fields by @rogpeppe in ded6fc3
  • internal/core/adt: less special handling for non-rooted by @mpvl in f5f947e
  • internal/core/adt: fix structural cycle error in list.Sum by @mpvl in 48b5a22
  • internal/core/adt: add RawFunc by @mpvl in cf2f66e
  • internal/core/adt: always allow definition in closed struct by @mpvl in 4e8e027
  • internal/core/adt: add tests for issue 3491 by @mpvl in 9ba55dc
  • cue: remove the hidden Value.Split method by @mvdan in 0dd7f69
  • cue: remove the hidden Value.Subsumes method by @mvdan in 80ddde3
  • cue: advance deprecation of Iterator methods by @mvdan in d170b1c
  • internal/core/adt: fix error type of MinFields for v3 by @mpvl in 44cceca
  • encoding/jsonschema: use CUE_UPDATE=force by @rogpeppe in ad21c10
  • encoding/jsonschema: use uint not number for min/maxLength by @rogpeppe in cff7484
  • encoding/jsonschema: always write external_teststats.txt by @rogpeppe in 66344b2
  • internal/core/adt: pass CloseInfo to validators by @mpvl in 369bc9b
  • internal/core/dep: distinghish inline structs by @mpvl in a50fa63
  • internal/core/adt: adapt handling of inline structs by @mpvl in 99407a4
  • all: annotate priority of bugs marked by TODO_V3 by @mpvl in 90b5c9d
  • internal/core/adt: more usage of Status by @mpvl in d581f90
  • internal/core/dep: dereference node in dynamic mode by @mpvl in 8399737
  • cue: open lists are still concrete by @rogpeppe in 1eb6216
  • internal/core/adt: closedness fix related to comprehension by @mpvl in cd2107a
  • internal/core/adt: hoist allows from injectClosed by @mpvl in 6916b5b
  • internal/core/adt: fix closedness for failing if by @mpvl in 89acced
  • encoding/openapi: add test cases for non-empty lists by @rogpeppe in 655236e
  • internal/core/debug: dereference non-rooted by @mpvl in 4ae206d
  • internal/core/adt: use depth counters for ancestor tracking by @mpvl in c558da0
  • internal/core/adt: fix cycle in patterns by @mpvl in 16df890
  • internal/core/adt: add tests for ring-shaped cycles by @mpvl in 695d6d3
  • internal/core/adt: derive status from shared value by @mpvl in f8c5520
  • internal/core/adt: distinguish point of cyclicity by @mpvl in af68c6c
  • internal/core/adt: more shallow evaluation of lists by @mpvl in 2d4a895
  • internal/core/adt: fix simplifcation of validators by @mpvl in 86fdd97
  • internal/core/adt: optimize slice by @mpvl in b51914f
  • internal/core/adt: add some defensive code by @mpvl in 4eaa7b2
  • internal/core/adt: add tests for more structure sharing by @mpvl in 29b466e
  • internal/core/export: add some testing infrastructure by @mpvl in 6e0f579
  • internal/core/export: document bug in export by @mpvl in 2eedbd1...
Read more

v0.10.1

22 Oct 14:04
Compare
Choose a tag to compare

This release includes fixes for two bugs which were uncovered and resolved in the last few weeks.

cmd/cue

CL 1202646 fixes a panic for users of the cmd/cue/cmd Go API.

CL 1202738 fixes a bug when using @if attributes in files specified directly as command line arguments.

v0.11.0-alpha.3

02 Oct 11:28
Compare
Choose a tag to compare
v0.11.0-alpha.3 Pre-release
Pre-release

This release adds a new cycle algorithm to the new evaluator, removes some long-deprecated Go APIs, and includes multiple improvements to the existing encodings.

Evaluator

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.

Go API

CLs 1201768, 1201933, 1201934, 1201936, and 120193 remove encoding/openapi Go APIs which have been deprecated for some time and already have reasonable alternatives available.

CL 1201962 removes fields from cue/build.Instance and cue/load.Config which have been deprecated and unused for some time.

CL 1201963 removes APIs from encoding/json and encoding/yaml which have been deprecated for some time and already have reasonable alternatives available.

Encodings

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.

Full list of changes since v0.11.0-alpha.2
  • internal/ci: bump Go and goreleaser for alpha.3 by @mvdan in 5ffd573
  • update dependencies before alpha.3 by @mvdan in 402aeda
  • internal/ci: cue fmt by @rogpeppe in bdab4b2
  • internal/ci: pass access token to releaser step by @rogpeppe in 20d6573
  • internal/ci: rename and clarify the e2e logins.json secret by @mvdan in 992127e
  • internal/cueconfig: note the difference between token expiry fields by @mvdan in 186763c
  • cmd/cue: truncate expiry timestamps to seconds by @mvdan in a3fb8e8
  • internal/ci: use githubactions schema from registry by @rogpeppe in 093a2c6
  • internal/core/adt: new cycle algorithm by @mpvl in 92330b4
  • internal/core/debug: report more structure sharing by @mpvl in a0138fb
  • internal/core/debug: add cycle detector by @mpvl in 06141e4
  • internal/core/adt: bail on empty node by @mpvl in 4140094
  • internal/core/adt: split updateCyclicStatus based on version by @mpvl in bf54346
  • cmd/cue: store token expiry timestamps in UTC in logins.json by @mvdan in 6b73188
  • cmd/cue: test storing access token expiry in login by @mvdan in 25e0884
  • cmd/cue: add more sanity checks for produced logins.json files by @mvdan in 791420a
  • encoding/json,encoding/yaml: remove long deprecated cue.Instance APIs by @mvdan in f0c77ed
  • cue/build,cue/load: remove deprecated fields by @mvdan in 02a694e
  • encoding/openapi: unexport OrderedMap by @mvdan in 9f2c2fe
  • encoding/openapi: remove OrderedMap.Set by @mvdan in 3fb46c3
  • encoding/openapi: marshal JSON via cue.Value.MarshalJSON by @mvdan in e7d9d47
  • encoding/openapi: remove most public API surfacing OrderedMap by @mvdan in 90c9c95
  • encoding/openapi: remove Config.All by @mvdan in b24335b
  • cue: reuse adt.OpContext in Value.structValOpts by @mvdan in 91b12ec
  • internal/core/export: swap sort.Slice APIs for slices.Sort by @mvdan in 0078d26
  • cue: reuse adt.OpContext in MarshalJSON recursion by @mvdan in 9c3e156
  • cue: clarify status of zero Path value by @rogpeppe in 32b169a
  • encoding/jsonschema: allow mapping URLs to values within a package by @rogpeppe in 5cc6175
  • encoding/jsonschema: clearer internals by @rogpeppe in 19eea7f
  • cue: only use internaljson.Marshal where necessary by @mvdan in da2e501
  • cue: use append-like funcs inside Value.MarshalJSON by @mvdan in fed4998
  • cue: recursively marshal JSON values directly by @mvdan in 3f1e72b
  • cue: use unwrapJSONError in the entrypoint API only by @mvdan in 01b0064
  • cue: marshal a Value as JSON null directly by @mvdan in 97f622b
  • internal/core/convert: do not roundtrip MarshalText to JSON by @mvdan in 7ba104c
  • cue: add large Value.MarshalJSON benchmark by @mvdan in b37ab01
  • encoding/openapi: drop use of cue.Runtime from tests by @mvdan in c8b32e9
  • encoding/openapi: drop support for Config.ReferenceFunc by @mvdan in e339345
  • cue: remove unneeded fields from goField by @mvdan in 1b45c99
  • internal/tdtest: use sync.OnceValues by @mvdan in 774e40e
  • all: remove a few unused parameters spotted by unparam by @mvdan in ffafd61

v0.11.0-alpha.2

24 Sep 15:36
Compare
Choose a tag to compare
v0.11.0-alpha.2 Pre-release
Pre-release

This release includes a new matchIf built-in validator, many more improvements to JSON Schema and TOML support, as well as some fixes.

Evaluator

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.

Modules

CL 1201493 gives a better error message when a module is not found.

CL 1201522 fixes a bug where imports did not work properly when using cue/load.Config.Package = "*".

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.

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 1200932 turns on JSON Schema's new StrictFeatures option on by default, a saner default as we know which features we have not yet implemented and so the schema cannot be interpreted correctly.

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 1200888 adds support for decoding TOML dates and times.

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 1201115 removes strconv.ParseComplex, which never worked in any past CUE release and does not seem like an useful API to have in its current form.

cmd/cue

CL 1201709 fixes a minor regression introduced in CUE v0.9.0 where cue help cmd mycmd ./mypkg stopped showing a valid command's help text.

v0.11.0-alpha.1

05 Sep 16:34
Compare
Choose a tag to compare
v0.11.0-alpha.1 Pre-release
Pre-release

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...
Read more