Skip to content

chore: upgrade to Go 1.27.0 and apply 1.27 modernizations - #4036

Open
aheritier wants to merge 3 commits into
mainfrom
feat/go-1.27-upgrade
Open

chore: upgrade to Go 1.27.0 and apply 1.27 modernizations#4036
aheritier wants to merge 3 commits into
mainfrom
feat/go-1.27-upgrade

Conversation

@aheritier

Copy link
Copy Markdown
Collaborator

🤖 Automated implementer agentthis comment was posted by the implementer bot from Docker Agentic Platform, not by a human developer

Upgrades the project from Go 1.26.5 to Go 1.27.0 and applies modernizations enabled by the new toolchain.

Changes:

  • go.mod + Dockerfile: bump Go version to 1.27.0; run go mod tidy
  • .github/workflows/ci.yml: bump golangci-lint v2.12.2v2.13.1 (v2.12.2's staticcheck v0.7.0 panics on Go 1.27 AST nodes)
  • e2e/binary/binary_test.go: remove obsolete // +build line (redundant since Go 1.17)
  • cmd/wasm/runtime_wasm.go: replace manual reverse countdown loop with slices.Backward
  • 6 sites across installer.go, dmr/available.go, dmr/pull.go, config/auto.go, modelinfo.go (×2): replace strings.LastIndex + slice with strings.CutLast (new in Go 1.27)

Note: golangci-lint v2.13.1 surfaces pre-existing errorsastype/embedlit/gofumpt findings in unrelated files (they also appear on main with v2.13.1). Those are out of scope for this PR.

@aheritier
aheritier marked this pull request as ready for review August 22, 2026 16:31
@aheritier
aheritier requested a review from a team as a code owner August 22, 2026 16:31
@actions-allow-list-sync-readonly

Copy link
Copy Markdown

Allowlist update needed for github/codeql-action/autobuild@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28. Tracking PR: https://github.com/docker/infra-github-allow-list/pull/196

Please wait for the allowlist PR to merge before merging this PR, otherwise CI will fail because the new SHA isn't allowlisted yet.

@actions-allow-list-sync-readonly

Copy link
Copy Markdown

Allowlist update needed for github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28. Tracking PR: https://github.com/docker/infra-github-allow-list/pull/195

Please wait for the allowlist PR to merge before merging this PR, otherwise CI will fail because the new SHA isn't allowlisted yet.

@actions-allow-list-sync-readonly

Copy link
Copy Markdown

Allowlist update needed for github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28. Tracking PR: https://github.com/docker/infra-github-allow-list/pull/197

Please wait for the allowlist PR to merge before merging this PR, otherwise CI will fail because the new SHA isn't allowlisted yet.

@aheritier aheritier added area/agent For work that has to do with the general agent loop/agentic features of the app area/ci CI/CD workflows and pipeline area/cli CLI commands, flags, output formatting area/config For configuration parsing, YAML, environment variables area/deps Dependency updates and version bumps area/providers/docker-model-runner Docker Model Runner (DMR) local inference area/rag For work/issues that have to do with the RAG features area/runtime Runtime engine, agent loop execution, tool dispatch, loop detection area/sessions For features/issues/fixes related to session lifecycle (resume, persistence, export) area/tools For features/issues/fixes related to the usage of built-in and MCP tools area/tui For features/issues/fixes related to the TUI kind/chore Maintenance, deps, CI, tooling (maps to chore: commit prefix) labels Aug 22, 2026
@aheritier
aheritier marked this pull request as draft August 22, 2026 20:30
@aheritier aheritier added the status/needs-rebase PR has merge conflicts or is out of date with main label Aug 23, 2026
@aheritier

Copy link
Copy Markdown
Collaborator Author

👋 This PR has merge conflicts with the base branch. Please rebase or merge the latest base branch and resolve them. I've moved it to draft and added status/needs-rebase; it'll be picked back up automatically once the conflicts are cleared.

1 similar comment
@aheritier

Copy link
Copy Markdown
Collaborator Author

👋 This PR has merge conflicts with the base branch. Please rebase or merge the latest base branch and resolve them. I've moved it to draft and added status/needs-rebase; it'll be picked back up automatically once the conflicts are cleared.

- Bump go.mod and Dockerfile from go 1.26.5 to go 1.27.0
- Run go mod tidy to update checksums
- Remove obsolete // +build build tag from e2e/binary/binary_test.go
- Use slices.Backward in cmd/wasm/runtime_wasm.go reverse loop
- Use strings.CutLast (new in Go 1.27) at 6 sites:
  pkg/toolinstall/installer.go, pkg/model/provider/dmr/available.go,
  pkg/model/provider/dmr/pull.go, pkg/config/auto.go,
  pkg/modelinfo/modelinfo.go (×2)
- Bump golangci-lint from v2.12.2 to v2.13.1 (v2.12.2 panics on
  Go 1.27 AST via staticcheck v0.7.0)
The GitHub Default Setup uses Go 1.26.6 on the runner with
GOTOOLCHAIN=local, which fails to build a project requiring go >= 1.27.0.
Replace Default Setup with an explicit workflow that runs setup-go
(go-version-file: go.mod) before CodeQL init, so the tracer wraps
the correct Go 1.27.0 binary.
…inter bump

- Run golangci-lint fmt to apply gofumpt v0.11.0 formatting (v0.9.2→v0.11.0
  bundled in golangci-lint) across 30 files: purely mechanical whitespace
  and grouping changes, no logic changes.
- Remove 3 stale //nolint:recvcheck directives from pkg/config/latest/types.go
  (recvcheck in golangci-lint v2.13.1 no longer flags MarshalYAML/JSON patterns,
  making those suppression comments unused).
- Disable newly-activated modernize sub-checks in .golangci.yml:
  errorsastype, embedlit, stringscut, reflecttypeassert — all require Go 1.27
  APIs or x/tools ≥ v0.48; pre-existing violations in unrelated files.
  A follow-up PR should re-enable these and clean up the violations.
- Add .golangci.yml exclusions for pkg/config/v*/ (recvcheck + nolintlint):
  frozen versioned config types that cannot be modified; recvcheck changed
  behaviour between v2.12.2 and v2.13.1 leaving stale nolint directives.
@aheritier
aheritier force-pushed the feat/go-1.27-upgrade branch from c677db0 to 1ec5fec Compare August 23, 2026 09:38
@aheritier
aheritier marked this pull request as ready for review August 23, 2026 09:51
@aheritier aheritier removed the status/needs-rebase PR has merge conflicts or is out of date with main label Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/agent For work that has to do with the general agent loop/agentic features of the app area/ci CI/CD workflows and pipeline area/cli CLI commands, flags, output formatting area/config For configuration parsing, YAML, environment variables area/deps Dependency updates and version bumps area/providers/docker-model-runner Docker Model Runner (DMR) local inference area/rag For work/issues that have to do with the RAG features area/runtime Runtime engine, agent loop execution, tool dispatch, loop detection area/sessions For features/issues/fixes related to session lifecycle (resume, persistence, export) area/tools For features/issues/fixes related to the usage of built-in and MCP tools area/tui For features/issues/fixes related to the TUI kind/chore Maintenance, deps, CI, tooling (maps to chore: commit prefix)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant