You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
internal/ci/goreleaser: adjust after evalv3 fix for #3908
CI at master does a couple of extra steps, such as validating that
a dry-run of the release process works. However, the recent merge of
https://cuelang.org/cl/1214564 broke our `cue cmd release`
as ran by CI, with GITHUB_REF set by GitHub:
$ GITHUB_REF=foo cue cmd release
command.release.info.text: invalid string argument: invalid interpolation: unresolved disjunction "foo" | "refs/no_ref_kind/not_a_release" (type string):
./goreleaser_tool.cue:75:2
./goreleaser_tool.cue:22:23
./goreleaser_tool.cue:76:3
./goreleaser_tool.cue:76:9
tool/cli:4:3
It turns out that the reason was our goreleaser_tool.cue was buggy:
let _githubRef = env.GITHUB_REF | "refs/no_ref_kind/not_a_release"
When the GITHUB_REF env var is set to e.g. "foo", this should result in
the ambiguous value `"foo" | "refs/no_ref_kind/not_a_release"`,
and hence an error, just like CUE at master with evalv3 reports.
However, evalv2 happily resolves that to `"foo"`.
We can fix our CUE by selecting env.GITHUB_REF as the default,
ensuring that it has priority when it is set in the environment.
Also add a regression test to ensure that the ambiguous scenario
stays as an error on evalv3 and future evaluator versions.
We also show that it succeeds on evalv2, which is broken behavior.
While here, fix a goreleaser deprecation warning which begain in v2.6:
https://goreleaser.com/deprecations/#archivesformat_overridesformat
Signed-off-by: Daniel Martí <[email protected]>
Change-Id: I8a96b697820a607209e914eb48ee4f0e56b3a586
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1214619
TryBot-Result: CUEcueckoo <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
Reviewed-by: Matthew Sackman <[email protected]>
0 commit comments