fix(backend): use /health for cloud run smoke endpoints
This commit is contained in:
@@ -9,3 +9,4 @@
|
|||||||
| 2026-02-24 | 0.1.4 | Locked defaults for idempotency, validation, bucket split, model provider, and p95 objectives. |
|
| 2026-02-24 | 0.1.4 | Locked defaults for idempotency, validation, bucket split, model provider, and p95 objectives. |
|
||||||
| 2026-02-24 | 0.1.5 | Added backend makefile module and CI workflow for backend target validation. |
|
| 2026-02-24 | 0.1.5 | Added backend makefile module and CI workflow for backend target validation. |
|
||||||
| 2026-02-24 | 0.1.6 | Added Cloud SQL-backed idempotency storage, migration script, and command API test coverage. |
|
| 2026-02-24 | 0.1.6 | Added Cloud SQL-backed idempotency storage, migration script, and command API test coverage. |
|
||||||
|
| 2026-02-24 | 0.1.7 | Added `/health` endpoints and switched smoke checks to `/health` for Cloud Run compatibility. |
|
||||||
|
|||||||
4
Makefile
4
Makefile
@@ -81,8 +81,8 @@ help:
|
|||||||
@echo " make backend-deploy-core [ENV=dev] Build and deploy core API service"
|
@echo " make backend-deploy-core [ENV=dev] Build and deploy core API service"
|
||||||
@echo " make backend-deploy-commands [ENV=dev] Build and deploy command API service"
|
@echo " make backend-deploy-commands [ENV=dev] Build and deploy command API service"
|
||||||
@echo " make backend-deploy-workers [ENV=dev] Deploy async worker functions scaffold"
|
@echo " make backend-deploy-workers [ENV=dev] Deploy async worker functions scaffold"
|
||||||
@echo " make backend-smoke-core [ENV=dev] Run health smoke test for core service"
|
@echo " make backend-smoke-core [ENV=dev] Run health smoke test for core service (/health)"
|
||||||
@echo " make backend-smoke-commands [ENV=dev] Run health smoke test for command service"
|
@echo " make backend-smoke-commands [ENV=dev] Run health smoke test for command service (/health)"
|
||||||
@echo " make backend-logs-core [ENV=dev] Tail/read logs for core service"
|
@echo " make backend-logs-core [ENV=dev] Tail/read logs for core service"
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo " 🛠️ DEVELOPMENT TOOLS"
|
@echo " 🛠️ DEVELOPMENT TOOLS"
|
||||||
|
|||||||
@@ -2,11 +2,14 @@ import { Router } from 'express';
|
|||||||
|
|
||||||
export const healthRouter = Router();
|
export const healthRouter = Router();
|
||||||
|
|
||||||
healthRouter.get('/healthz', (req, res) => {
|
function healthHandler(req, res) {
|
||||||
res.status(200).json({
|
res.status(200).json({
|
||||||
ok: true,
|
ok: true,
|
||||||
service: 'krow-command-api',
|
service: 'krow-command-api',
|
||||||
version: process.env.SERVICE_VERSION || 'dev',
|
version: process.env.SERVICE_VERSION || 'dev',
|
||||||
requestId: req.requestId,
|
requestId: req.requestId,
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
|
healthRouter.get('/health', healthHandler);
|
||||||
|
healthRouter.get('/healthz', healthHandler);
|
||||||
|
|||||||
@@ -2,11 +2,14 @@ import { Router } from 'express';
|
|||||||
|
|
||||||
export const healthRouter = Router();
|
export const healthRouter = Router();
|
||||||
|
|
||||||
healthRouter.get('/healthz', (req, res) => {
|
function healthHandler(req, res) {
|
||||||
res.status(200).json({
|
res.status(200).json({
|
||||||
ok: true,
|
ok: true,
|
||||||
service: 'krow-core-api',
|
service: 'krow-core-api',
|
||||||
version: process.env.SERVICE_VERSION || 'dev',
|
version: process.env.SERVICE_VERSION || 'dev',
|
||||||
requestId: req.requestId,
|
requestId: req.requestId,
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
|
healthRouter.get('/health', healthHandler);
|
||||||
|
healthRouter.get('/healthz', healthHandler);
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ backend-help:
|
|||||||
@echo " make backend-deploy-core [ENV=dev] Build + deploy core API service"
|
@echo " make backend-deploy-core [ENV=dev] Build + deploy core API service"
|
||||||
@echo " make backend-deploy-commands [ENV=dev] Build + deploy command API service"
|
@echo " make backend-deploy-commands [ENV=dev] Build + deploy command API service"
|
||||||
@echo " make backend-deploy-workers [ENV=dev] Deploy worker scaffold"
|
@echo " make backend-deploy-workers [ENV=dev] Deploy worker scaffold"
|
||||||
@echo " make backend-smoke-core [ENV=dev] Smoke test core /healthz"
|
@echo " make backend-smoke-core [ENV=dev] Smoke test core /health"
|
||||||
@echo " make backend-smoke-commands [ENV=dev] Smoke test commands /healthz"
|
@echo " make backend-smoke-commands [ENV=dev] Smoke test commands /health"
|
||||||
@echo " make backend-logs-core [ENV=dev] Read core service logs"
|
@echo " make backend-logs-core [ENV=dev] Read core service logs"
|
||||||
|
|
||||||
backend-enable-apis:
|
backend-enable-apis:
|
||||||
@@ -149,7 +149,7 @@ backend-smoke-core:
|
|||||||
exit 1; \
|
exit 1; \
|
||||||
fi; \
|
fi; \
|
||||||
TOKEN=$$(gcloud auth print-identity-token); \
|
TOKEN=$$(gcloud auth print-identity-token); \
|
||||||
curl -fsS -H "Authorization: Bearer $$TOKEN" "$$URL/healthz" >/dev/null && echo "✅ Core smoke check passed: $$URL/healthz"
|
curl -fsS -H "Authorization: Bearer $$TOKEN" "$$URL/health" >/dev/null && echo "✅ Core smoke check passed: $$URL/health"
|
||||||
|
|
||||||
backend-smoke-commands:
|
backend-smoke-commands:
|
||||||
@echo "--> Running commands smoke check..."
|
@echo "--> Running commands smoke check..."
|
||||||
@@ -159,7 +159,7 @@ backend-smoke-commands:
|
|||||||
exit 1; \
|
exit 1; \
|
||||||
fi; \
|
fi; \
|
||||||
TOKEN=$$(gcloud auth print-identity-token); \
|
TOKEN=$$(gcloud auth print-identity-token); \
|
||||||
curl -fsS -H "Authorization: Bearer $$TOKEN" "$$URL/healthz" >/dev/null && echo "✅ Commands smoke check passed: $$URL/healthz"
|
curl -fsS -H "Authorization: Bearer $$TOKEN" "$$URL/health" >/dev/null && echo "✅ Commands smoke check passed: $$URL/health"
|
||||||
|
|
||||||
backend-logs-core:
|
backend-logs-core:
|
||||||
@echo "--> Reading logs for core backend service [$(BACKEND_CORE_SERVICE_NAME)]..."
|
@echo "--> Reading logs for core backend service [$(BACKEND_CORE_SERVICE_NAME)]..."
|
||||||
|
|||||||
Reference in New Issue
Block a user