Go: When go.mod version is above maxGoVersion request go.mod version - #22458
Open
jketema wants to merge 1 commit into
Open
Go: When go.mod version is above maxGoVersion request go.mod version#22458jketema wants to merge 1 commit into
go.mod version is above maxGoVersion request go.mod version#22458jketema wants to merge 1 commit into
Conversation
jketema
force-pushed
the
jketema/go-max-version
branch
2 times, most recently
from
August 28, 2026 10:44
fa780b0 to
5502db8
Compare
jketema
force-pushed
the
jketema/go-max-version
branch
from
September 3, 2026 10:51
5502db8 to
097d278
Compare
jketema
marked this pull request as ready for review
September 3, 2026 12:08
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The reviewed changes have no blocking issues; only a non-blocking naming nit remains.
Review tier: Balanced
Findings: None
What changed in this PR
Updates Go environment resolution to request the version required by go.mod rather than capping it at the extractor’s maximum supported version.
Changes:
- Revises Go toolchain selection and diagnostics.
- Expands version-selection test coverage.
- Updates integration-test expectations for newer Go versions.
Review note: Non-blocking nit in diagnostics.go:458: rename the emitter to include EnvVersionTooHigh and update its caller for API consistency.
| File | Description |
|---|---|
go/ql/integration-tests/diagnostics/newer-go-version-needed/build_environment.expected |
Expects the newer Go version to be requested. |
go/extractor/diagnostics/diagnostics.go |
Updates toolchain telemetry diagnostics. |
go/extractor/autobuilder/build-environment.go |
Revises Go toolchain selection logic. |
go/extractor/autobuilder/build-environment_test.go |
Tests the revised version-selection scenarios. |
Suppressed comments (1)
go/extractor/diagnostics/diagnostics.go:458
- This sibling uniquely drops
VersionfromEnvVersion, even though it classifiesgoEnvVersionjust like the adjacent emitters. Rename it toEmitGoModVersionTooHighAndEnvVersionTooHigh(and update the caller) to keep the diagnostics API consistent and unambiguous.
func EmitGoModVersionTooHighAndEnvTooHigh(msg string) {
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We currently block analysis of projects that target a Go version that is too new. If we do not do this, we get an error like the following when the user has not selected the correct Go toolchain in their workflow:
This seems quite strict, as we could just as well download the newer version through the existing mechanisms that we have for this. This PR together with the related internal changes does just that.
Because of the version mismatch we might see some additional parse errors on projects that are too new. Given the number of syntax changes between recent Go versions this seems acceptable. Database quality might be slightly lower, but at least the won't block users until we have updated the extractor.