Skip to content

chore: lower minimum Go to 1.26.0, test on stable/oldstable, drop vendor/ - #225

Merged
obalunenko merged 3 commits into
masterfrom
chore/go-min-version
Nov 15, 2026
Merged

obalunenko merged 3 commits into
masterfrom
chore/go-min-version

Conversation

@obalunenko

@obalunenko obalunenko commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Description

Minimum Go version. In a library the go directive is the minimum Go version for every user: go get raises their go.mod to it. With go 1.27.4, every consumer had to upgrade, while the code needs far less. go.mod now says go 1.26.0, the older of the two supported Go releases.

CI on stable / oldstable (setup-go aliases):

  • Tests run on a [stable, oldstable] matrix. GOTOOLCHAIN=local keeps oldstable from switching to a newer toolchain, so the job fails if go.mod requires more than oldstable. Tests run with go test -race ./..., because make test builds gotestsum from tools/, whose go.mod needs a newer Go than oldstable.
  • Build, lint, reports, release and CodeQL run on stable, without single-value matrices.
  • The actions/cache steps are removed. setup-go already caches modules and build outputs by default, so caching was done twice, and both matrix jobs would have raced for the same actions/cache key. The reports job adds tools/*/go.sum to the setup-go cache key, because it builds the coverage tools.
  • Workflows run on PRs into any branch. branches: ['*'] did not match names with a slash, so stacked PRs like feat: default to "," separator and RFC3339 time layout #224 got no CI.
  • The .gohtml and .proto path filters are removed; the repo has no such files.
  • scripts/bump-go.sh bumps only the development toolchain (tool modules, docs). It no longer rewrites CI versions and leaves the root go.mod alone.

vendor/. Users never build a library's vendor/ (868K, testify only), so it only added noise to dependabot PRs. It is removed and ignored. The sync-vendor make target is replaced by tidy (go mod tidy + go mod verify).

make vet. vet() in scripts/linting/linters-source.sh treated any stderr output as a finding, and its EXIT_CODE came from declare, so it was always 0. With vendor/ gone, the first run prints go: downloading ... to stderr, which failed the lint and CodeQL jobs. It now fails on the exit code of go vet.

Template leftovers:

  • .goreleaser.yml: the gomod section (mod: vendor, GOPRIVATE=example.com/blah). Builds are skipped, so it was unused.
  • .golangci.yml: depguard with the logrus/logger rule, and bodyclose, rowserrcheck, noctx (there is no HTTP or SQL here).
  • .golangci.pipe.yml: exclusions for internal/input/ and internal/puzzles/constants.go from another project.

Testing

  • go vet ./... and go test -race ./... pass with go1.26.0 and GOTOOLCHAIN=local. refactor: replace parser hierarchy with a single generic Parse #223 and feat: default to "," separator and RFC3339 time layout #224 use nothing newer than Go 1.24 (b.Loop, reflect.TypeFor).
  • make vet passes with an empty module cache and fails on a deliberate Printf mistake.
  • Ran bump-go.sh 1.27.5 on a copy of the repo: the tool modules got 1.27.5, the root go.mod stayed at 1.26.0, and the workflows were not touched.
  • goreleaser check passes. golangci-lint config verify passes for both configs, and both report 0 issues.
  • All workflow files parse as YAML. actionlint was not run locally; CI on this PR checks the workflows.

Possible failures/side-effects

  • Floating versions. CI no longer pins a Go version: a new Go release changes what stable and oldstable mean without a commit.
  • Minimum can drift. After Go 1.28 is released, oldstable becomes 1.27, and go 1.26.0 is no longer tested. Raise the minimum in go.mod then.
  • Job names changed: Run Tests (Go stable), Run Tests (Go oldstable), Build, Run linters, Quality reports, Analyze (go). No status checks are required in the master ruleset, so nothing blocks merges.
  • Cache-busting knob removed: secrets.CACHE_VERSION was only used by the removed actions/cache steps.
  • make sync-vendor no longer exists; use make tidy.
  • I did not touch sonar.projectVersion=1.0. SonarCloud can use the project version to define the new-code period, and I can't see this project's setting from here.

🤖 Generated with Claude Code

The go directive of a library is the minimum Go version for its users:
go 1.27.4 made every consumer upgrade, while the code needs far less.
Set it to 1.26.0, the older of the two supported Go releases, and add
a CI job that runs the tests with exactly that version (setup-go reads
it from go.mod; GOTOOLCHAIN=local forbids switching to a newer one).
bump-go.sh now bumps only the development toolchain and leaves the
root go.mod alone.

Users never build a library's vendor/, so it only added noise to the
dependency PRs: remove it, ignore it, and replace sync-vendor with a
tidy target.

Drop template leftovers: the unused goreleaser gomod section (builds
are skipped), lint rules for a logger, HTTP and SQL this library does
not use, and exclusions for paths of another project.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vet() treated any stderr output as a finding, and its EXIT_CODE was the
exit code of `declare`, so always 0. Without vendor/ the first run
prints "go: downloading ..." to stderr, which failed `make vet` in the
lint and CodeQL jobs. Fail on the exit code of go vet instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.48%. Comparing base (3a18358) to head (3b90dce).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #225   +/-   ##
=======================================
  Coverage   88.48%   88.48%           
=======================================
  Files           5        5           
  Lines         382      382           
=======================================
  Hits          338      338           
  Misses         44       44           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Use the setup-go aliases instead of a pinned version:

- Tests run on a [stable, oldstable] matrix, the two supported Go
  releases. GOTOOLCHAIN=local keeps oldstable from switching to a newer
  toolchain, so the job fails if go.mod requires more than oldstable.
  This replaces the separate minimum-Go job. Tests run with go test:
  make test builds gotestsum from tools/, which needs a newer Go than
  oldstable.
- Build, lint, reports, release and CodeQL run on stable, without
  single-value matrices.
- Drop the actions/cache steps: setup-go already caches modules and
  build outputs by default, and both matrix jobs would have raced for
  the same actions/cache key. The reports job adds tools/*/go.sum to
  the setup-go cache key because it builds the coverage tools.
- Run on pull requests into any branch: '*' did not match branch names
  with a slash, so stacked PRs got no CI.
- Drop the .gohtml and .proto path filters; the repo has no such files.
- bump-go.sh no longer rewrites CI versions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@obalunenko obalunenko changed the title chore: lower minimum Go to 1.26.0 and stop committing vendor/ chore: lower minimum Go to 1.26.0, test on stable/oldstable, drop vendor/ Nov 15, 2026
@sonarqubecloud

Copy link
Copy Markdown

@obalunenko
obalunenko merged commit 4ef5865 into master Nov 15, 2026
11 checks passed
@obalunenko
obalunenko deleted the chore/go-min-version branch November 15, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant