你的 Go 版本 CI 矩阵可能是错误的

  • CI Suite Issue: In River’s CI suite, it was discovered that although thought to be supporting the latest two Go versions (1.21 and 1.22), it actually wasn't. The GitHub Actions CI matrix had tests for both versions but builds were passing with Go 1.21 being downloaded and then upgraded to 1.22 immediately.
  • Go 1.21 Changes: Along with toolchains, Go 1.21 changed the treatment of go directives in go.mod. They are now mandatory instead of advisory. Any Go project needs to set its go directive to at least the version required by its dependencies. River uses go 1.21 with a toolchain go1.22.5 in go.mod, but the presence of toolchain causes CI jobs to upgrade to 1.22. Using env: GOTOOLCHAIN: local prevents this.
  • Learning from Debacle: Go modules that expect to be dependencies need to be careful with go directives in go.mod as it can have downstream impact. Go is trigger happy in changing go.mod's go version. River is a multi-module project and an accidental update to Go 1.22.5 led to the discovery of the issue. A CI check will be added to verify consistency of directives across modules in the future.
阅读 20
0 条评论