Skip to content

[release-3.5] Setup a way to consistently manage go versions across scripts and go.mods#18017

Merged
ahrtr merged 2 commits intoetcd-io:release-3.5from
MadhavJivrajani:go-version-setup-35
May 16, 2024
Merged

[release-3.5] Setup a way to consistently manage go versions across scripts and go.mods#18017
ahrtr merged 2 commits intoetcd-io:release-3.5from
MadhavJivrajani:go-version-setup-35

Conversation

@MadhavJivrajani
Copy link
Copy Markdown
Contributor

@MadhavJivrajani MadhavJivrajani commented May 15, 2024

Replicates #17876

This PR does the following:

scripts: default to using .go-version's version for tests and builds
Additionally, provide ability to opt-out of the .go-version and use a
custom one via env vars: FORCE_HOST_GO and GO_VERSION.

.*: sync go toolchain version and add ability to verify versions
This commit adds a script to sync the version present in .go-version
across all go.mod files as the toolchain directive. As part of that,
this commit also modifies go.mod files that did not have synced toolchain
directives.

Additionally, this also adds a script to verify all toolchain and go
directives against the version present in .go-version as follows:
(1) The go directive <= version in .go-version
(2) The toolchain directive == version in .go-version

The make target for this script is run as part of make verify which will automatically be run as a presubmit.

/assign @ahrtr

Comment thread Makefile
Comment thread Makefile
@MadhavJivrajani
Copy link
Copy Markdown
Contributor Author

@ahrtr can you PTAL? Thank you!

Comment thread .github/workflows/static-analysis.yaml
This commit adds a script to sync the version present in .go-version
across all go.mod files as the toolchain directive. As part of that,
this commit also modifies go.mod files that did not have synced toolchain
directives.

Additionally, this also adds a script to verify all toolchain and go
directives against the version present in .go-version as follows:
(1) The go directive <= version in .go-version
(2) The toolchain directive == version in .go-version

This script runs as part of the `make verify` target, making it run
as a presbumit by default.

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
Additionally, provide ability to opt-out of the .go-version and use a
custom one via env vars: FORCE_HOST_GO and GO_VERSION.

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
@MadhavJivrajani
Copy link
Copy Markdown
Contributor Author

/retest

Copy link
Copy Markdown
Member

@ahrtr ahrtr left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks

@ahrtr ahrtr merged commit 3afe949 into etcd-io:release-3.5 May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants