Skip to content

feat: bump go to 1.27 - #21721

Open
kruskall wants to merge 17 commits into
elastic:mainfrom
kruskall:feat/go1.27
Open

kruskall wants to merge 17 commits into
elastic:mainfrom
kruskall:feat/go1.27

Conversation

@kruskall

Copy link
Copy Markdown
Member

Motivation/summary

keep go version up to date
run make fmt
bump swiss lib to fix compile error

Checklist

For functional changes, consider:

  • Is it observable through the addition of either logging or metrics?
  • Is its use being published in telemetry to enable product improvement?
  • Have system tests been added to avoid regression?

How to test these changes

Related issues

@kruskall
kruskall requested a review from a team as a code owner August 24, 2026 04:57
@github-actions

Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@mergify

mergify Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

This pull request does not have a backport label. Could you fix it @kruskall? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8.19 is the label to automatically backport to the 8.19 branch.
  • backport-9./d is the label to automatically backport to the 9./d branch. /d is the digit.
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

@carsonip carsonip added backport-active-9 Automated backport with mergify to all the active 9.[0-9]+ branches backport-active-8 Automated backport with mergify to all the active 8.[0-9]+ branches labels Sep 7, 2026

@carsonip carsonip left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

could you look into CI failures first

@mergify

mergify Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

This pull request is now in conflicts. Could you fix it @kruskall? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b feat/go1.27 upstream/feat/go1.27
git merge upstream/main
git push upstream feat/go1.27

@carsonip carsonip changed the title feat: bump go to 1.27.0 feat: bump go to 1.27.1 Sep 12, 2026
@lanre-ade
lanre-ade requested a lite review from Copilot September 16, 2026 02:53

Copilot AI 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.

🟢 Approval recommended

The reviewed changes are consistent Go 1.27.1 updates with no unresolved review comments.

Pull request overview

Updates the repository and Go submodules to Go 1.27.1 with related tooling and code modernizations.

Changes:

  • Bumps Go versions and Staticcheck dependencies.
  • Applies errors.AsType, slices.Backward, and typed atomic improvements.
  • Updates formatting and composite literals.
File summaries
File Changes
x-pack/apm-server/sampling/reservoir.go Modernizes embedded struct initialization and formatting.
x-pack/apm-server/sampling/processor_test.go Updates test literals and formatting.
x-pack/apm-server/sampling/groups_test.go Simplifies policy literals.
x-pack/apm-server/sampling/config_test.go Simplifies policy initialization.
x-pack/apm-server/main.go Modernizes policy construction.
systemtest/go.mod Updates the system-test Go version.
internal/sourcemap/sourcemap_fetcher_test.go Updates embedded-field literals.
internal/sourcemap/processor.go Uses slices.Backward.
internal/sourcemap/metadata_fetcher_test.go Updates metadata test literals.
internal/sourcemap/elasticsearch.go Uses errors.AsType.
internal/publish/acker.go Uses typed atomic counters.
internal/beater/waitready.go Uses errors.AsType.
internal/beater/middleware/middleware.go Uses slices.Backward.
internal/beater/api/intake/handler.go Uses errors.AsType.
integrationservertest/go.mod Updates the integration-test Go version.
go.sum Refreshes tooling checksums.
go.mod Updates Go and Staticcheck dependencies.
cmd/intake-receiver/go.mod Updates the intake receiver Go version.
Review details
  • Files reviewed: 17/18 changed files
  • Comments generated: 0
  • Review effort level: Lite

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

@carsonip

Copy link
Copy Markdown
Member

Blocked by #21924

@kruskall kruskall changed the title feat: bump go to 1.27.1 feat: bump go to 1.27.2 Oct 14, 2026
@mergify

mergify Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

This pull request is now in conflicts. Could you fix it @kruskall? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b feat/go1.27 upstream/feat/go1.27
git merge upstream/main
git push upstream feat/go1.27

@kruskall kruskall changed the title feat: bump go to 1.27.2 feat: bump go to 1.27 Oct 20, 2026
@mergify

mergify Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

This pull request is now in conflicts. Could you fix it @kruskall? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b feat/go1.27 upstream/feat/go1.27
git merge upstream/main
git push upstream feat/go1.27

Copilot AI lite review requested due to automatic review settings November 6, 2026 16:47

Copilot AI 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.

🔵 Needs a closer look

Approval should be deferred until the partial Go 1.27 x/net/http2 compatibility-tag routing is validated across direct builds, Make targets, and system tests for TLS and gRPC behavior.

No open issues 🎉

Review effort: Lite

@aelnahas aelnahas self-assigned this Nov 6, 2026
@mergify

mergify Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request

Copilot AI lite review requested due to automatic review settings November 13, 2026 19:57

Copilot AI 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.

🔵 Needs a closer look

Critical compile errors remain across production and test files due to promoted fields being used as direct keyed struct-literal fields.

No open issues 🎉

8 previously missed issues

In code that hasn't changed since last review

High severity Restore explicit identifier initializer in metadata literals

internal/​sourcemap/​metadata_fetcher_test.go:42

name, version, and path are promoted from the embedded identifier; promoted fields cannot be used directly in a keyed metadata literal. This test file therefore does not compile; restore the explicit identifier initializer.

This issue also appears in the following locations of the same file:

  • line 178
  • line 220
High severity Restore explicit identifier initializer in metadata literal

internal/​sourcemap/​sourcemap_fetcher_test.go:35

name, version, and path are promoted from the embedded identifier; promoted fields cannot be used directly in a keyed metadata literal. This test file therefore does not compile; restore the explicit identifier initializer.

High severity Nest criteria fields under PolicyCriteria in struct literal

x-pack/​apm-server/​main.go:129

The criteria fields are promoted through the embedded PolicyCriteria in sampling.Policy. Using them as direct keyed fields is not allowed in Go struct literals and makes this package fail to compile; assign an explicit PolicyCriteria value instead.

High severity Restore explicit PolicyCriteria field in Policy literal

x-pack/​apm-server/​sampling/​config_test.go:44

ServiceName is promoted from the embedded PolicyCriteria, so it cannot be specified directly in this sampling.Policy literal. This is a compile error; restore the explicit PolicyCriteria field.

High severity Nest policy criteria under explicit PolicyCriteria field

x-pack/​apm-server/​sampling/​groups_test.go:45

ServiceName, ServiceEnvironment, TraceName, and TraceOutcome are promoted from the embedded PolicyCriteria; promoted fields cannot be used directly in a keyed Policy literal. This prevents the test package from compiling, so the criteria need to remain under an explicit PolicyCriteria field.

This issue also appears in the following locations of the same file:

  • line 207
  • line 209
High severity Initialize TraceName under explicit PolicyCriteria field

x-pack/​apm-server/​sampling/​processor_test.go:355

TraceName is promoted from the embedded PolicyCriteria, so it cannot be used as a keyed field in a sampling.Policy literal. This is a compile error; initialize PolicyCriteria explicitly as in the previous version.

This issue also appears on line 357 of the same file.

High severity Restore explicit Config initializer in testConfig literal

x-pack/​apm-server/​sampling/​processor_test.go:1090

BatchProcessor, MeterProvider, and the sampling/storage fields are promoted through the embedded sampling.Config (which itself embeds the local and remote configs). They cannot be used as direct keyed fields in a testConfig literal, so this change makes the tests fail to compile. Restore the explicit Config: sampling.Config{...} initializer.

High severity Restore itemheap initializer in weightedRandomSample literal

x-pack/​apm-server/​sampling/​reservoir.go:28

keys and values are promoted fields of the embedded itemheap; promoted fields cannot be specified directly in a keyed struct literal. This produces unknown field keys/values in struct literal of type weightedRandomSample and prevents the package from compiling. Keep the itemheap: itemheap{...} initializer here.

Review effort: Lite

Copilot AI lite review requested due to automatic review settings November 13, 2026 20:18

Copilot AI 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.

🔵 Needs a closer look

The Go 1.27 and x/net/http2 upgrades, including the global http2legacy workaround, affect build and production HTTP/2, gRPC, and TLS behavior across FIPS, system-test, and gmux paths, requiring CI and runtime integration validation beyond static review.

No open issues 🎉

Review effort: Lite

Copilot AI lite review requested due to automatic review settings November 18, 2026 16:35

Copilot AI 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.

🟡 Changes recommended

A critical active issue remains because direct build and test entry points omit the required http2legacy workaround, potentially producing broken HTTP/gRPC multiplexing with Go 1.27 and x/net v0.62.

1 open issue

Review effort: Lite

Comment thread Makefile
# package on go 1.27 https://pkg.go.dev/golang.org/x/net/http2
# An issue is created to implement long term fix on
# gmux: https://github.com/elastic/gmux/issues/103
DEFAULT_TAGS=grpcnotrace,pebblegozstd,nooteloutput,http2legacy
Copilot AI lite review requested due to automatic review settings November 20, 2026 20:47

Copilot AI 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.

Comment on lines +40 to +42
name: "app",
version: "1.0",
path: "/bundle/path",
Comment on lines +33 to +35
name: "app",
version: "1.0",
path: "/bundle/path",
Comment thread x-pack/apm-server/main.go
Comment on lines +125 to +129
ServiceName: in.Service.Name,
ServiceEnvironment: in.Service.Environment,
TraceName: in.Trace.Name,
TraceOutcome: in.Trace.Outcome,
SampleRate: in.SampleRate,
assertInvalidConfigError("invalid local sampling config: Policies unspecified")
config.Policies = []sampling.Policy{{
PolicyCriteria: sampling.PolicyCriteria{ServiceName: "foo"},
ServiceName: "foo",
Comment on lines +42 to +45
ServiceName: serviceName,
ServiceEnvironment: serviceEnvironment,
TraceName: traceName,
TraceOutcome: traceOutcome,
Comment on lines +354 to +355
TraceName: "trace_name",
SampleRate: 0.5,
Comment on lines +1084 to +1088
tempDir: tempdir,
metricReader: reader,
BatchProcessor: modelpb.ProcessBatchFunc(func(context.Context, *modelpb.Batch) error { return nil }),
MeterProvider: mp,
FlushInterval: time.Second,
Comment on lines +26 to +28
rng: rng,
keys: make([]float64, 0, reservoirSize),
values: make([]string, 0, reservoirSize),
Copilot AI lite review requested due to automatic review settings November 26, 2026 03:06

Copilot AI 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.

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @aelnahas

This branch has not been deployed

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

Labels

backport-active-8 Automated backport with mergify to all the active 8.[0-9]+ branches backport-active-9 Automated backport with mergify to all the active 9.[0-9]+ branches

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants