Conversation
fa780b0 to
5502db8
Compare
5502db8 to
097d278
Compare
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.
| {"9999.1", "9999.0"}: "9999.1", | ||
| {"9999.0", "9999.1"}: "", | ||
| {"9999.0", "9999.0"}: "", | ||
| {"9999.0rc2", ""}: "v9999.0.0-rc2", |
There was a problem hiding this comment.
| {"9999.0rc2", ""}: "v9999.0.0-rc2", | |
| {"9999.0rc2", ""}: "9999.0.0-rc2", |
The "v" seems inconsistent. (Both versions pass, since the test uses util.NewSemVer(expected).)
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:
See, e.g., here. 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.