Repository navigation
[8.19](backport #8247) chore(deps): update Go to 1.27.4 - #8285
Conversation
* Update Go to 1.27.4 Bump the Go version from 1.26.10 to 1.27.4 in .go-version and the go.mod files of the main, dev-tools and testing modules. pkg/api keeps its lower go directive since it is a library. Go 1.27 changes required alongside the bump: - go vet now reports wrapping a pointer with %w when only the value type has the Error method. Pass the error in Test_ErrorResp as an error interface value so the test keeps exercising *es.ErrElastic. - Apply the output of `mage check:fix` (go fix with the Go 1.27 modernizers), which CI enforces: errors.AsType, atomic.Uint64, strings.Cut and promoted-field composite literals. No behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Fix golangci-lint findings in files touched by the Go 1.27 update The lint job runs with --whole-files, so the go fix rewrites surfaced existing goconst and gosec findings in every touched file. Fix them without changing behaviour: - Replace repeated literals with constants of the same value, reusing existing ones where they exist (file.Field*, the t* integration test constants, kElasticsearch) and adding named constants for HTTP error names, upload document fields, the ack response action and the APM error.type value. - Use testNamespace in the namespaces integration test where the literal was repeated. - Rename two copy-pasted case names in TestChunkMarksFinal so they describe what the test checks. - Annotate three gosec G101/G117 false positives on test data and an error name with explained nolint directives. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drop asapauthextension from the upstream collector e2e build TestOpAMPWithUpstreamCollector builds opentelemetry-collector-contrib from main with the repository's Go version. With Go 1.27 the resulting binary panics on startup: asapauthextension depends on github.com/SermoDigital/jose, which registers crypto.Hash(0) in an init function, and Go 1.27's crypto.RegisterHash panics on that (open-telemetry/opentelemetry-collector-contrib#51868). The test only needs the OpAMP extension, so remove asapauthextension from the builder config before building, until upstream is fixed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Apply go fix to tests merged from main #8091 added test code that Go 1.27's go fix rewrites (promoted-field composite literals), which made check:ci fail after main was merged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Borja Aranda <me@fbac.dev> (cherry picked from commit a937df3) # Conflicts: # internal/pkg/api/error.go # internal/pkg/api/error_test.go # internal/pkg/api/handleAck_test.go # internal/pkg/api/handleCheckin_test.go # internal/pkg/api/handleEnroll_test.go # internal/pkg/api/handleFileDelivery_test.go # internal/pkg/api/handleOpAMP.go # internal/pkg/api/handleOpAMP_test.go # internal/pkg/file/delivery/delivery_test.go # internal/pkg/file/es.go # internal/pkg/file/es_test.go # internal/pkg/file/uploader/finalize_test.go # internal/pkg/file/uploader/upload.go # internal/pkg/file/uploader/upload_test.go # internal/pkg/policy/monitor_test.go # internal/pkg/policy/policy_output_test.go # internal/pkg/server/integration_consts_test.go # internal/pkg/server/namespaces_integration_test.go # internal/pkg/server/remote_es_output_integration_test.go # internal/pkg/testing/es_helpers.go # testing/e2e/scaffold/scaffold.go # testing/e2e/stand_alone_test.go
|
Cherry-pick of a937df3 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
|
This pull request is merged. |
Dependency Update AnalysisSummary: This PR updates the Go toolchain pin from Dependency 1: Go toolchain
|
| Check | Result |
|---|---|
| Breaking changes | ✅ None found for current repo usage |
| Testable in PR | ✅ Yes — .github/workflows/golangci-lint.yml runs on pull_request and uses .go-version |
Changelog highlights (`1.26.11` → `1.27.4`)
- Upstream GitHub release-note body was unavailable via MCP (
golang/gohas no matching GitHub releases forgo1.27.4), so analysis used local metadata. - PR commit message documents required compatibility adjustments for Go 1.27 (vet/gofix/lint-related modernizations) and a test-only workaround for upstream collector panic behavior.
- No CVE/GHSA identifiers were present in available local metadata for this bump.
Usage in this repository
- Version pins updated in:
.go-version:1go.mod:3dev-tools/go.mod:3testing/go.mod:3
- CI/workflow usage of
.go-version:.github/workflows/golangci-lint.yml:32-34(pull_request,actions/setup-gowithgo-version-file).github/workflows/post-dependency-update.yml:22-24(pushto dependency-update branches)
Compatibility assessment
- This is a Go minor train bump (1.26 → 1.27), not a Go module major-version import-path change.
- Repository changes in this PR already adapt touched code/tests to Go 1.27 toolchain behavior.
- No evidence of removed APIs or required config changes affecting current Fleet Server usage patterns.
- Security posture appears unchanged/slightly improved (newer toolchain), with no identified newly introduced attack surface from available evidence.
Labels Applied
oblt-aw/ai/merge-ready— applied (risk low-to-moderate, no repo-impacting breaking changes identified, PR-testable path present).
What is this? | From workflow: Observability Agentic Workflow — Pull Request
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
Automerge skippedAutomerge skipped this pull request because the To allow automerge for this kind of update, enable the matching collection under Automerge on the Control Plane Dashboard (the See Opt in or opt out for how to enable or disable Automerge collections on the Control Plane Dashboard. Collections currently enabled for automerge: Changed files considered:
|
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved merge conflicts and incompatible backported code leave production packages and test suites unable to compile.
13 open issues
Error-table additions reference undefined errors and an unused variable · New Uninstall cases use fields and constants absent from 8.19 · New Enrollment tests reference missing helpers and model fields · New Range and file-library tests depend on unported implementations · New Backported handler uses APIs and model fields absent from 8.19 · New Delivery fixture references undefined fieldBID · New Unresolved merge conflicts prevent affected packages from compiling · New Backported test does not compile or match 8.19 behavior · New Size-limit check treats an integer as a pointer · New Backported monitor tests use unavailable APIs and omit an import · New Secret-collector tests depend on unavailable APIs and helpers · New Policy fixtures use the wrong Agent field type · New E2E tests depend on missing helpers and OpAMP templates · New
What changed in this PR
Backports #8247 to Fleet Server 8.19 to update the Go toolchain to 1.27.4. Alongside the version bump, the patch includes code modernizations, lint cleanup, and newer-branch handler and test additions.
Changes:
- Updates the toolchain pin and three module directives, with a changelog entry.
- Modernizes error matching, atomic counters, string splitting, and composite literals; extracts shared constants.
- Includes OpAMP collector compatibility changes and additional policy, enrollment, and file-transfer tests.
| File | Description |
|---|---|
testing/go.mod |
Updates the testing module to Go 1.27.4. |
testing/e2e/stand_alone_test.go |
Adds collector and unenrollment tests, including the upstream collector workaround. |
testing/e2e/scaffold/scaffold.go |
Changes Toxiproxy setup and retry handling. |
internal/pkg/testing/es_helpers.go |
Adds Elasticsearch API-key verification helpers. |
internal/pkg/testing/actions.go |
Simplifies action fixture initialization. |
internal/pkg/server/remote_es_output_integration_test.go |
Updates remote-output fixtures, constants, and key splitting. |
internal/pkg/server/namespaces_integration_test.go |
Updates namespace fixtures and shared constants. |
internal/pkg/server/integration_consts_test.go |
Defines shared integration-test constants. |
internal/pkg/server/fleet_integration_test.go |
Modernizes DNS error matching. |
internal/pkg/policy/self_test.go |
Simplifies policy and search-result fixtures. |
internal/pkg/policy/policy_output_test.go |
Adds secret-collector and OTLP output tests. |
internal/pkg/policy/monitor_test.go |
Modernizes fixtures and adds revision/dispatch tests. |
internal/pkg/logger/http.go |
Converts byte counters to typed atomics. |
internal/pkg/file/uploader/upload.go |
Extracts metadata constants and changes size-limit handling. |
internal/pkg/file/uploader/upload_test.go |
Updates fixtures, constants, and test-case names. |
internal/pkg/file/uploader/finalize_test.go |
Adds a refresh-before-finalization regression test. |
internal/pkg/file/es.go |
Introduces and uses a chunk-size field constant. |
internal/pkg/file/es_test.go |
Updates chunk-search fixtures and field constants. |
internal/pkg/file/delivery/delivery_test.go |
Modernizes search-result fixtures. |
internal/pkg/es/result_test.go |
Simplifies action fixture initialization. |
internal/pkg/dl/enrollment_api_key_integration_test.go |
Modernizes fixtures and documents test-data lint exceptions. |
internal/pkg/dl/action_results_integration_test.go |
Simplifies action-result fixtures. |
internal/pkg/api/handleUpload.go |
Modernizes oversized-request error matching. |
internal/pkg/api/handleUpload_test.go |
Simplifies agent and search-result fixtures. |
internal/pkg/api/handleOpAMP.go |
Adds an OpAMP enrollment and status handler. |
internal/pkg/api/handleFileDelivery_test.go |
Updates fixtures and adds range/library delivery tests. |
internal/pkg/api/handleEnroll_test.go |
Updates fixtures and adds enrollment lifecycle tests. |
internal/pkg/api/handleAudit.go |
Extracts a shared request-decoding error message. |
internal/pkg/api/handleAudit_test.go |
Reuses constants and simplifies agent fixtures. |
internal/pkg/api/handleAck.go |
Modernizes error matching and extracts the response action constant. |
internal/pkg/api/handleAck_test.go |
Updates fixtures and adds uninstall acknowledgment cases. |
internal/pkg/api/error.go |
Extracts error constants and updates error handling. |
internal/pkg/api/error_test.go |
Adds shared constants and the wrapped-pointer vet adjustment. |
go.mod |
Updates the main module to Go 1.27.4. |
dev-tools/go.mod |
Updates developer tooling to Go 1.27.4. |
changelog/fragments/1794821809-Update-Go-to-1.27.4.yaml |
Records the toolchain upgrade. |
.go-version |
Pins Go 1.27.4 for builds and tooling. |
Review effort: Balanced
This comment has been minimized.
This comment has been minimized.
Mergify's cherry-pick of the #8247 squash commit left conflict markers. Restore every file it touched to this branch's version, then re-apply what the branch needs for Go 1.27.4: - .go-version and the go directive in go.mod, dev-tools/go.mod and testing/go.mod - the changelog fragment - the go vet fix in internal/pkg/api/error_test.go This branch's check:ci does not run go fix, so the go fix rewrites and the lint fixes from #8247 are left out. It also has no upstream collector e2e test, so the asapauthextension workaround is not needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the Go 1.27.4 toolchain backport.
No open issues 🎉
13 resolved since last review
E2E tests depend on missing helpers and OpAMP templates Policy fixtures use the wrong Agent field type Secret-collector tests depend on unavailable APIs and helpers Backported monitor tests use unavailable APIs and omit an import Size-limit check treats an integer as a pointer Backported test does not compile or match 8.19 behavior Unresolved merge conflicts prevent affected packages from compiling Delivery fixture references undefined fieldBID Backported handler uses APIs and model fields absent from 8.19 Range and file-library tests depend on unported implementations Enrollment tests reference missing helpers and model fields Uninstall cases use fields and constants absent from 8.19 Error-table additions reference undefined errors and an unused variable
Review effort: Balanced
Dependency Update AnalysisSummary: This PR bumps the Go toolchain from Dependency 1: Go toolchain
|
| Check | Result |
|---|---|
| Breaking changes | ✅ None found in repository usage |
| Testable in PR | ✅ Yes — .github/workflows/golangci-lint.yml runs on pull_request with .go-version; note post-dependency-update.yml is push-only automation |
Changelog highlights (1.26.11 → 1.27.4)
- Upstream GitHub Releases for
golang/goare unavailable for this version (tag lookups were available, release endpoints returned no matching release body), so detailed upstream release-note text could not be retrieved from MCP. - Local commit metadata indicates this bump required a Go 1.27 vet compatibility adjustment in tests (
internal/pkg/api/error_test.go) and otherwise keeps behavior unchanged. - No CVE/GHSA identifiers were present in the locally available metadata for this PR.
Usage in this repository
- Version pin changed in
.go-version,go.mod,dev-tools/go.mod, andtesting/go.mod. - Tooling/CI consumers of
.go-versioninclude:.github/workflows/golangci-lint.yml(actions/setup-gowithgo-version-file: .go-version, PR-triggered).github/workflows/post-dependency-update.yml(actions/setup-go, push-triggered for dependency branches)magefile.go(getGoVersionreads.go-version).buildkite/scripts/common.shand.buildkite/hooks/pre-commandMakefile(GO_VERSION=$(shell cat '.go-version'))
- Functional code impact in this PR is test-only (
internal/pkg/api/error_test.go), not runtime behavior.
Compatibility assessment
- This is a minor Go version bump (
1.26→1.27), not a Go module major-version path change. - No dependency API removals/renames are introduced in this PR’s own code changes; modules continue to build against updated Go directives.
- The only code adjustment addresses stricter vet behavior in Go 1.27 and preserves test intent.
- Security impact appears neutral-to-improving based on moving to a newer toolchain; no evidence of newly introduced attack surface in repository usage.
Labels Applied
oblt-aw/ai/merge-ready(applied): low-to-moderate risk, no repo-usage breaking changes found, and PR-testable CI coverage exists for the primary Go setup workflow.
What is this? | From workflow: Observability Agentic Workflow — Pull Request
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
TL;DRBoth failed jobs are the same configuration/toolchain mismatch: FIPS packaging inherits Remediation
Investigation detailsRoot Cause
Evidence
Verification
Follow-up
What is this? | From workflow: Observability Agentic Workflow — Status Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
The FIPS package jobs failed with: go: GOEXPERIMENT=systemcrypto has been removed; system crypto is enabled automatically on supported platforms and can be disabled with MS_GO_NOSYSTEMCRYPTO=1 microsoft/go 1.27 enables system crypto by default and rejects the experiment. Stop setting it in the magefile and in the fips140=on unit test step. Binaries built this way record microsoft_systemcrypto=1 instead of GOEXPERIMENT=systemcrypto, so checkFIPSBinary now checks for that setting. The binary still links OpenSSL and has DefaultGODEBUG=fips140=on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🔵 Needs a closer look
The FIPS migration relies on Microsoft Go 1.27 enabling system crypto and emitting microsoft_systemcrypto=1, but release artifacts and provider-backed startup remain unverified with the actual toolchain and crossbuild images.
No open issues 🎉
Review effort: Balanced
Dependency Update AnalysisSummary: This PR updates the Go toolchain from Go toolchain 1.26.11 → 1.27.4Ecosystem: Go
Changelog highlights (1.26.11 → 1.27.4)
Usage in this repository
Compatibility assessment
Labels Applied
What is this? | From workflow: Observability Agentic Workflow — Pull Request Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
golangci-lint (goconst) flags the test literals repeated in Test_ErrorResp now that the Go 1.27 vet fix touches this file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🔵 Needs a closer look
The FIPS changes depend on Microsoft Go 1.27.4’s system-crypto defaults and new build-info marker, requiring provider-backed tests and packaged-binary validation on amd64 and arm64 that cannot be performed in this source-only environment.
No open issues 🎉
Review effort: Balanced
Dependency Update AnalysisSummary: This PR updates the Go toolchain from 1.26.11 → 1.27.4 (repo-wide Go toolchain: 1.26.11 → 1.27.4Ecosystem: Go
Changelog highlights (1.26.11 → 1.27.4)Upstream release-note bodies were unavailable via GitHub Releases for From local PR metadata/diff, the practical upgrade highlights are:
No CVE/GHSA claims are made here because upstream advisory/change-note bodies were not available from the release endpoints. Usage in this repositoryPrimary usage is toolchain-level (not a single imported module):
Compatibility assessment
Overall assessment: low-to-moderate risk, acceptable for merge with normal CI signal checks. Labels Applied
What is this? | From workflow: Observability Agentic Workflow — Pull Request Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |

What is the problem this PR solves?
Fleet Server is on Go 1.26.10. Go 1.27 is the current release, and Go 1.26 loses upstream security support when Go 1.28 ships. The automated
bump-golangworkflow only moves between patch versions of the current minor, so the move to 1.27 has to be done manually.How does this PR solve the problem?
Bumps
.go-versionand thegodirective ingo.mod,dev-tools/go.modandtesting/go.modto1.27.4.pkg/api/go.modstays at1.25.0because it is a library.Fixes the one new
go vetfinding from Go 1.27, whichgo testalso runs: wrapping&es.ErrElastic{}with%wis now flagged because only the value type has theErrormethod.Test_ErrorRespnow passes the pointer as anerrorvalue, so it still covers the*es.ErrElasticpath that production code uses.Includes the output of
mage check:fix(go fixwith the Go 1.27 modernizers), whichcheck:cienforces:errors.As→errors.AsType,atomic.AddUint64on plain fields →atomic.Uint64,strings.SplitN(...)[0]→strings.Cut, and promoted-field composite literals. These are mechanical and don't change behaviour.Works around an upstream Go 1.27 incompatibility in the
TestOpAMPWithUpstreamCollectore2e test. That test buildsopentelemetry-collector-contribfrommainwith this repository's Go version. With Go 1.27 the binary panics on startup (crypto: RegisterHash of unknown hash function). The cause isasapauthextension's dependencygithub.com/SermoDigital/jose, which registerscrypto.Hash(0)(Compiling using go 1.27 results in a binary that panics on startup open-telemetry/opentelemetry-collector-contrib#51868). The test only needs the OpAMP extension, so it now dropsasapauthextensionfrom the builder config before building. The workaround can go once upstream fixes the issue.No other changes were needed:
GO_VERSIONfrom.go-version, andgolang:1.27.4-trixieandgolang-crossbuild:1.27.4-{main,base-arm}-debian11are already published.bump-golangupdatecli job reads the minor version from.go-version, so it will follow 1.27.x from here.Lint fixes (separate commit): the lint job runs with
--whole-files, so thego fixrewrites surfaced 54 pre-existing findings (52goconst, 2gosec) in the touched files. The last commit fixes them without changing behaviour:file.Field*, thet*integration-test constants,kElasticsearch) where they exist.TestChunkMarksFinalare renamed to say what the test checks.nolintdirectives that explain why.golangci-lintv2.15.0, run the same way as CI, now reports 0 issues.Unrelated, noticed while doing this:
uploader.ErrInvalidUploadIDresponds with the error nameErrAPIKeyNotFound, which looks like a copy-paste mistake. I left the value unchanged because changing it would change the API response.Backports: labelled
backport-active-all, like the 1.26 bump (#6800). The automatic backports will probably conflict in thego fixfiles, because those have drifted on the release branches. Every branch needs the version files, the changelog fragment and theerror_test.govet fix. 9.5 and 9.6 rungo fixin CI, so their backports should re-runmage check:fixon the branch. 8.19 and 9.4 don't, so they can drop thego fixchanges. The lint-fix commit is optional on every branch.How to test this PR locally
Locally:
mage test:unitpasses with the race detector.go vetreports nothing new under any build tag, in either module.generate,check:imports,check:fix,check:headersandcheck:noticeproduces no diff.Design Checklist
Not applicable: this is a toolchain bump with no runtime design change.
Checklist
./changelog/fragmentsusing the changelog toolRelated issues
🤖 Generated with Claude Code
This is an automatic backport of pull request #8247 done by [Mergify](https://mergify.com).