-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go.mod: Let Renovate manage Go version #2056
Conversation
Configure Renovate to update Go version in go.mod, and modify workflow files to use go.mod to get the Go version to reduce the number of places Renovate needs to update. Ref: cilium/tetragon#1579 Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
// renovate: datasource=golang-version depName=go | ||
go 1.21.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may not want renovate to bump the patch version in the go.mod, see cilium/cilium#28686
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh interesting could we just specify go 1.21
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
anyways i'll just wait for cilium/cilium#28686 to get merged and do the same thing. converting to draft.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that you can specify go 1.21
as long as you add a toolchain directive. Maybe that's what we should be doing, ie:
go 1.21
// renovate: datasource=golang-version depName=go
toolchain 1.21.3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fascinating
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @joestringer ☝️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using toolchain like that causes toolchain upgrade problems for me, I would prefer the approach with go 1.21.0
+ renovate to only bump major/minor and not patch versions.
@@ -18,8 +18,7 @@ jobs: | |||
- name: Set up Go | |||
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 | |||
with: | |||
# renovate: datasource=golang-version depName=go | |||
go-version: 1.21.3 | |||
go-version-file: 'go.mod' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest not to tie release workflows to go.mod
version. Release workflows should always use the latest version, whereas I think that developer toolchains can lag behind within the same minor version and that's OK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In practice that means that the approach I'm exploring in the other linked PR is to have two renovate configs: One for go.mod following the X.Y.0
releases and a different one for everything else following every X.Y.Z
patch release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The actual implementation ended up different: There's a general Go version bump rule, then I added a specific rule for go.mod
to disable patch updates for the toolchain version in the go.mod file.
closing this for now. i guess we could do something similar to cilium/cilium#28686 💭 |
Configure Renovate to update Go version in go.mod, and modify workflow files to use go.mod to get the Go version to reduce the number of places Renovate needs to update.
Ref: cilium/tetragon#1579