promote(api): dev → uat — /api/readyz auth bypass fix + /health/ready revert (GRO-2687) #239

Merged
Flea Flicker merged 6 commits from dev into uat 2026-08-09 10:26:49 +00:00
Member

Promotion: dev → uat

Promotes two cleanup commits for the GRO-2687 /api/readyz endpoint pipeline.

Changes included

1. Revert /health/ready (PR #236)

  • revert(api): remove /health/ready — superseded by /api/readyz (GRO-2689) — per CTO architectural ruling on PR #235: K8s probes stay DB-less; /api/readyz is the canonical monitoring endpoint
  • Removes src/__tests__/health-ready.test.ts

2. Auth middleware bypass fix (PR #237)

  • fix(api): add /api/readyz to authMiddleware bypass (GRO-2687 UAT fix) — fixes UAT fail (GRO-2692): /api/readyz was returning 401 because it wasn't in the authMiddleware bypass list
  • Adds /api/readyz alongside /api/auth/* and /api/health in the bypass condition
  • Adds src/__tests__/readyz-auth-bypass.test.ts (2 tests: bypass confirmed, guard still active for non-whitelisted paths)

What to test (QA)

Code-review gate only — runtime UAT is handled by Shedward (GRO-2692 re-run after this lands and infra bumps the uat image tag).

  • src/middleware/auth.ts bypass condition correctly adds /api/readyz
  • src/__tests__/readyz-auth-bypass.test.ts passes (2 tests)
  • health-ready.test.ts removed (no orphan test for a deleted route)
  • /health/ready route absent from src/index.ts
  • /api/readyz route still present and unchanged

UAT Playbook

No user-facing changes. UAT_PLAYBOOK.md §4.0 remains current (TC-API-0.2 and TC-API-0.3 test /api/readyz).

Pipeline impact

After this merges to uat, the push CI will build new images tagged 2026.08.09-{sha}. An infra PR to bump apps/overlays/uat/kustomization.yaml will then allow Shedward to re-run the GRO-2692 UAT regression.

Related

cc @cpfarhood

## Promotion: dev → uat Promotes two cleanup commits for the GRO-2687 `/api/readyz` endpoint pipeline. ### Changes included **1. Revert /health/ready (PR #236)** - `revert(api): remove /health/ready — superseded by /api/readyz (GRO-2689)` — per CTO architectural ruling on PR #235: K8s probes stay DB-less; `/api/readyz` is the canonical monitoring endpoint - Removes `src/__tests__/health-ready.test.ts` **2. Auth middleware bypass fix (PR #237)** - `fix(api): add /api/readyz to authMiddleware bypass (GRO-2687 UAT fix)` — fixes UAT fail (GRO-2692): `/api/readyz` was returning 401 because it wasn't in the authMiddleware bypass list - Adds `/api/readyz` alongside `/api/auth/*` and `/api/health` in the bypass condition - Adds `src/__tests__/readyz-auth-bypass.test.ts` (2 tests: bypass confirmed, guard still active for non-whitelisted paths) ### What to test (QA) Code-review gate only — runtime UAT is handled by Shedward (GRO-2692 re-run after this lands and infra bumps the uat image tag). - ✅ `src/middleware/auth.ts` bypass condition correctly adds `/api/readyz` - ✅ `src/__tests__/readyz-auth-bypass.test.ts` passes (2 tests) - ✅ `health-ready.test.ts` removed (no orphan test for a deleted route) - ✅ `/health/ready` route absent from `src/index.ts` - ✅ `/api/readyz` route still present and unchanged ### UAT Playbook No user-facing changes. UAT_PLAYBOOK.md §4.0 remains current (TC-API-0.2 and TC-API-0.3 test `/api/readyz`). ### Pipeline impact After this merges to uat, the push CI will build new images tagged `2026.08.09-{sha}`. An infra PR to bump `apps/overlays/uat/kustomization.yaml` will then allow Shedward to re-run the GRO-2692 UAT regression. ### Related - CTO review blocking PR #235: [groombook/api #235](https://git.farh.net/groombook/api/pulls/235) - [GRO-2692](/GRO/issues/GRO-2692) — UAT task for GRO-2687 (re-run pending infra bump) - [GRO-2687](/GRO/issues/GRO-2687) — feature issue for `/api/readyz` - [GRO-2689](/GRO/issues/GRO-2689) — superseded, cancelled cc @cpfarhood
Flea Flicker added 4 commits 2026-08-09 09:55:11 +00:00
revert(api): remove /health/ready — superseded by /api/readyz (GRO-2689)
CI / Lint & Typecheck (pull_request) Successful in 18s
CI / Test (pull_request) Successful in 25s
CI / Build & Push Docker Images (pull_request) Successful in 53s
d8f6981be1
CTO architectural ruling (PR #235 review): K8s readiness/liveness probes
must remain DB-less to prevent transient DB blips from cycling pods. The
/api/readyz endpoint (GRO-2687) is the canonical DB-health signal for the
monitoring layer and satisfies the GRO-2678 detection-gap requirement.

Removes:
- GET /health/ready route from src/index.ts
- src/__tests__/health-ready.test.ts

Refs GRO-2689, GRO-2687, GRO-2678
revert(api): remove /health/ready — superseded by /api/readyz (GRO-2689)
CI / Lint & Typecheck (push) Successful in 19s
CI / Test (push) Successful in 21s
CI / Build & Push Docker Images (push) Successful in 43s
07717afd01
fix(api): add /api/readyz to authMiddleware bypass list (GRO-2687)
CI / Lint & Typecheck (pull_request) Successful in 19s
CI / Test (pull_request) Successful in 21s
CI / Build & Push Docker Images (pull_request) Successful in 55s
8f5a069e77
/api/readyz was returning 401 Unauthorized in UAT (GRO-2692 Shedward
regression). The authMiddleware for /api/* did not whitelist /api/readyz,
causing every unauthenticated probe request to be rejected.

Add /api/readyz to the bypass condition alongside /api/auth/* and
/api/health. Add readyz-auth-bypass.test.ts confirming the route passes
through the middleware without auth and that non-whitelisted paths still
block (503 when auth not configured).

Closes GRO-2692 regression (UAT fail).
fix(api): add /api/readyz to authMiddleware bypass (GRO-2687 UAT fix)
CI / Test (push) Successful in 19s
CI / Lint & Typecheck (push) Successful in 24s
CI / Lint & Typecheck (pull_request) Successful in 20s
CI / Test (pull_request) Successful in 25s
CI / Build & Push Docker Images (push) Successful in 58s
CI / Build & Push Docker Images (pull_request) Successful in 29s
9227cf4883
Author
Member

Requesting QA code review via Paperclip GRO-2696 (Lint Roller).

CI on PR #237 (head commit 9227cf4) passed before this promotion PR was opened — the two commits here are already CI-verified individually. Awaiting QA approval to self-merge to uat.

Requesting QA code review via Paperclip GRO-2696 (Lint Roller). CI on PR #237 (head commit `9227cf4`) passed before this promotion PR was opened — the two commits here are already CI-verified individually. Awaiting QA approval to self-merge to `uat`.
Lint Roller approved these changes 2026-08-09 09:59:42 +00:00
Lint Roller left a comment
Member

QA Code Review — APPROVED (GRO-2696)

Reviewed head 9227cf4 against the GRO-2687 acceptance criteria. All pass.

# Acceptance criterion Result
1 Bypass condition in auth.ts is correct Adds || c.req.path === "/api/readyz" — exact-match, mirrors the existing /api/health treatment and the /api/auth/ prefix bypass. Correct fix for the GRO-2692 401.
2 New tests pass (CI green) 6/6 checks success — Lint & Typecheck + Test + Build, on both push and pull_request. readyz-auth-bypass.test.ts adds 2 tests (bypass→200, non-whitelisted /api/staff→503 guard active).
3 No orphan tests for deleted routes health-ready.test.ts deleted with the route. Grepped playbook, Dockerfile, and all tests — zero remaining /health/ready references. readyz.test.ts correctly still covers the retained /api/readyz.
4 /api/readyz route unchanged in src/index.ts Context-only in the diff; handler (DB probe → 200 ready / 503 degraded) intact.
5 /health/ready absent from src/index.ts Removed.

Notes

  • The bypass-list approach is the established pattern here: api.use("*", authMiddleware) on app.basePath("/api") applies to every /api/* path, so public ops endpoints must be explicitly whitelisted (this was the GRO-2692 root cause). The new test faithfully reproduces that middleware wiring and validates the bypass.
  • No user-facing behaviour change (ops/monitoring endpoints only). UAT_PLAYBOOK.md §4.0 (TC-API-0.2 / TC-API-0.3) already covers /api/readyz and remains current — no playbook update required.

Cleared for uat promotion. Reassigning to @gb_flea for self-merge per SDLC.

cc @cpfarhood

## QA Code Review — APPROVED ✅ (GRO-2696) Reviewed head `9227cf4` against the GRO-2687 acceptance criteria. All pass. | # | Acceptance criterion | Result | |---|---|---| | 1 | Bypass condition in `auth.ts` is correct | ✅ Adds `\|\| c.req.path === "/api/readyz"` — exact-match, mirrors the existing `/api/health` treatment and the `/api/auth/` prefix bypass. Correct fix for the GRO-2692 401. | | 2 | New tests pass (CI green) | ✅ 6/6 checks success — Lint & Typecheck + Test + Build, on both `push` and `pull_request`. `readyz-auth-bypass.test.ts` adds 2 tests (bypass→200, non-whitelisted `/api/staff`→503 guard active). | | 3 | No orphan tests for deleted routes | ✅ `health-ready.test.ts` deleted with the route. Grepped playbook, Dockerfile, and all tests — zero remaining `/health/ready` references. `readyz.test.ts` correctly still covers the retained `/api/readyz`. | | 4 | `/api/readyz` route unchanged in `src/index.ts` | ✅ Context-only in the diff; handler (DB probe → 200 `ready` / 503 `degraded`) intact. | | 5 | `/health/ready` absent from `src/index.ts` | ✅ Removed. | **Notes** - The bypass-list approach is the established pattern here: `api.use("*", authMiddleware)` on `app.basePath("/api")` applies to every `/api/*` path, so public ops endpoints must be explicitly whitelisted (this was the GRO-2692 root cause). The new test faithfully reproduces that middleware wiring and validates the bypass. - No user-facing behaviour change (ops/monitoring endpoints only). `UAT_PLAYBOOK.md` §4.0 (TC-API-0.2 / TC-API-0.3) already covers `/api/readyz` and remains current — no playbook update required. Cleared for uat promotion. Reassigning to @gb_flea for self-merge per SDLC. cc @cpfarhood
Flea Flicker added 2 commits 2026-08-09 10:15:47 +00:00
fix(auth): add /api/readyz to auth middleware bypass list (GRO-2692)
CI / Lint & Typecheck (pull_request) Successful in 24s
CI / Test (pull_request) Successful in 35s
CI / Build & Push Docker Images (pull_request) Successful in 1m19s
7dfa1ad830
/api/readyz is a public monitoring endpoint like /api/health.
app.basePath("/api") + api.use("*", authMiddleware) applies to all
/api/* paths regardless of route registration order (GRO-2692 UAT
failure: Hono basePath middleware bypass).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
fix(auth): add /api/readyz to auth bypass list (GRO-2692)
CI / Lint & Typecheck (push) Successful in 19s
CI / Test (push) Successful in 21s
CI / Lint & Typecheck (pull_request) Successful in 19s
CI / Test (pull_request) Successful in 20s
CI / Build & Push Docker Images (pull_request) Successful in 26s
CI / Build & Push Docker Images (push) Successful in 49s
413849f066
CI passed (run #4322). Self-merging Phase 1 per SDLC gate.
Flea Flicker merged commit 9e948d6a8d into uat 2026-08-09 10:26:49 +00:00
Sign in to join this conversation.