Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ func TestE2E_Healthz_ReturnsOK(t *testing.T) {
if body["ok"] != true {
t.Errorf("GET /healthz: want ok=true, got %v", body)
}
if body["service"] != "instant.dev" {
t.Errorf("GET /healthz: want service=instant.dev, got %v", body["service"])
// BUG-API-146/148/309: `service` is "instanode-api" — the legacy
// "instant.dev" value is the brand drift this assertion catches.
if body["service"] != "instanode-api" {
t.Errorf("GET /healthz: want service=instanode-api, got %v", body["service"])
}
}

Expand Down
9 changes: 7 additions & 2 deletions internal/router/healthz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestHealthzShape(t *testing.T) {
m := reader.Get(c.UserContext())
return c.JSON(fiber.Map{
"ok": true,
"service": "instant.dev",
"service": "instanode-api",
"commit_id": buildinfo.GitSHA,
"build_time": buildinfo.BuildTime,
"version": buildinfo.Version,
Expand Down Expand Up @@ -75,7 +75,12 @@ func TestHealthzShape(t *testing.T) {
// Buildinfo contract — every field is non-empty; commit_id specifically
// falls back to "dev" when -ldflags is omitted (go run, go test).
require.Equal(t, true, got["ok"])
require.Equal(t, "instant.dev", got["service"])
// BUG-API-146/148/309: `service` must align with the runtime brand
// ("instanode-api"), not the legacy "instant.dev" string. Canaries
// + log-line correlation key on the new value.
require.Equal(t, "instanode-api", got["service"])
require.NotEqual(t, "instant.dev", got["service"],
"BUG-API-146: legacy brand string must not regress into /healthz.service")
require.NotEmpty(t, got["commit_id"], "commit_id MUST be present on /healthz")
require.NotEmpty(t, got["build_time"])
require.NotEmpty(t, got["version"])
Expand Down
18 changes: 15 additions & 3 deletions internal/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,12 @@ func NewWithHooks(cfg *config.Config, db *sql.DB, rdb *redis.Client, geoDbs *mid
// GET /livez — "the process is alive." NO database check, NO migration
// check, NO auth, NO rate-limit, NO logging context. Pure process-up
// signal so a k8s liveness probe can distinguish "process alive" from
// "process ready" (the readiness signal lives at /healthz, which checks
// DB + migration state).
// "process ready" (the deep readiness matrix lives at /readyz — see
// handlers/readyz.go; /healthz is the shallow build-SHA + migration
// stamp surface that canaries hit post-deploy). BUG-API-202: an
// earlier copy of this block said "readiness signal lives at /healthz"
// which was wrong — /healthz is the shallow probe, /readyz is the
// per-component readiness matrix wired to the k8s readinessProbe.
//
// Wired here BEFORE the app.Use(...) chain so the kubelet's probe
// traffic (~6/min/pod from livenessProbe + readinessProbe split, per
Expand Down Expand Up @@ -367,9 +371,17 @@ func NewWithHooks(cfg *config.Config, db *sql.DB, rdb *redis.Client, geoDbs *mid
// of the pod's local TZ. build_time is the immutable image stamp;
// `now` is the live read — keeping both lets a probe compute the
// pod's uptime as a sanity check too.
// BUG-API-146/148/309 (QA 2026-05-29): the `service` field used to
// emit "instant.dev" — the legacy brand name. Now emits "instanode-api"
// so /healthz aligns with the runtime brand (instanode.dev) and the
// log-line serviceName ("api" / "instant-api"). Canaries that key on
// `service` to disambiguate api vs worker vs provisioner /healthz
// stamps benefit from the new value too — see handlers/readyz.go
// where worker/provisioner probes report "instanode-worker" and
// "instanode-provisioner" in sibling repos.
return c.JSON(fiber.Map{
"ok": true,
"service": "instant.dev",
"service": "instanode-api",
"commit_id": buildinfo.GitSHA,
"build_time": buildinfo.BuildTime,
"version": buildinfo.Version,
Expand Down
Loading