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

Let renovatebot update Go toolchain version in a single PR #24895

Merged
merged 10 commits into from Apr 18, 2023

Conversation

tklauser
Copy link
Member

@tklauser tklauser commented Apr 14, 2023

Migrate the remaining Go toolchain updates from the update-go-version target to renovatebot and change renovatebot to group all Go version updates into a single PR.

See individual commits and #24806 for details.

Example PR: tklauser#504

Fixes: #24806

@tklauser tklauser requested review from a team as code owners April 14, 2023 10:59
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Apr 14, 2023
@tklauser tklauser changed the title Let renovatebot go version Let renovatebot update Go toolchain version in a single PR Apr 14, 2023
@tklauser tklauser added the release-note/ci This PR makes changes to the CI. label Apr 14, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Apr 14, 2023
@tklauser tklauser force-pushed the pr/tklauser/renovate-go-version branch from e9839ec to d629de4 Compare April 14, 2023 11:02
@tklauser
Copy link
Member Author

/test

Copy link
Member

@bimmlerd bimmlerd left a comment

Choose a reason for hiding this comment

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

very nice. Minor nit, the first commit msg you state

[...] GO_VERSION (currently Go 1.12.1), thus the second condition (version >= go 1.13)

where I think you meant to say "currently 1.20.1".

Copy link
Contributor

@chancez chancez left a comment

Choose a reason for hiding this comment

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

This is awesome.

Copy link
Member

@aanm aanm left a comment

Choose a reason for hiding this comment

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

🎉

Copy link
Contributor

@zacharysarah zacharysarah left a comment

Choose a reason for hiding this comment

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

LGTM from a docs perspective.

We only support building with the Go version specified in GO_VERSION
(currently Go 1.20.1), thus the second condition (version >= go 1.13) is
always true.

Signed-off-by: Tobias Klauser <tobias@cilium.io>
This allows renovate bot to update Go version in GitHub actions.

Signed-off-by: Tobias Klauser <tobias@cilium.io>
This allows renovate bot to update the Go version used for Travis CI.

Signed-off-by: Tobias Klauser <tobias@cilium.io>
Instead of manually downloading and installing the Go toolchain tarball,
let's just copy it from the golang image. This will allow renovate bot
to automatically update the image and thus the Go version.

Signed-off-by: Tobias Klauser <tobias@cilium.io>
This allows renovate bot to update the Go version in test scripts used
within the CI VMs.

Signed-off-by: Tobias Klauser <tobias@cilium.io>
Add the necessary grouping so all Go dependencies across all files are
combined.

Signed-off-by: Tobias Klauser <tobias@cilium.io>
Instead of having a make target update the minimum required Go version,
let dev-doctor extract it from the main module's go.mod file.

Signed-off-by: Tobias Klauser <tobias@cilium.io>
The GO_VERSION file is going away in favor of renovatebot keeping the Go
toolchain version up-to-date across the tree. Let the doc generation
read the required Go major/minor version from go.mod. Note that this
will now only specify Go 1.20 instead of Go 1.20.x in the development
setup docs. This is in line with the dev-doctor tool and the
check-go-version make target also only requiring the major and minor
version to match.

Signed-off-by: Tobias Klauser <tobias@cilium.io>
All remaining users of the GO_VERSION file were either converted to be
updated by renovate or to use the go.mod file (in case only major and
minor version are required) in previous commits. Delete the now unneeded
GO_VERSION file.

Signed-off-by: Tobias Klauser <tobias@cilium.io>
These build tags lead to a rather unhelpful error message when compiling
an outdated Go versions, e.g.

    package github.com/cilium/cilium/daemon: build constraints exclude all Go files in ...

Nothing in the error messages indicates that this is due to an outdated
Go toolchain version and this has been a source of confusion several
times for several developers.

It's also brittle in a way that if a developer adds a new tool with a
main func and forgets adding the //go:build line it will not be enforced
by tooling. The update-go-version make target will only cover existing
//go:build go1.X lines.

We have other checks in place to guarantee that Cilium is built using
the correct Go version (namely the go directive in go.mod, the
check-go-version make target, the dev-doctor tool and various CI
checks), so drop these build tags.

Signed-off-by: Tobias Klauser <tobias@cilium.io>
@tklauser tklauser force-pushed the pr/tklauser/renovate-go-version branch from d629de4 to 799c3af Compare April 18, 2023 08:35
@tklauser
Copy link
Member Author

Rebased to resolve merge conflicts and to address David's and Michi's review comments.

@tklauser
Copy link
Member Author

/test

@aanm aanm merged commit 66377a3 into master Apr 18, 2023
57 checks passed
@aanm aanm deleted the pr/tklauser/renovate-go-version branch April 18, 2023 16:11
@tklauser tklauser added backport/author The backport will be carried out by the author of the PR. needs-backport/1.13 This PR / issue needs backporting to the v1.13 branch and removed backport/author The backport will be carried out by the author of the PR. needs-backport/1.13 This PR / issue needs backporting to the v1.13 branch labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/ci This PR makes changes to the CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Let renovatebot update Go toolchain in a single PR
7 participants