Commit 489439d
authored
Upgrade to go 1.26 (#601)
## 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.go` — `newAdapter` short-circuits the sqlite memory DSN
and returns the registered `sqlite3` adapter directly; all other dburls
go through `url.Parse` unchanged
- `tldb/common.go` — `getFvids` 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 jobs1 parent 18eb352 commit 489439d
8 files changed
Lines changed: 28 additions & 33 deletions
File tree
- .claude
- .github/workflows
- tldb
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
12 | 18 | | |
13 | 19 | | |
14 | 20 | | |
15 | 21 | | |
16 | 22 | | |
17 | 23 | | |
18 | | - | |
19 | | - | |
20 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
21 | 31 | | |
22 | | - | |
| 32 | + | |
23 | 33 | | |
24 | 34 | | |
25 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
136 | 140 | | |
137 | 141 | | |
138 | 142 | | |
| |||
0 commit comments