1 Commits
Author SHA1 Message Date
clawbot 79a63408f0 build: unify the gate so root make check covers the backend (closes #16)
check / check (push) Successful in 45s
Root make check, and with it the pre-commit hook, now gates the Go
backend too. The backend's Makefile targets are shims over
backend/script/*; script/cibuild builds both images and is the
workflow's only build step.

The root make lint runs golangci-lint only in Docker, by building the
lint stage of Dockerfile.backend without the cache; the .golangci.yml
drift check moved into backend/script/lint. script/bootstrap installs
no linter: it reuses a Go at least as new as backend/go.mod asks for,
otherwise installs the pinned, hash-verified release, and links what it
installs into ~/.local/bin without replacing anything it did not
create. The backend version falls back to dev when VERSION is unset or
empty.

Model: opus-5-5
2026-09-28 22:06:51 +00:00
5 changed files with 13 additions and 15 deletions
+5 -4
View File
@@ -30,11 +30,12 @@ COPY backend/ .
RUN make test
# make build is a shim around backend/script/build, the one definition
# of the build command:
# The build is driven through the Makefile so there is exactly one
# definition of the build command; it expands to
# CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X main.Version=... -X main.Buildarch=..."
# That script reads VERSION from the environment, so it is handed over
# there rather than as a make variable.
# VERSION is handed over in the environment rather than as a make
# variable so it still reaches the build if the target is ever turned
# into a shim around a script.
ARG VERSION=dev
RUN VERSION="${VERSION}" make build
+1 -2
View File
@@ -45,8 +45,7 @@ halves, so the root `make check` fails if either one is broken. We provide:
- `script/setup` — make a fresh clone ready for development: bootstrap plus the
git pre-commit hook
- `script/projectname` — print the project name (used for the Docker image tags)
- `script/test` — run `script/frontend-test`, then the backend's Go tests, both
within one 30-second timeout
- `script/test` — run `script/frontend-test`, then the backend's Go tests
- `script/lint` — run `script/frontend-lint`, then golangci-lint in Docker, by
building the lint stage of `Dockerfile.backend` without the cache
- `script/fmt` — format all files (writes): prettier, then gofmt over `backend/`
+2 -3
View File
@@ -32,9 +32,8 @@ latest run passes.
`Dockerfile.backend` without the cache. `script/bootstrap` installs the pinned
Go unless the installed one is at least what `backend/go.mod` asks for, links
what it installs into `~/.local/bin` without replacing anything it did not
create, and installs no linter. Root `make test` runs both halves within one
30-second timeout. When `VERSION` is unset or empty, the backend binary's
version falls back to `git describe` inside a git checkout, then to `dev`
create, and installs no linter. The backend binary's version falls back to
`dev` when `VERSION` is unset or empty
- 2026-09-28: frontend reporting client (issue #53): a `Reporter` class posts
collected samples to `/api/v1/reports` every `reportInterval` (default 60s) as
a per-host delta, with the report-building step a pure exported function of
+2 -3
View File
@@ -31,9 +31,8 @@ pattern as the repo root: the targets in `backend/Makefile` are thin shims over
`test`, `fmt` and `fmt-check`:
- `script/build` — compile the static `netwatch-server` binary with its version
and architecture stamped in. The version is `VERSION` from the environment;
when that is unset or empty, it falls back to `git describe` inside a git
checkout, then to `dev`
and architecture stamped in. The version is `VERSION` from the environment,
else `git describe`, else `dev`
- `script/test` — run the Go tests under a 30-second timeout
- `script/lint` — check `.golangci.yml` against its pinned sha256, then run
golangci-lint. It runs inside the golangci-lint image of the lint stage of
+3 -3
View File
@@ -1,14 +1,14 @@
#!/bin/sh
# script/test: run the test suite for the whole repo: the frontend at
# the repo root, then the Go backend in backend/. Both halves together
# get 30 seconds; each also keeps its own limit for the Dockerfiles.
# the repo root, then the Go backend in backend/.
set -eu
ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"
main() {
cd "$ROOT"
timeout 30 sh -c 'script/frontend-test && backend/script/test'
"$ROOT/script/frontend-test"
"$ROOT/backend/script/test"
}
main "$@"