ci: lint, tests against TimescaleDB and Redis, binaries and image #81

Merged
Sebi merged 3 commits from ci/pipeline into main 2026-11-22 12:51:42 +00:00
Owner

First CI pipeline for this instance's Gitea Actions runners (act_runner, ephemeral, job image node:20-bullseye). Green on run 3148.

Jobs (on pull requests, main and v* tags)

  • lint – generated code up to date (templ, sqlc), gofmt, go vet, golangci-lint 2.12.2 built with Go 1.27 (the release binaries are built with an older Go and fail on Go 1.27 code).
  • test – TimescaleDB 2.30/pg16 and Redis 8 as service containers; internal/devtools/pginit applies deploy/dev/postgres-init.sql (service containers cannot mount it), so the app role is no superuser and row-level security is really tested; go test -p 1 ./....
  • build – frontend and binaries for linux/amd64 and arm64.
  • image – Kaniko from docker:cli as in the other repositories here; pushes :<timestamp>-<sha> and :latest from main and :vX.Y.Z from tags once a PACKAGE_TOKEN secret (write:package) exists; until then and for pull requests it only builds.

Speed: the ephemeral runners clone every action from GitHub (setup-go 80 s, setup-node 150 s); Go and sqlc are installed from release archives and the job image's Node is used. Lint 18 → 9.5 min.

Found by CI and fixed here: checkers that lost the answer to a result report resent it and the API stored it twice (skewing SLA and counting failures twice toward incidents). Results are now claimed in Redis by instance, monitor and schedule time (TestResultReportIsIdempotent).

Refs #32, #37 (closing once merged and the image push is verified)

🤖 Generated with Claude Code

https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3

First CI pipeline for this instance's Gitea Actions runners (act_runner, ephemeral, job image node:20-bullseye). Green on run 3148. **Jobs** (on pull requests, main and v* tags) - **lint** – generated code up to date (templ, sqlc), gofmt, go vet, golangci-lint 2.12.2 built with Go 1.27 (the release binaries are built with an older Go and fail on Go 1.27 code). - **test** – TimescaleDB 2.30/pg16 and Redis 8 as service containers; `internal/devtools/pginit` applies `deploy/dev/postgres-init.sql` (service containers cannot mount it), so the app role is no superuser and row-level security is really tested; `go test -p 1 ./...`. - **build** – frontend and binaries for linux/amd64 and arm64. - **image** – Kaniko from docker:cli as in the other repositories here; pushes `:<timestamp>-<sha>` and `:latest` from main and `:vX.Y.Z` from tags **once a `PACKAGE_TOKEN` secret (write:package) exists**; until then and for pull requests it only builds. **Speed:** the ephemeral runners clone every action from GitHub (setup-go 80 s, setup-node 150 s); Go and sqlc are installed from release archives and the job image's Node is used. Lint 18 → 9.5 min. **Found by CI and fixed here:** checkers that lost the answer to a result report resent it and the API stored it twice (skewing SLA and counting failures twice toward incidents). Results are now claimed in Redis by instance, monitor and schedule time (`TestResultReportIsIdempotent`). Refs #32, #37 (closing once merged and the image push is verified) 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi added this to the M10 Release & Updates milestone 2026-11-22 11:16:14 +00:00
Sebi added 1 commit 2026-11-22 11:16:16 +00:00
ci: lint, test against TimescaleDB and Redis, build binaries and image
ci / image (pull_request) Successful in 2m32s
ci / build (pull_request) Successful in 11m7s
ci / test (pull_request) Failing after 13m2s
ci / lint (pull_request) Successful in 18m32s
d24937e584
Refs #32, #37

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi added 2 commits 2026-11-22 11:46:39 +00:00
A checker that lost the answer to a report, for example when its request
was cancelled while the API was still working, sent the batch again and
the API stored it twice, skewing statistics and counting failures twice
towards an incident. Results are now claimed in Redis by instance,
monitor and schedule time, and repeats are dropped. Found by CI, where
TestCheckersPerRegion saw a stopped checker's batch arrive twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
ci: install Go and sqlc as binaries instead of through actions
ci / image (pull_request) Successful in 3m22s
ci / test (pull_request) Successful in 5m29s
ci / build (pull_request) Successful in 6m27s
ci / lint (pull_request) Successful in 9m34s
db8bdb3a62
The runners are ephemeral and clone every action from GitHub, which took
several minutes per job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi changed title from ci: lint, tests, build and image to ci: lint, tests against TimescaleDB and Redis, binaries and image 2026-11-22 12:06:37 +00:00
Sebi merged commit 6dadb920d7 into main 2026-11-22 12:51:42 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ZB-Server/uptimesebi#81