diff --git a/cue.mod/module.cue b/cue.mod/module.cue index 1f1af8ea9..9cf92bc9e 100644 --- a/cue.mod/module.cue +++ b/cue.mod/module.cue @@ -1,4 +1,4 @@ module: "cuelang.org/go" language: { - version: "v0.15.0" + version: "v0.16.0" } diff --git a/encoding/jsonschema/crd.cue b/encoding/jsonschema/crd.cue index 1d66ee96f..b015491f5 100644 --- a/encoding/jsonschema/crd.cue +++ b/encoding/jsonschema/crd.cue @@ -23,8 +23,7 @@ specs: { #CRDSpec }, ] - } - if (input & [...]) == _|_ { + } else { // It's a single document. Include it if it looks like a CRD. if (input & {#crdlike, ...}) != _|_ { [{input, #CRDSpec}] diff --git a/internal/ci/base/gerrithub.cue b/internal/ci/base/gerrithub.cue index cecd95655..5291cc535 100644 --- a/internal/ci/base/gerrithub.cue +++ b/internal/ci/base/gerrithub.cue @@ -50,7 +50,7 @@ trybotDispatchWorkflow: bashWorkflow & { (trybot.key): { "runs-on": linuxSmallMachine + overrideCacheTagDispatch - let goodDummyData = [if json.Marshal(#dummyDispatch) != _|_ {true}, false][0] + let goodDummyData = json.Marshal(#dummyDispatch) != _|_ // We set the "on" conditions above, but this would otherwise mean we // run for all dispatch events. diff --git a/internal/ci/base/github.cue b/internal/ci/base/github.cue index 7baa76e10..293d9422a 100644 --- a/internal/ci/base/github.cue +++ b/internal/ci/base/github.cue @@ -243,12 +243,13 @@ goChecks: githubactions.#Step & { staticcheck: githubactions.#Step & { #in: modfile: string | *"" // an optional -modfile flag to not use the main go.mod - let gotool = [ + let gotool = { if #in.modfile != "" { "go tool -modfile=\(#in.modfile)" - }, - "go tool", - ][0] + } else { + "go tool" + } + } // TODO(mvdan): swap "/cache" for "${{ env.NSC_CACHE_PATH }}" once Namespace wires up that env var // for the workspace environment. See: https://discord.com/channels/975088590705012777/1397128547797176340 @@ -357,7 +358,8 @@ containsDispatchTrailer: { // // Dispatch-Trailer: {"type:} // - let _typeCheck = [if #type != _|_ {#type + "\""}, ""][0] + // TODO(mvdan): using a struct embedding a string here doesn't work. why? + let _typeCheck = [if #type != _|_ {#type + "\""} else {""}][0] """ (contains(\(_dispatchTrailerVariable), '\n\(dispatchTrailer): {"type":"\(_typeCheck)')) """ diff --git a/internal/ci/base/helpers.cue b/internal/ci/base/helpers.cue index 027b461a5..dca9537f0 100644 --- a/internal/ci/base/helpers.cue +++ b/internal/ci/base/helpers.cue @@ -14,15 +14,14 @@ import ( _matchPattern: { variable: string pattern: string - expr: [ + expr: { if strings.HasSuffix(pattern, "*") { let prefix = strings.TrimSuffix(pattern, "*") "startsWith(\(variable), '\(prefix)')" - }, - { + } else { "\(variable) == '\(pattern)'" - }, - ][0] + } + } } doNotEditMessage: { diff --git a/internal/ci/cue.mod/module.cue b/internal/ci/cue.mod/module.cue index 49eba03fe..13b1e46d8 100644 --- a/internal/ci/cue.mod/module.cue +++ b/internal/ci/cue.mod/module.cue @@ -1,6 +1,6 @@ module: "github.com/cue-lang/tmp/internal/ci" language: { - version: "v0.15.0" + version: "v0.16.0" } source: { kind: "self"