Commit Graph

2 Commits

Author SHA1 Message Date
xarmian 1d20ae56c8 fix(release): the release smoke stops the server it boots, and checks that it did (TASK-2035) (#1983)
#1980's script started the server through clean(), a shell FUNCTION,
in the background. That runs in a subshell, so $! was the subshell's
pid: the startup liveness check, the SIGTERM and the 'did not stop
within 5s' assertion were all aimed at the subshell, and the real server
kept running. The stop check could never fail, and every run left a
server behind (found as seven stray pad servers, two under qemu, from
the snapshot verification, while chasing a low-memory reap).

The server now starts through env directly, so $! IS the server, and
'stopped' also means nothing answers on the port afterwards.

Measured against a real binary: the old script passes and leaves 1
server running; this one passes and leaves 0.
2026-10-09 15:02:35 -04:00
xarmian 2c1706fbbb build(release): a shipped binary that does not start fails the release before it publishes (TASK-2035) (#1980)
A GoReleaser builds[].hooks.post runs scripts/release-smoke.sh on every
binary right after its build and before anything is archived, signed,
notarized, pushed or uploaded; a non-zero exit fails 'release' at the
build stage with nothing published. No skip switch (lead ruling): a flake
gets a re-run, not a bypass.

- Every target, statically (go version -m reads any GOOS/GOARCH): a Go
  executable whose main is github.com/PerpetualSoftware/pad/cmd/pad, with
  the GOOS/GOARCH it claims and the version and commit the release sets
  in its -ldflags (GoReleaser builds without VCS stamping).
- linux/amd64 natively and linux/arm64 under qemu-user also BOOT:
  --version names the version and commit, and 'server start' on a free
  loopback port with an empty HOME/data dir answers /api/v1/health with
  status ok, the same version and commit, and an embedded web bundle
  built from the same commit; then it must stop on SIGTERM.
- darwin and windows cannot run on the ubuntu runner; ci.yml's
  native-smoke job boots them from source on every PR.

The binary runs with an empty environment: the hook inherits the
GoReleaser step's env, which carries the macOS signing and notary
secrets. qemu-user comes from Ubuntu's own package, not a new third-party
action, since this job holds contents:write and the GHCR token.

Verified with goreleaser v2.15.4 --snapshot (publish, sign, notarize,
docker and sbom skipped): all six pass; a hook expecting the wrong
version fails all six at the build stage, and a binary that exits at
'server start' fails linux/amd64 and linux/arm64 there; both produce no
archive.
2026-10-09 13:50:51 -04:00