Skip to content

chore: bump minimum Go version to 1.25 - #472

Merged
NickJosevski merged 2 commits into
mainfrom
chore/bump-go-1.25
Aug 27, 2026
Merged

chore: bump minimum Go version to 1.25#472
NickJosevski merged 2 commits into
mainfrom
chore/bump-go-1.25

Conversation

@NickJosevski

Copy link
Copy Markdown
Contributor

Why

The go directive has been pinned at 1.23.12 while every current consumer is already well ahead of it:

Consumer go.mod
cli 1.26.6
octopus-argocd-gateway 1.26.0
terraform-provider-octopusdeploy 1.25.8

Because this is a public library, the go directive is the minimum version imposed on every consumer, so this stops short of the latest (1.27) deliberately — 1.25.0 clears the stale pin without forcing the Terraform provider to bump before it can take a new client release.

No dependency required this: the highest minimum across the module graph is go 1.23.0 (golang.org/x/text, net, crypto, sys).

The vet fallout

From language version 1.24 onward, vet's printf analyser reports non-constant format strings. That flags 43 jsonassert.Assertf call sites, which would fail the go vet -v ./... CI step:

non-constant format string in call to (*github.com/kinbiko/jsonassert.Asserter).Assertf

Each is fixed the same way:

-jsonassert.New(t).Assertf(expectedJSON, string(anonymousAsJSON))
+jsonassert.New(t).Assertf(expectedJSON, "%s", string(anonymousAsJSON))

This is behaviour-preserving. Assertf does fmt.Sprintf(expectedJSON, fmtArgs...) unconditionally, so with no args and no % in the string the result is identical — and strictly safer if serialised JSON ever contains a %. All 43 are in _test.go files; no production code is affected.

CI

Pinned to an explicit 1.27.x instead of >=1.19.0, which silently tracked whatever was newest — that's how a toolchain bump surprises you rather than being a deliberate change. Also bumps actions/setup-go v3 → v5.

Verification

  • go build -race ./... — clean
  • go vet ./... — clean under both go1.26.3 and go1.27.0 (the two toolchains flag slightly different subsets; the fix covers the union)
  • gofmt -l — clean
  • All 43 affected marshalling tests pass
  • go mod tidy produces no go.sum churn

Note: unit and integration tests aren't separated in this repo, so a full local go test ./... can't pass without a live Octopus instance. The integration suite needs a CI run to confirm.

🤖 Generated with Claude Code

NickJosevski and others added 2 commits August 27, 2026 16:05
The `go` directive was pinned at 1.23.12 while every current consumer of
this library is already on 1.25 or newer (terraform-provider 1.25.8, cli
1.26.6, argocd-gateway 1.26.0). Move the floor to 1.25.0 — new enough to
clear the stale pin, conservative enough that no consumer has to bump.

From language version 1.24 onward, vet's printf analyser reports
non-constant format strings, which flagged 43 `jsonassert.Assertf` call
sites across the test suite and would have failed the CI vet step. Each
now passes the serialised JSON as a `%s` argument rather than as the
format string itself. `Assertf` calls `fmt.Sprintf(expectedJSON, args...)`
unconditionally, so this is behaviour-preserving for `%`-free input and
strictly safer otherwise. No production code was affected.

Also pin the CI toolchain to 1.27.x instead of `>=1.19.0`, so a new Go
release is a deliberate change rather than a silent one, and bump
setup-go v3 -> v5.

Verified: `go build -race ./...` and `go vet ./...` clean under both
go1.26.3 and go1.27.0; all 43 affected marshalling tests pass.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
TestPackageServiceUploadDelta_UploadedDelta hardcoded the byte sizes of a
zip built from random content. archive/zip's per-entry overhead changed in
Go 1.27 (582 -> 346 bytes for this two-entry archive), so pinning CI to
1.27.x made the assertion fail with 1048922 != 1049158.

The comment above these lines already said the values were machine-specific
and "left for explanatory purposes only" — the sibling test
TestPackageServiceUploadDelta_NotEfficient has the equivalent assertions
commented out. This one kept them live, which looks like an oversight.

Assert what the test is actually about instead: only content2.txt is new
between the two uploads, so the delta should carry roughly half the full
file rather than all of it. Both observed toolchain outputs satisfy the
new bounds comfortably.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@NickJosevski
NickJosevski enabled auto-merge (rebase) August 27, 2026 07:11
@NickJosevski
NickJosevski merged commit 1860c3d into main Aug 27, 2026
5 checks passed
@NickJosevski
NickJosevski deleted the chore/bump-go-1.25 branch August 27, 2026 22:51
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.

2 participants