Skip to content

Go: separate max supported Go version from the Go version to install#21456

Open
owen-mc wants to merge 3 commits intogithub:mainfrom
owen-mc:go/max-supported-version
Open

Go: separate max supported Go version from the Go version to install#21456
owen-mc wants to merge 3 commits intogithub:mainfrom
owen-mc:go/max-supported-version

Conversation

@owen-mc
Copy link
Contributor

@owen-mc owen-mc commented Mar 11, 2026

This allows us to update the max supported Go version after testing with a release candidate, but before the new version has been released. In particular, it will mean that we can merge a PR allowing us to tolerate the new version before it is released, which removes the urgency from merging the PRs to fully support and use the new version as soon as it is released.

@owen-mc owen-mc added the no-change-note-required This PR does not need a change note label Mar 11, 2026
@github-actions github-actions bot added the Go label Mar 11, 2026
@owen-mc owen-mc requested a review from mbg March 11, 2026 16:24
@owen-mc owen-mc marked this pull request as ready for review March 13, 2026 09:33
@owen-mc owen-mc requested review from a team as code owners March 13, 2026 09:33
Copilot AI review requested due to automatic review settings March 13, 2026 09:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR separates the maximum supported Go version from the Go version the autobuilder will actually install, enabling early updates to the supported-range ceiling (e.g., based on RC testing) without requiring the new Go release to exist yet.

Changes:

  • Introduces goVersionToInstall alongside maxGoVersion to distinguish “supported” vs “installable (released)” Go versions.
  • Updates autobuilder version-selection diagnostics and behavior to request goVersionToInstall in several “best effort” paths.
  • Adds a small test asserting goVersionToInstall is not newer than maxGoVersion and updates expectations in existing version-selection tests.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
go/extractor/autobuilder/build-environment.go Adds goVersionToInstall and updates selection logic/diagnostic messages to install the released maximum rather than the supported maximum.
go/extractor/autobuilder/build-environment_test.go Adjusts expectations to goVersionToInstall and adds a guard test for version ordering.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines 119 to +128
@@ -119,8 +124,8 @@ func getVersionWhenGoModVersionTooHigh(v versionInfo) (msg string, version util.
") is above the supported range (" + minGoVersion.String() + "-" + maxGoVersion.String() +
"). The version of Go installed in the environment (" + v.goEnvVersion.String() +
") is below the maximum supported version (" + maxGoVersion.String() +
"). Requesting the maximum supported version of Go (" + maxGoVersion.String() + ")."
version = maxGoVersion
"). Requesting the maximum supported version of Go that has been released (" + goVersionToInstall.String() + ")."
version = goVersionToInstall
if goVersionToInstall.IsNewerThan(maxGoVersion) {
t.Errorf("goVersionToInstall (%s) should not be newer than maxGoVersion (%s).", goVersionToInstall, maxGoVersion)
}
}
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

@jketema jketema left a comment

Choose a reason for hiding this comment

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

Looks sensible.

Copy link
Member

@mbg mbg left a comment

Choose a reason for hiding this comment

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

A few thoughts/questions/concerns here that I'd like to see addressed in the PR/code comments (or offline):

  • We discussed that you should test whether recent Go toolchains even allow us to exceed the Go compiler version that our Go extractor was compiled with. Have you done that (and if so, under which circumstances does/doesn't it?)
  • How does this interact with Go's own ability to install newer toolchain versions? E.g. if a new Go version is out, but we still only support the previous, and the Go toolchain downloads the new one, does that currently always break? Would this change here make any difference (beyond saving us from downloading a toolchain version we don't need)?
  • Given our releases are typically every two weeks and this change requires us to manually bump the version, release it, etc. - do we think there's a big enough benefit? I.e. that a new Go version RC is released, but we are not ready to support it, but do know that we can tolerate it and ship that change faster than full support?
  • I believe we have some tests for this logic in the internal repository. Will those need updating now? Are they going to break when maxGoVersion and goVersionToInstall diverge for the first time?

Comment on lines +16 to +20
// This can be increased before a new minor version has been released, based on testing with the release candidates.
var maxGoVersion = util.NewSemVer("1.26")

// This should be the maximum supported version which has been released.
var goVersionToInstall = util.NewSemVer("1.26")
Copy link
Member

Choose a reason for hiding this comment

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

These comments should be more precise in talking about:

  • Which "version" they refer to? Go toolchain? Go language? CodeQL version?
  • Right now, these comments alone are not enough to understand how they interact with each other and the environment. Could you add some general comment(s) with examples along the lines of e.g. "If Go 1.26 is released, but we only support Go 1.25, then we can bump .... to 1.26 anyway if we can at least tolerate it"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Go no-change-note-required This PR does not need a change note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants