Skip to content

Upgrade to go 1.26#601

Merged
irees merged 3 commits intomainfrom
go-1.26
Apr 23, 2026
Merged

Upgrade to go 1.26#601
irees merged 3 commits intomainfrom
go-1.26

Conversation

@irees
Copy link
Copy Markdown
Contributor

@irees irees commented Apr 23, 2026

Summary

Upgrades the Go toolchain from 1.24.2 to 1.26.0, bumps the CI PostGIS image from EOL PG 12 to PG 16 to match production, removes a stale Dockerfile, and carves out an explicit exception for the library's sqlite3://:memory: DSN which Go 1.26's stricter net/url.Parse now rejects.

Go toolchain bump

  • go.mod directive bumped to go 1.26.0
  • .github/workflows/test.yml, .github/workflows/check-go-generate.yaml, and all three build matrices in .github/workflows/release.yml (linux, macos-intel, macos-apple) set to go-version: '1.26.0'
  • .claude/CLAUDE.md project-overview line updated to reflect Go 1.26

CI PostgreSQL image bump

  • .github/workflows/test.yml test service image bumped from postgis/postgis:12-3.4-alpine to postgis/postgis:16-3.4-alpine. PostgreSQL 12 reached EOL in Nov 2024; PG 16 more closely matches production. The library uses no PG 13+ exclusive SQL (no MERGE, JSON_TABLE, ANY_VALUE, etc.), so the CI-only behavior change should be minimal. PostGIS pinned at 3.4 to keep scope tight.

Dockerfile cleanup

  • Removed the top-level Dockerfile, which had been untouched since 2020 and was pinned to Ubuntu 18.04 (EOL) and golang-1.12 via a third-party PPA. It was not referenced anywhere in CI.

net/url regression in Go 1.26

Go 1.26 tightened net/url.Parse and now rejects sqlite3://:memory: because :memory: after // parses as host:port with a non-numeric port. This broke TestManager_* tests in internal/feedstate/ and any library consumer using the same in-memory DSN form.

Fix: keep url.Parse as the primary mechanism (preserving fragment handling, scheme case-normalization, and structural validation) and add an explicit string-equality carve-out for the one known incompatible form, shared as tldb.sqliteMemoryDBURL:

  • tldb/adapter.gonewAdapter short-circuits the sqlite memory DSN and returns the registered sqlite3 adapter directly; all other dburls go through url.Parse unchanged
  • tldb/common.gogetFvids returns an empty fvid list for the sqlite memory DSN and otherwise parses as before; errors from url.Parse continue to propagate

Existing tests in internal/feedstate/manager_test.go and tldb/sqlite/sqlite_test.go exercise this DSN end-to-end, so no new tests were added. The getFvids URL-smuggling behavior is preserved in case external consumers of transitland-lib rely on it.

Workflow hygiene

  • .github/workflows/check-go-generate.yaml — bumped actions/github-script@v6 to @v7 for consistency with release.yml

Test plan

  • Confirm go version reports 1.26.x locally before building
  • go mod tidy produces no diff
  • go vet ./... is clean
  • (cd cmd/transitland && go build .) succeeds
  • go test ./internal/feedstate/... ./tldb/... passes (previously failing on 1.26)
  • Full test suite passes in CI against PG 16 / PostGIS 3.4
  • Verify CI jobs run on 1.26.0: Test Suite, Check Generated Code, and on a tagged release the linux / macos-intel / macos-apple build jobs

@irees irees marked this pull request as ready for review April 23, 2026 05:28
Copilot AI review requested due to automatic review settings April 23, 2026 05:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Upgrades this repo’s Go toolchain and CI environment, and adjusts TLDB DSN parsing to avoid a Go 1.26 net/url.Parse behavior change that rejects sqlite3://:memory:.

Changes:

  • Bump Go version references to 1.26.0 (go.mod + CI workflows + project docs).
  • Update CI PostGIS service image from PG12 to PG16.
  • Replace url.Parse usage in TLDB DSN handling with string-splitting to preserve support for sqlite3://:memory:; remove stale top-level Dockerfile.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tldb/common.go Reworks getFvids to parse query params without url.Parse to avoid Go 1.26 DSN rejection.
tldb/adapter.go Reworks adapter selection to derive scheme without url.Parse.
go.mod Updates Go version directive to 1.26.0.
Dockerfile Removes an obsolete, EOL-pinned Dockerfile.
.github/workflows/test.yml Updates Go version and PostGIS service image for CI.
.github/workflows/release.yml Updates Go version in release build matrices.
.github/workflows/check-go-generate.yaml Updates Go version for codegen checks.
.claude/CLAUDE.md Updates documented Go version reference.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tldb/adapter.go
Comment thread tldb/common.go Outdated
Comment thread tldb/common.go Outdated
Comment thread tldb/adapter.go
@irees irees merged commit 489439d into main Apr 23, 2026
6 checks passed
@irees irees deleted the go-1.26 branch April 23, 2026 05:47
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