The new deploy workflow's health check (and the in-container
`/librenotes healthcheck` invocation) both hit `/healthz` on
the public origin and were returning 404. Cause: `cmd/librenotes/serve.go`
mounts `apiHandler` only at `/auth/` and `/api/`, so `/healthz`
falls through to the static file server.
This patch mounts `/healthz` on the root mux directly and adds a
small `serve_test.go` that exercises the routing topology so the
regression cannot reappear silently.
Verified locally:
```
$ /tmp/librenotes-bin serve &
$ curl -s -o /dev/null -w '%{http_code}\n' http://localhost:18080/healthz
200
$ go test ./cmd/librenotes/
ok git.librete.ch/public/librenotes/cmd/librenotes 0.011s
```
Once merged this should turn the next deploy run green end-to-end.
The new deploy workflow's health check (and the in-container
\`/librenotes healthcheck\` invocation) both hit \`/healthz\` on
the public origin and were returning 404. Cause: \`cmd/librenotes/serve.go\`
mounts \`apiHandler\` only at \`/auth/\` and \`/api/\`, so \`/healthz\`
falls through to the static file server.
This patch mounts \`/healthz\` on the root mux directly and adds a
small \`serve_test.go\` that exercises the routing topology so the
regression cannot reappear silently.
Verified locally:
\`\`\`
$ /tmp/librenotes-bin serve &
$ curl -s -o /dev/null -w '%{http_code}\n' http://localhost:18080/healthz
200
$ go test ./cmd/librenotes/
ok git.librete.ch/public/librenotes/cmd/librenotes 0.011s
\`\`\`
Once merged this should turn the next deploy run green end-to-end.
Stacks on top of #43 (already merged).
The /healthz route was registered inside httpapi.Server.Routes() but
the root mux only attached that handler at /auth/ and /api/, so any
request to /healthz fell through to the static file server and got
404'd. Caddy's reverse-proxy and the deploy workflow's curl-based
health check both hit the public origin, so the in-container
healthcheck reported 'unhealthy' and CI never marked the deploy as
verified.
Mount /healthz on the root mux explicitly. Add a serve_test.go that
asserts the same routing topology so the regression cannot return
silently.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The new deploy workflow's health check (and the in-container
`/librenotes healthcheck` invocation) both hit `/healthz` on
the public origin and were returning 404. Cause: `cmd/librenotes/serve.go`
mounts `apiHandler` only at `/auth/` and `/api/`, so `/healthz`
falls through to the static file server.
This patch mounts `/healthz` on the root mux directly and adds a
small `serve_test.go` that exercises the routing topology so the
regression cannot reappear silently.
Verified locally:
```
$ /tmp/librenotes-bin serve &
$ curl -s -o /dev/null -w '%{http_code}\n' http://localhost:18080/healthz
200
$ go test ./cmd/librenotes/
ok git.librete.ch/public/librenotes/cmd/librenotes 0.011s
```
Once merged this should turn the next deploy run green end-to-end.
Stacks on top of #43 (already merged).