unlock unlimited code runs for $79, limited time →
NOSSLETTER.techLIVE
back to OSSpedia
etcd-io/etcd
junior1/10
dependency-management

[release-3.7] Bump go 1.26.7

Project: etcd-io/etcd | Language: Go | Concepts: dependency-management | Difficulty: junior
Link: https://github.com/etcd-io/etcd/pull/22311

The problem

The project was using Go version 1.26.6, but a newer patch version 1.26.7 was released. The project needed to update its Go toolchain version to benefit from any bug fixes or improvements in the patch release.

Why it's non-trivial

A naive fix might update only a single go.mod file or the .go-version file, but this project has multiple modules and workspaces, each with their own go.mod files specifying the Go toolchain version. Missing any of these would cause inconsistent builds or tooling issues.

The approach

The PR systematically updates the Go toolchain version from 1.26.6 to 1.26.7 across all relevant files in the repository:

diff --git a/.go-version b/.go-version
index f250c8f6045..ad7c780d048 100644
--- a/.go-version
+++ b/.go-version
@@ -1 +1 @@
-1.26.6
+1.26.7
  • Updates the .go-version file which is often used by tooling or CI to determine the Go version.
diff --git a/api/go.mod b/api/go.mod
index f657b0276fa..98ad89c0b6e 100644
--- a/api/go.mod
+++ b/api/go.mod
@@ -2,7 +2,7 @@ module go.etcd.io/etcd/api/v3
 
 go 1.26
 
-toolchain go1.26.6
+toolchain go1.26.7
  • Updates the toolchain directive in the go.mod file of the api module to specify Go 1.26.7.

This pattern repeats identically for all other modules and subdirectories with their own go.mod files, including:

  • cache/go.mod
  • client/pkg/go.mod
  • client/v3/go.mod
  • etcdctl/go.mod
  • etcdutl/go.mod
  • go.mod (root)
  • go.work
  • pkg/go.mod
  • server/go.mod
  • tests/go.mod
  • tools/mod/go.mod
  • tools/rw-heatmaps/go.mod
  • tools/testgrid-analysis/go.mod

Each file has the line:

-toolchain go1.26.6
+toolchain go1.26.7

replaced consistently.

From the review thread

No notable review discussion on this PR.

Takeaways

  • When upgrading a dependency or toolchain version in a multi-module Go project, ensure all go.mod files and workspace files (go.work) are updated consistently to avoid version mismatches.
  • Patch version upgrades (e.g., 1.26.6 to 1.26.7) should be propagated throughout all project components to maintain uniformity in builds and tooling.
  • Use automated tools or scripts to assist with repetitive version bumps across multiple files to reduce human error.