Skip to content

Go: Update to 1.27 - #22042

Merged
jketema merged 8 commits into
mainfrom
jketema/go-1.27
Aug 20, 2026
Merged

Go: Update to 1.27#22042
jketema merged 8 commits into
mainfrom
jketema/go-1.27

Conversation

@jketema

@jketemajketema commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Note that all tests failing here pass on the internal PR.

@jketemajketema added the depends on internal PR This PR should only be merged in sync with an internal Semmle PR label Jun 24, 2026
@jketema
jketemaforce-pushed the jketema/go-1.27 branch 3 times, most recently from f0842b5 to 91e1d28CompareJune 30, 2026 15:20

@owen-mcowen-mc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

First pass review.

Comment threadgo/extractor/extractor.go Outdated
Comment threadgo/extractor/extractor.go Outdated
Comment threadgo/extractor/extractor.go Outdated
Comment threadgo/extractor/extractor.go Outdated
Comment threadgo/ql/test/library-tests/semmle/go/Function/genericMethods.go Outdated
@jketema
jketemaforce-pushed the jketema/go-1.27 branch 7 times, most recently from ecdd643 to 48c57e3CompareJuly 14, 2026 12:10
@jketema
jketema marked this pull request as ready for review August 19, 2026 21:53
@jketema
jketema requested review from a team as code ownersAugust 19, 2026 21:53
CopilotAI balanced review requested due to automatic review settings August 19, 2026 21:53

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates CodeQL’s Go support to Go 1.27, including generic method extraction.

Changes:

  • Updates SDK, toolchain, CI, and supported-version documentation.
  • Handles Go 1.27 generic method type parameters and receivers.
  • Adds generic method fixtures and expected results.
Show a summary per file
FileDescription
MODULE.bazelPins Go SDK 1.27.0.
go/extractor/go.modUpdates Go and toolchain versions.
go/extractor/extractor.goHandles instantiated generic method parameters.
go/extractor/trap/labels.goResolves originating receiver objects.
go/extractor/autobuilder/build-environment.goRaises maximum supported Go version.
go/extractor/toolchain/toolchain_test.goApplies Go 1.27 formatting.
go/actions/test/action.ymlRuns tests with Go 1.27.0.
go/ql/test/library-tests/semmle/go/Function/go.modEnables Go 1.27 test syntax.
go/ql/test/library-tests/semmle/go/Function/genericMethods.goAdds generic method fixtures.
go/ql/test/library-tests/semmle/go/Function/TypeParamType.expectedUpdates type-parameter results.
go/ql/test/library-tests/semmle/go/Function/getTypeParameter.expectedUpdates declaration results.
go/ql/test/library-tests/semmle/go/Function/getParameter.expectedUpdates method parameter results.
go/ql/test/library-tests/semmle/go/Function/GenericFunctionInstantiationExpr.expectedUpdates instantiation results.
go/ql/lib/change-notes/2026-06-25-go-1.27.mdAnnounces Go 1.27 support.
docs/codeql/reusables/supported-versions-compilers.rstDocuments Go 1.27 support.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 14/15 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment on lines +1676 to +1683
// As a parent we use the origin method. This suffices, as the name
// and index of the type parameter in the instantiation will be
// identical to those of the uninstantiated method, and as only
// these two properties will be extracted for a type parameter.
if tp.Method(i) != meth {
signature := tp.Method(i).Type().(*types.Signature)
populateTypeParamParents(signature.TypeParams(), meth, false)
}

@jketemajketemaAug 20, 2026

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

There is indeed an issues here. Consider the following:

typeStructWithDependentBound[Pany] struct{}
func (*StructWithDependentBound[P]) GenericMethodWithDependentBound[Q~[]P](xQ) {}
funcgenericMethodDependentBounds(
withIntStructWithDependentBound[int],
withStringStructWithDependentBound[string],
) {
withInt.GenericMethodWithDependentBound([]int{})
withString.GenericMethodWithDependentBound([]string{})
}

then

fromTypeParamTypeparameterselectparameter.getParamName(),parameter.getConstraint().pp()

produces:

| P | interface { } |
| Q | interface { ~[]P } |
| Q | interface { ~[]int } |
| Q | interface { ~[]string } |

and there are dataset check errors:

[INVALID_KEY_SET] predicate typeparam(@typeparamtype tp, string name, @compositetype bound, @typeparamparentobject parent, int idx, boolean is_from_recv): The key set {parent, idx, is_from_recv} does not functionally determine all fields.
Here is a pair of tuples that agree on the key set but differ at index 2:
Tuple 1 in row 2: (81,"Q",87,52,0,false)
Tuple 2 in row 3: (81,"Q",155,52,0,false)
Relevant element: tp=81
Full ID for 81: @"(53),0,false,Q;typeparamtype". The ID may expand to @"{@"{@"{@"(50)"},GenericMethodWithDependentBound;method"}"},0,false,Q;typeparamtype"
Relevant element: Tuple 1: bound=87
Full ID for 87: @";(86);interfacetype". The ID may expand to @";{@"{@"~{@"(83)"};typesetliteraltype"}"};interfacetype"
Relevant element: Tuple 2: bound=155
Full ID for 155: @";(154);interfacetype". The ID may expand to @";{@"{@"~{@"(147)"};typesetliteraltype"}"};interfacetype"
Relevant element: parent=52
Full ID for 52: @"(51),GenericMethodWithDependentBound;method". The ID may expand to @"{@"{@"{@"(47)"};pointertype"}"},GenericMethodWithDependentBound;method"
[INVALID_KEY] predicate typeparam(@typeparamtype tp, string name, @compositetype bound, @typeparamparentobject parent, int idx, boolean is_from_recv): The key set {tp} does not functionally determine all fields.
Here is a pair of tuples that agree on the key set but differ at index 2:
Tuple 1 in row 2: (81,"Q",87,52,0,false)
Tuple 2 in row 3: (81,"Q",155,52,0,false)
Relevant element: tp=81
Full ID for 81: @"(53),0,false,Q;typeparamtype". The ID may expand to @"{@"{@"{@"(50)"},GenericMethodWithDependentBound;method"}"},0,false,Q;typeparamtype"
Relevant element: Tuple 1: bound=87
Full ID for 87: @";(86);interfacetype". The ID may expand to @";{@"{@"~{@"(83)"};typesetliteraltype"}"};interfacetype"
Relevant element: Tuple 2: bound=155
Full ID for 155: @";(154);interfacetype". The ID may expand to @";{@"{@"~{@"(147)"};typesetliteraltype"}"};interfacetype"
Relevant element: parent=52
Full ID for 52: @"(51),GenericMethodWithDependentBound;method". The ID may expand to @"{@"{@"{@"(47)"};pointertype"}"},GenericMethodWithDependentBound;method"

Copilot's proposed fix is not near being correct.

@jketema
jketema merged commit d24ab5e into mainAug 20, 2026
84 of 90 checks passed
@jketema
jketema deleted the jketema/go-1.27 branch August 20, 2026 08:38
sergeyfarin added a commit to sergeyfarin/rekenraam that referenced this pull request Aug 23, 2026
The pause had a restore condition but no date, which left it resting on
someone remembering to check. Upstream has both.
github/codeql#22042 "Go: Update to 1.27" merged 2026-08-20, three days
before the pause, and github/codeql#22394 — the same extraction failure
this repo hit, filed against gitea — has a CodeQL maintainer saying the
change ships in "the next release". That release is not 2.26.3, which
predates the merge by eight days, so it lands in 2.26.4. Bundles have
shipped roughly fortnightly (2.26.0 through 2.26.3 spanned 8 Jul to
12 Aug), putting 2.26.4 around early September 2026.
Record the issue numbers, the reasoning, and the one-line check that
answers "is it ready yet" in both the workflow comment and
developer-workflow.md.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

depends on internal PRThis PR should only be merged in sync with an internal Semmle PRdocumentationGo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@jketema@owen-mc