[CI] Upgrade Go version compatibility baseline to 1.27 (#5178) #5188
Could you please open an issue to track this?
I'm not sure if we are going to upgrade to go 1.27 that early, as projects that uses KubeRay (e.g. Kueue) are still in go 1.26. Should we wait for them to upgrade before we do so?
cc @dentiny WDYT?
I'm not sure if we are going to upgrade to go 1.27 that early
v1.27 is already the stable release, instead of rc-release, or alpha/beta stage, I'm not sure why you think it's early stage?
Do we meet any blocks, or if there's anything you think it unreasonable?
Do you think these blockers will be addressed later if we defer upgrade?
as projects that uses KubeRay (e.g. Kueue) are still in go 1.26. Should we wait for them to upgrade before we do so?
I'm not sure all dependencies are well-maintained and will upgrade to latest version even. I'd like to keep updated to stable release.
In terms of kueue, as a separate topic, I could take a look and see if I could make an upgrade.
I'm not sure why you think it's early stage? Do we meet any blocks, or if there's anything you think it unreasonable? Do you think these blockers will be addressed later if we defer upgrade?
No hard blocker, my concern was about downstream propagation. Based on https://go.dev/doc/toolchain#config
A module’s go line must declare a version greater than or equal to the go version declared by each of the modules listed in require statements. A workspace’s go line must declare a version greater than or equal to the go version declared by each of the modules listed in use statements.
For example, if module M requires a dependency D with a go.mod that declares go 1.22.0, then M’s go.mod cannot say go 1.21.3.
If we upgrade to go 1.27, it will force all project that use kuberay as dependency to also upgrade to 1.27 to use newer KubeRay version. After second thought, I think it should be fine, as projects like Kueue follow new Go versions closely. Slower consumers can simply stay on older KubeRay releases.
@chacha923 Please fix the CI failure
Broken golangci-lint version check
Low Severity
<!-- DESCRIPTION START -->
The version comparison now strips the leading v from GOLANGCILINT_VERSION while still installing via go install, which reports a version that keeps the v prefix. The version --short rename alone should not change that format, so the check no longer matches and install-golint reinstalls on every run.
<!-- DESCRIPTION END -->
<!-- BUGBOT_BUG_ID: 8dc3fb4a-213f-464c-b341-345a655cc4d8 -->
<!-- LOCATIONS START
historyserver/Makefile#L156-L157
LOCATIONS END -->
<div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjI5MzZlOTg1LTQ1YjAtNDhjYS1hYWMwLTRiNDIzYjg5NzBkMyIsImVuY3J5cHRpb25LZXkiOiJqSEQyLW5ZWXByYkJ0a3o4dU0ta1JVVGYtR0hKQlVfaVRNdHJFZVFWb1pjIiwiYnJhbmNoIjoiY2kvdXBncmFkZS1nby0xLTI3IiwicmVwb093bmVyIjoicmF5LXByb2plY3QiLCJyZXBvTmFtZSI6Imt1YmVyYXkiLCJwcm92aWRlciI6ImdpdGh1YiJ9fQ" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a> <a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjI5MzZlOTg1LTQ1YjAtNDhjYS1hYWMwLTRiNDIzYjg5NzBkMyIsImVuY3J5cHRpb25LZXkiOiJqSEQyLW5ZWXByYkJ0a3o4dU0ta1JVVGYtR0hKQlVfaVRNdHJFZVFWb1pjIiwiYnJhbmNoIjoiY2kvdXBncmFkZS1nby0xLTI3IiwicmVwb093bmVyIjoicmF5LXByb2plY3QiLCJyZXBvTmFtZSI6Imt1YmVyYXkiLCJwck51bWJlciI6NTE4OCwiY29tbWl0U2hhIjoiOTVkMzIzMzFlNjkyMTc4NTU3NDZkNTY2MzNhMTQ0M2UzNWE3MTUwNiIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div>
<sup>Reviewed by Cursor Bugbot for commit 95d32331e69217855746d56633a1443e35a71506. Configure here.</sup>
Could you please open an issue to track this?
Sure. I’ll keep the Go 1.27 upgrade scoped to the current issue. Once the repository has been upgraded to Go 1.27, I’ll open a follow-up issue to track the embedlit cleanup and re-enable the analyzer.
With golangci-lint v2.13.1, version --short outputs 2.13.1 without the leading v. The patsubst normalizes v2.13.1 to the same format. I also verified that the Makefile takes the “version match” branch and does not reinstall the binary.
@chacha923 Please fix the CI failure
@machichima Build historyserver is failing in TestShutdown_DrainsRetriedTasks. The same failure has also occurred in #5018, #5126, and #5190, so it does not appear specific to this Go 1.27 change. I don’t have permission to rerun the job. Could you please help rerun it?
Just curious, what's the reason for changing this?
Why change to go install?
I saw the doc said:
Using go install/go get, “tools pattern”, and tool command/directives installations aren’t guaranteed to work.
We recommend using binary installation.
https://golangci-lint.run/docs/welcome/install/local/#install-from-sources
Just curious, what's the reason for changing this?
This was required by the updated gosec check, which reported G703 because a request-derived path was passed to http.ServeFile. This handler only needs the Swagger filename, so path.Base preserves valid requests while preventing path components from reaching the local file path.
Why change to go install?
> I saw the doc said:
> > Using go install/go get, “tools pattern”, and tool command/directives installations aren’t guaranteed to work.
> We recommend using binary installation.
> https://golangci-lint.run/docs/welcome/install/local/#install-from-sources
The existing binary installer failed in CI while installing v2.13.1 due to a checksum mismatch, so go install was used as a workaround. However, you’re right that upstream recommends binary installation. I’ll restore the documented binary installation method instead of keeping the source installation.
Thanks!
This is related to https://github.com/golangci/golangci-lint/issues/6751.
Should change to https://golangci-lint.run/install.sh instead.
Broken golangci-lint install URL remains
Low Severity
<!-- DESCRIPTION START -->GOLANGCI_LINT_VERSION is now v2.13.1, but apiserver still installs via the GitHub master install.sh. That installer hits the known checksum mismatch for v2.13.1, so a clean make golangci-lint or make dev-tools in apiserver fails. apiserversdk was switched to https://golangci-lint.run/install.sh, leaving the two Makefiles inconsistent.
<!-- DESCRIPTION END -->
<!-- BUGBOT_BUG_ID: da206d1b-922e-495f-9c51-89c7263394d7 -->
<!-- LOCATIONS START
apiserver/Makefile#L257-L258
LOCATIONS END -->
<div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmE3YzgzZDI0LTJmM2EtNDhlMy05NWI1LWFkNjlhYmQzYjVlMyIsImVuY3J5cHRpb25LZXkiOiJRY1hianhzZmZxLW50SXgxMDdDaC1teVNPQ05LS1otUTNWTGktWmNEb08wIiwiYnJhbmNoIjoiY2kvdXBncmFkZS1nby0xLTI3IiwicmVwb093bmVyIjoicmF5LXByb2plY3QiLCJyZXBvTmFtZSI6Imt1YmVyYXkiLCJwcm92aWRlciI6ImdpdGh1YiJ9fQ" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a> <a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmE3YzgzZDI0LTJmM2EtNDhlMy05NWI1LWFkNjlhYmQzYjVlMyIsImVuY3J5cHRpb25LZXkiOiJRY1hianhzZmZxLW50SXgxMDdDaC1teVNPQ05LS1otUTNWTGktWmNEb08wIiwiYnJhbmNoIjoiY2kvdXBncmFkZS1nby0xLTI3IiwicmVwb093bmVyIjoicmF5LXByb2plY3QiLCJyZXBvTmFtZSI6Imt1YmVyYXkiLCJwck51bWJlciI6NTE4OCwiY29tbWl0U2hhIjoiMjFkOGQ0NGI4OTY1MjM0ZjQ0OTRkYzFkZDA2ZDEyMjA4NDI4OWI2NiIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div>
<sup>Reviewed by Cursor Bugbot for commit 21d8d44b8965234f4494dc1dd06d122084289b66. Configure here.</sup>
<!-- BUGBOT_REVIEW -->
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
<!-- BUGBOT_FIX_ALL -->
<a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9BTExfSU5fQ1VSU09SIiwiZGF0YSI6eyJyZWRpc0tleSI6ImJ1Z2JvdC1tdWx0aTo4ZWI1NDgwZC1kNDM3LTRiYWItOTE2Yy0xNzg4OTRhZDMyZmYiLCJlbmNyeXB0aW9uS2V5IjoiOE16VDRibzdJZkFTbjZtc055MjB5Yk1pdGhsbUFkS2ZrbTVLTEdzSW9CNCIsImJyYW5jaCI6ImNpL3VwZ3JhZGUtZ28tMS0yNyIsInJlcG9Pd25lciI6InJheS1wcm9qZWN0IiwicmVwb05hbWUiOiJrdWJlcmF5IiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix All in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>
<!-- /BUGBOT_FIX_ALL -->
<sup>Reviewed by Cursor Bugbot for commit 21d8d44b8965234f4494dc1dd06d122084289b66. Configure here.</sup>
@chacha923
Approved these changes.
Hi @kevin85421, a gentle follow-up: CI is passing, the merge conflicts are resolved, and the embedlit cleanup is tracked in #5246. When you have a chance, could you please take a final look and help merge this PR if everything looks good? Thanks!
Hi @zhuangzhewei09 ,
Could you please fix the conflict? Thanks!
This PR is on the list for final review from committers
Hi @zhuangzhewei09 , Could you please fix the conflict? Thanks! This PR is on the list for final review from committers
fix conflicted
win5923
zhuangzhewei09
<!-- Thank you for your contribution! -->
Why are these changes needed?
This change aligns the Kuberay repository with Go 1.27 after recent CI and build-tooling compatibility differences. It updates Go toolchain declarations, build/test images, and lint/tooling references to keep CI and local workflows consistent and avoid version drift between components.
Related issue number
Closes #5178
Labels
<!-- Please add the appropriate labels to this PR. -->
doc-updates-requiredlabel.breaking-changelabel.Checks
- [ ] Unit tests
- [ ] Manual tests
- [x] This PR is not tested :(