Skip to content

v0.4.1-beta.6

Pre-release
Pre-release
Compare
Choose a tag to compare
@cueckoo cueckoo released this 02 Dec 08:54
· 2013 commits to master since this release

Bug fixes

After an extended summer break following CUE's migration to cue-lang/cue, this release mainly focuses on bug fixes.

Thank you to @mvdan, @ameowlia, @antong, @slewiskelly, @hrvolapeter, @caarlos0, @yujunz, and @chai2010 for contributing to this release!

Project-level changes

A number of release-related issues that were missed in the migration from cuelang/cue to cue-lang/cue have been fixed. GoReleaser now correctly marks prereleases as such.

The CUE project now uses v1 of GoReleaser and as such we produce both amd64 and arm64 release assets for linux, windows and darwin, with accompanying amd64 and arm64 Docker images and manifests. The homebrew-tap recipe has also been updated to avoid an error message reported via https://github.com/cue-lang/homebrew-tap/issues/1.

As we near the halfway point to go1.18, go1.15 has been removed from the build matrix. The project's policy for previous versions of Go will be formalized in the near future, but is likely to be that each major Go release is supported until there are two newer major releases, with a 3 month grace period following the release of a new major version (3 months being half a 6-month release cycle) before support for the oldest version is dropped. Correspondingly, go install instructions in the README have been updated to drop support for the old-style GO111MODULE form, instead preferring the go install cuelang.org/go@$version form.

Ahead of a live stream focussing on contributing to the CUE project back in November, the contribution guide was updated to provide more detail around the PR workflow. Further improvements will be made to reflect feedback following the livestream.

Encoders

An upgrade to the version of gopkg.in/yaml.v3 used by the CUE project may result in some formatting changes for Yaml output. This new version now also supports better string escaping for YAML v1.1 backwards compatibility support. However, it does not seem to apply these escapes consistently, so for now we added our own implementation (see also #1368 and #1076)

For instance, some unquoted strings might, when consumed by some old YAML parsers, be interpreted as values other than strings (float 60, bool, date-time...). Now:

service: "2222:22" 

is consistently exported to Yaml as:

service: "2222:22" // before RHS was 2222:22

If this more aggressive quoting still proves insufficient, we can consider quoting all string values by default.

cmd/cue

Thanks to @chai2010, a working directory can be set for an exec.Run command in the tooling layer:

import "tool/exec"

command: ls: exec.Run & {
	cmd: "ls"
	dir: "/tmp"
}

cue eval exporting previously resulted in some strange results that involved let expressions (#1116). These bugs have been fixed and corresponding updates made to test expectations in unity. Similarly, a cue def bug where multiple list conjuncts resulted in an output containing a {} conjunct is now fixed (#1284).

API

cue.ResolveReferences has been fixed to work for the KubeVela project, although it is anticipated a better long-term solution is required.

@ameowlia helped fix an issue with a test example for cue.Context.

Various other bug fixes.

Evaluator

91476ab fixes a number of issues related to the use of aliases in lists (#1308), by introducing a new scope with list values. A side effect of this change is that value aliases now work with list values:

y: X = [1, 2, X[0]]   // y: [1, 2, 1]

A long-standing issue with defaults and string and number lists (#1025, #1404) has been fixed such that the following example no longer results in an incomplete-error:

exec cue export

-- x.cue --
package x

import "strings"

#something: {
	image:    string | *"some default"
	toString: strings.Join([image], "")
}

x: #something

A bug where comprehensions inside a definition resulted in an error (#1404) has now been fixed, meaning the following is correctly allowed:

#D: {
	a: foo: 123
	b: {for k, v in a {(k): v}}
}

An important bug related to the handling of default values that result in error has been fixed (#1304 and #1257).

Various unexpected panics have been fixed, including a panic in the case of circular let declarations (#1042).

Language

This release makes no changes to the language.

The CUE spec now correctly defines $ as an identifier (#1264).

Changelog

  • 547e5cc ci: configure GoReleaser to mark prereleases as such
  • 6e68ca4 ci: only trigger new version events after successful new version
  • 795719e ci: fix GoReleaser arm64 template details
  • b68f4c3 ci: fix target for homebrew tap
  • 02556bc ci: fix up GoReleaser image template names
  • e7da62f ci: use GoReleaser v1.0.0
  • f68e000 cue: support ResolveReferences
  • d413bb8 internal/core/export: keep open lists open
  • 9a040dc internal/core/export: fix let exporting
  • 910ff4d pkg: fix default issue for string and numbers lists
  • 6c30678 internal/core/adt: fix regression of dynamic closed fields in definitions
  • 9e7d4d6 internal/core/export: treat empty data vertices as structs
  • 4d505e0 cmd/cue: confirm issues 1152 and 1153 are fixed
  • eb53c4e cmd/cue: get go: ignore anonymous enums
  • b99ce0a internal/core/adt: close open lists for Default
  • 061e661 cue: auto-unwrap single embedded value in Expr
  • 7922f9b pkg/internal: compute combined error severity
  • c490d4c internal/core/export: fix bug with API-generated top-level close
  • e62a95a ci: remove go1.15 from the build matrix
  • f880467 cue: fix output in ExampleContext
  • 9982526 internal/core/adt: don't cache incomplete errors for let
  • 4f3988f cue/testdata: hoist let cycle errors
  • 91476ab internal/core: use scope for lists
  • 718c9a0 ci: correct location of unity
  • f65dd0f internal/core/compile: remove unnecessary code
  • b89ad85 cue: fix subsumption bug for disjuntion filtering
  • a8b721a internal/encoding/yaml: upgrade go-yaml.v3
  • 15adb6c encoding/openapi: fix crash in reference
  • 4e76bb4 cmd/cue/cmd: improve shell arg parsing in tests
  • 0e56b82 internal/core/export: don't add empty temp struct
  • 75c3d6b doc/ref/spec.md: include $ in identifier
  • c1c2cda internal/encoding/yaml: canonicalize non-string map keys
  • a83c6c6 encoding/yaml: quote strings more aggressively
  • b9ac1ea doc/tutorial/kubernetes: update types
  • 59bdbb5 internal/core/adt: fix bound simplification for floats
  • 62e876d internal/core/adt: fix disjunction bug
  • 9bb874c cue: Expr handles empty lists to or/and builtins
  • 72936e4 cue: define all Op constant values explicitly with that type
  • 29a686d simplify install instructions assuming Go 1.16+
  • dbf5992 doc: revamp contribution guide ahead of contributing live-stream
  • 9217c4d ci: update to use go1.17.3 and go1.16.10
  • 437920e doc/ref/spec: fix typos and heading anchors
  • fca61f5 cue: define all Kind constant values explicitly with that type
  • 8031fe7 spec: Update example with regards to pattern constraints
  • ddd96c6 ci: latest Go versions in build matrix
  • 5cf1aa1 feat: update go build matrix
  • 35c2f3c doc: fix repeated word typos in spec
  • e8550b8 doc: remove useless whitespace in main README
  • 0f53054 doc/contrib: update git codereview change to use -s flag
  • ecb17c9 cmd/cue: revert version string change
  • 370fac9 ci: improve goreleaser workflow
  • 38c8f7d doc/tutorial: fix errant use of list operators
  • a4a38ed ci: tidy up encoding of JSON args to curl
  • 7d25ee2 ci: re-enable full CI workflows
  • 59079b1 ci: tidy up quoting of JSON args in workflow commands
  • 5f28bb4 readme: fix top-level CONTRIBUTING guide
  • 5ab75b8 readme: link to CoC from main readme and contributing guide
  • 35c4960 general: use cuelang.org/issues as the general issue link
  • a68df18 github: fix up empty issue template
  • 723a7fe github: tidy up issue templates
  • 3d9cd71 general: update unity location
  • 6da50d9 ci: fix Docker workflow
  • 06484a3 all: change references from cuelang/cue to cue-lang/cue
  • 20ed9ab internal/core/compile: fix let cycle error
  • 0070bb1 ci: fix up new version trigger
  • aa61ee7 doc/tutorial/kubernetes: fix invalid user commands
  • 67bf363 doc/tutorial/kubernetes: update k8s version
  • ec427f9 cmd/cue: fix up get go docs around "enum" types
  • 8e053d4 Allow setting working directory for exec.Run
  • e8de4b1 interanal/core/runtime: remove commented out fields

Docker images

  • docker pull docker.io/cuelang/cue:0.4.1-beta.6