Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Conversation

michi-covalent
Copy link
Contributor

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

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>
@michi-covalent michi-covalent temporarily deployed to ci October 18, 2023 20:04 — with GitHub Actions Inactive
@michi-covalent michi-covalent marked this pull request as ready for review October 18, 2023 20:52
@michi-covalent michi-covalent requested review from a team as code owners October 18, 2023 20:52
Comment on lines +3 to 4
// renovate: datasource=golang-version depName=go
go 1.21.1
Copy link
Member

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

Copy link
Contributor Author

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?

Copy link
Contributor Author

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.

Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fascinating

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @joestringer ☝️

Copy link
Member

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.

@michi-covalent michi-covalent marked this pull request as draft October 20, 2023 14:25
@@ -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'
Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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.

@michi-covalent
Copy link
Contributor Author

closing this for now. i guess we could do something similar to cilium/cilium#28686 💭

@michi-covalent michi-covalent deleted the pr/michi/more-bot branch November 11, 2023 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants