From bb2c906b5dfbb5d8810cd4a67e91a0bebac70b84 Mon Sep 17 00:00:00 2001 From: "Ikenga Ifeanyi .M." Date: Fri, 28 Aug 2026 14:58:42 +0100 Subject: [PATCH 1/2] Closes #1190 - Enforce backward-compatible OpenAPI changes in CI --- .github/workflows/ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d25c7ee..716545f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,3 +85,10 @@ jobs: run: npx tsx scripts/check-migrations.ts env: CHECKSUM_CI_SKIP_MISSING: "1" + + - name: Check OpenAPI backward compatibility + if: github.event_name == 'pull_request' + run: | + git fetch origin ${{ github.base_ref }} + npx --yes @useoptic/optic diff docs/openapi.json --base origin/${{ github.base_ref }} --check + From 2222ff715e76baa8d931ed74c2606fd54732439b Mon Sep 17 00:00:00 2001 From: "Ikenga Ifeanyi .M." Date: Fri, 28 Aug 2026 15:16:53 +0100 Subject: [PATCH 2/2] fix(#1181): Separate dependency readiness from liveness health checks --- src/app.ts | 45 +++------------------------------------------ 1 file changed, 3 insertions(+), 42 deletions(-) diff --git a/src/app.ts b/src/app.ts index a1fbe6b..efc4f0a 100644 --- a/src/app.ts +++ b/src/app.ts @@ -376,49 +376,10 @@ export const createApp = (dependencies?: Partial) => { }), ); - app.get("/api/health", createTimeoutMiddleware({ timeoutMs: config.healthRequestTimeoutMs }), async (req, res) => { + app.get("/api/health", (req, res) => { const requestId = getRequestId(req); - // If no health check config provided, return simple health check - if (!dependencies?.healthCheckConfig) { - const data = { status: "ok", service: "callora-backend" }; - res.json(successEnvelope(data, requestId)); - return; - } - - try { - // Cooperative abort: if the per-request timeout fires while performHealthCheck - // is awaiting a dependency probe, the aborted signal propagates to any - // in-flight fetch calls inside the service layer, allowing them to cancel - // quickly rather than burning the full per-component timeout. - const healthStatus = await performHealthCheck( - dependencies.healthCheckConfig, - req.abortSignal, - ); - - // Guard: if the timeout middleware already sent a 504 (res.headersSent) - // we must not attempt to write a second response. - if (res.headersSent) { - return; - } - - const statusCode = healthStatus.status === "down" ? 503 : 200; - res.status(statusCode).json(successEnvelope(healthStatus, requestId)); - } catch { - if (res.headersSent) { - return; - } - // Never expose internal errors in health check - res.status(503).json( - errorEnvelope("SERVICE_UNAVAILABLE", "Health check failed", requestId, { - status: "down", - timestamp: new Date().toISOString(), - checks: { - api: "ok", - database: "down", - }, - }), - ); - } + const data = { status: "ok", service: "callora-backend" }; + res.json(successEnvelope(data, requestId)); }); // Public maintenance status — readable by external monitoring without admin auth.