Skip to content

build: upgrade Go from 1.13 to 1.22 with full dependency modernization#2

Merged
phaus merged 5 commits intomasterfrom
go-1.22-upgrade
Apr 12, 2026
Merged

build: upgrade Go from 1.13 to 1.22 with full dependency modernization#2
phaus merged 5 commits intomasterfrom
go-1.22-upgrade

Conversation

@phaus
Copy link
Copy Markdown
Member

@phaus phaus commented Apr 12, 2026

Upgrade the entire codebase from Go 1.13 to Go 1.22.12 to restore buildability with modern Go toolchains. This is a single-jump upgrade that addresses all compatibility issues accumulated over 5 major Go releases.

Core changes:

  • Update go.mod directive from go 1.13 to go 1.22
  • Update CI (Dockerfile.ci, GitHub Actions) to Go 1.22.12 on Debian Bookworm
  • Remove GO111MODULE=on from all build scripts (ignored since Go 1.21)
  • Remove vestigial go-bindata dependency (zero usage in codebase)

Code migrations:

  • Migrate io/ioutil to io/os across 69 files (~177 call sites)
  • Migrate golang.org/x/net/context to stdlib context in 22 files
  • Update build tags from // +build to //go:build in 32 files
  • Fix string(int) to string(rune(int)) in pkg/rpcplus/jsonrpc tests
  • Fix HTTP timeout error message assertion for Go 1.20+ in discoverd/health
  • Fix Example function naming for Go 1.22 vet in pkg/stream

Vendor updates:

  • Update golang.org/x/sys to v0.28.0 (from 2019 version)
  • Update golang.org/x/net to v0.30.0 (from 2019 version)
  • Update golang.org/x/crypto to v0.28.0 (from 2019 version)
  • Re-vendor all dependencies with GOOS=linux for Linux-only imports

All 21 standalone test packages pass with -race -cover on Go 1.22.

phaus added 5 commits April 12, 2026 21:54
Upgrade the entire codebase from Go 1.13 to Go 1.22.12 to restore
buildability with modern Go toolchains. This is a single-jump upgrade
that addresses all compatibility issues accumulated over 5 major Go
releases.

Core changes:
- Update go.mod directive from go 1.13 to go 1.22
- Update CI (Dockerfile.ci, GitHub Actions) to Go 1.22.12 on Debian Bookworm
- Remove GO111MODULE=on from all build scripts (ignored since Go 1.21)
- Remove vestigial go-bindata dependency (zero usage in codebase)

Code migrations:
- Migrate io/ioutil to io/os across 69 files (~177 call sites)
- Migrate golang.org/x/net/context to stdlib context in 22 files
- Update build tags from // +build to //go:build in 32 files
- Fix string(int) to string(rune(int)) in pkg/rpcplus/jsonrpc tests
- Fix HTTP timeout error message assertion for Go 1.20+ in discoverd/health
- Fix Example function naming for Go 1.22 vet in pkg/stream

Vendor updates:
- Update golang.org/x/sys to v0.28.0 (from 2019 version)
- Update golang.org/x/net to v0.30.0 (from 2019 version)
- Update golang.org/x/crypto to v0.28.0 (from 2019 version)
- Re-vendor all dependencies with GOOS=linux for Linux-only imports

All 21 standalone test packages pass with -race -cover on Go 1.22.
Go 1.18+ automatically tries to embed VCS status into binaries,
which fails in CI containers where git safe.directory is not
configured for the checkout path. Since we already embed version
info via -ldflags, the automatic VCS stamping is redundant.
When StartJob retries after an AddJob failure, the scheduler would
randomly re-select the same failing host via ShuffledHosts(), causing
flaky test failures (TestFailingAddJob) and suboptimal retry behavior
in production.

Track failed host IDs in an exclusion set and pass it through
PlacementRequest so HandlePlacementRequest prefers non-excluded hosts.
Falls back to excluded hosts if no alternatives are available.
# Conflicts:
#	PRIVACY.md
#	controller/examples/.gitignore
#	vendor/github.com/flynn/go-tuf/go.mod
#	vendor/github.com/flynn/go-tuf/go.sum
#	vendor/github.com/go-bindata/go-bindata/.gitignore
#	vendor/github.com/go-bindata/go-bindata/CONTRIBUTING.md
#	vendor/github.com/go-bindata/go-bindata/LICENSE
#	vendor/github.com/go-bindata/go-bindata/Makefile
#	vendor/github.com/go-bindata/go-bindata/README.md
#	vendor/github.com/go-bindata/go-bindata/_config.yml
#	vendor/github.com/go-bindata/go-bindata/asset.go
#	vendor/github.com/go-bindata/go-bindata/bytewriter.go
#	vendor/github.com/go-bindata/go-bindata/config.go
#	vendor/github.com/go-bindata/go-bindata/convert.go
#	vendor/github.com/go-bindata/go-bindata/debug.go
#	vendor/github.com/go-bindata/go-bindata/doc.go
#	vendor/github.com/go-bindata/go-bindata/file.go
#	vendor/github.com/go-bindata/go-bindata/release.go
#	vendor/github.com/go-bindata/go-bindata/restore.go
#	vendor/github.com/go-bindata/go-bindata/stringwriter.go
#	vendor/github.com/go-bindata/go-bindata/toc.go
#	vendor/github.com/godbus/dbus/go.mod
#	vendor/github.com/googleapis/gax-go/v2/go.mod
#	vendor/github.com/googleapis/gax-go/v2/go.sum
#	vendor/github.com/gorilla/context/.travis.yml
#	vendor/github.com/gorilla/context/LICENSE
#	vendor/github.com/gorilla/context/README.md
#	vendor/github.com/gorilla/context/context.go
#	vendor/github.com/gorilla/context/doc.go
#	vendor/github.com/gorilla/securecookie/.travis.yml
#	vendor/github.com/gorilla/securecookie/LICENSE
#	vendor/github.com/gorilla/securecookie/README.md
#	vendor/github.com/gorilla/securecookie/doc.go
#	vendor/github.com/gorilla/securecookie/securecookie.go
#	vendor/github.com/gorilla/sessions/.travis.yml
#	vendor/github.com/gorilla/sessions/LICENSE
#	vendor/github.com/gorilla/sessions/README.md
#	vendor/github.com/gorilla/sessions/doc.go
#	vendor/github.com/gorilla/sessions/sessions.go
#	vendor/github.com/gorilla/sessions/store.go
#	vendor/github.com/gorilla/websocket/go.mod
#	vendor/github.com/gorilla/websocket/go.sum
#	vendor/github.com/grpc-ecosystem/go-grpc-middleware/go.mod
#	vendor/github.com/grpc-ecosystem/go-grpc-middleware/go.sum
#	vendor/github.com/jvatic/asset-matrix-go/.gitignore
#	vendor/github.com/jvatic/asset-matrix-go/LICENSE
#	vendor/github.com/jvatic/asset-matrix-go/README.md
#	vendor/github.com/jvatic/asset-matrix-go/asset-root.go
#	vendor/github.com/jvatic/asset-matrix-go/asset.go
#	vendor/github.com/jvatic/asset-matrix-go/cache.go
#	vendor/github.com/jvatic/asset-matrix-go/erb-asset.go
#	vendor/github.com/jvatic/asset-matrix-go/erb-rb.go
#	vendor/github.com/jvatic/asset-matrix-go/eslint_asset.go
#	vendor/github.com/jvatic/asset-matrix-go/generic-asset.go
#	vendor/github.com/jvatic/asset-matrix-go/javascript-asset.go
#	vendor/github.com/jvatic/asset-matrix-go/jsx-asset.go
#	vendor/github.com/jvatic/asset-matrix-go/matrix.go
#	vendor/github.com/jvatic/asset-matrix-go/scss-asset.go
#	vendor/github.com/jvatic/asset-matrix-go/scss-js.go
#	vendor/github.com/jvatic/asset-matrix-go/transformer-js.go
#	vendor/github.com/kavu/go_reuseport/go.mod
#	vendor/github.com/konsorten/go-windows-terminal-sequences/go.mod
#	vendor/github.com/kr/pty/go.mod
#	vendor/github.com/kr/pty/go.sum
#	vendor/github.com/rs/cors/go.mod
#	vendor/github.com/sirupsen/logrus/go.mod
#	vendor/github.com/sirupsen/logrus/go.sum
#	vendor/go.opencensus.io/go.mod
#	vendor/go.opencensus.io/go.sum
#	vendor/golang.org/x/crypto/AUTHORS
#	vendor/golang.org/x/crypto/CONTRIBUTORS
#	vendor/golang.org/x/crypto/curve25519/const_amd64.h
#	vendor/golang.org/x/crypto/curve25519/const_amd64.s
#	vendor/golang.org/x/crypto/curve25519/cswap_amd64.s
#	vendor/golang.org/x/crypto/curve25519/doc.go
#	vendor/golang.org/x/crypto/curve25519/freeze_amd64.s
#	vendor/golang.org/x/crypto/curve25519/ladderstep_amd64.s
#	vendor/golang.org/x/crypto/curve25519/mont25519_amd64.go
#	vendor/golang.org/x/crypto/curve25519/mul_amd64.s
#	vendor/golang.org/x/crypto/curve25519/square_amd64.s
#	vendor/golang.org/x/crypto/ed25519/ed25519_go113.go
#	vendor/golang.org/x/crypto/ed25519/internal/edwards25519/const.go
#	vendor/golang.org/x/crypto/ed25519/internal/edwards25519/edwards25519.go
#	vendor/golang.org/x/crypto/internal/chacha20/asm_ppc64le.s
#	vendor/golang.org/x/crypto/internal/chacha20/chacha_arm64.go
#	vendor/golang.org/x/crypto/internal/chacha20/chacha_generic.go
#	vendor/golang.org/x/crypto/internal/chacha20/chacha_ppc64le.go
#	vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.go
#	vendor/golang.org/x/crypto/poly1305/sum_amd64.go
#	vendor/golang.org/x/crypto/poly1305/sum_amd64.s
#	vendor/golang.org/x/crypto/poly1305/sum_arm.go
#	vendor/golang.org/x/crypto/poly1305/sum_arm.s
#	vendor/golang.org/x/crypto/poly1305/sum_generic.go
#	vendor/golang.org/x/crypto/poly1305/sum_noasm.go
#	vendor/golang.org/x/crypto/poly1305/sum_ppc64le.go
#	vendor/golang.org/x/crypto/poly1305/sum_s390x.go
#	vendor/golang.org/x/crypto/poly1305/sum_s390x.s
#	vendor/golang.org/x/crypto/poly1305/sum_vmsl_s390x.s
#	vendor/golang.org/x/net/AUTHORS
#	vendor/golang.org/x/net/CONTRIBUTORS
#	vendor/golang.org/x/net/http2/Dockerfile
#	vendor/golang.org/x/net/http2/Makefile
#	vendor/golang.org/x/net/http2/README
#	vendor/golang.org/x/net/http2/go111.go
#	vendor/golang.org/x/net/http2/not_go111.go
#	vendor/golang.org/x/net/internal/socket/sys_bsdvar.go
#	vendor/golang.org/x/net/internal/socket/sys_dragonfly.go
#	vendor/golang.org/x/net/internal/socket/sys_go1_11_darwin.go
#	vendor/golang.org/x/net/internal/socket/sys_linkname.go
#	vendor/golang.org/x/net/internal/socket/sys_solaris.go
#	vendor/golang.org/x/net/internal/socket/sys_solaris_amd64.s
#	vendor/golang.org/x/net/internal/socket/zsys_darwin_386.go
#	vendor/golang.org/x/net/internal/socket/zsys_darwin_arm.go
#	vendor/golang.org/x/oauth2/go.mod
#	vendor/golang.org/x/oauth2/go.sum
#	vendor/golang.org/x/sys/AUTHORS
#	vendor/golang.org/x/sys/CONTRIBUTORS
#	vendor/golang.org/x/sys/unix/asm_darwin_386.s
#	vendor/golang.org/x/sys/unix/asm_darwin_arm64.s
#	vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s
#	vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s
#	vendor/golang.org/x/sys/unix/asm_freebsd_arm.s
#	vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s
#	vendor/golang.org/x/sys/unix/asm_netbsd_386.s
#	vendor/golang.org/x/sys/unix/asm_netbsd_arm.s
#	vendor/golang.org/x/sys/unix/asm_netbsd_arm64.s
#	vendor/golang.org/x/sys/unix/asm_openbsd_386.s
#	vendor/golang.org/x/sys/unix/asm_openbsd_arm.s
#	vendor/golang.org/x/sys/unix/errors_freebsd_386.go
#	vendor/golang.org/x/sys/unix/errors_freebsd_amd64.go
#	vendor/golang.org/x/sys/unix/errors_freebsd_arm.go
#	vendor/golang.org/x/sys/unix/ioctl.go
#	vendor/golang.org/x/sys/unix/str.go
#	vendor/golang.org/x/sys/unix/syscall_darwin_386.go
#	vendor/golang.org/x/sys/unix/syscall_darwin_arm.go
#	vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_11.go
#	vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go
#	vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s
#	vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_11.go
#	vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_11.go
#	vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go
#	vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.s
#	vendor/golang.org/x/sys/unix/zsysnum_darwin_386.go
#	vendor/golang.org/x/sys/unix/zsysnum_darwin_arm.go
#	vendor/golang.org/x/sys/unix/ztypes_darwin_386.go
#	vendor/golang.org/x/sys/unix/ztypes_darwin_arm.go
#	vendor/golang.org/x/sys/windows/asm_windows_386.s
#	vendor/golang.org/x/sys/windows/asm_windows_amd64.s
#	vendor/golang.org/x/sys/windows/asm_windows_arm.s
#	vendor/golang.org/x/text/AUTHORS
#	vendor/golang.org/x/text/CONTRIBUTORS
#	vendor/google.golang.org/appengine/go.mod
#	vendor/google.golang.org/appengine/go.sum
#	vendor/google.golang.org/grpc/go.mod
#	vendor/google.golang.org/grpc/go.sum
#	vendor/gopkg.in/yaml.v2/go.mod
@phaus phaus merged commit 8c3ff2d into master Apr 12, 2026
4 checks passed
@phaus phaus deleted the go-1.22-upgrade branch April 16, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant