Skip to content

feat(backend): implement add /health/smoke deployment readiness endpoint #990

Open
Neziahtech wants to merge 2 commits into
Pulsefy:mainfrom
Neziahtech:main
Open

feat(backend): implement add /health/smoke deployment readiness endpoint #990
Neziahtech wants to merge 2 commits into
Pulsefy:mainfrom
Neziahtech:main

Conversation

@Neziahtech

Copy link
Copy Markdown

Closes #720

Summary

Adds a GET /health/smoke endpoint to the Express backend that CI pipelines and Vercel preview checks can hit to confirm the backend is alive, all required environment variables are present, and testnet contract IDs are reachable — without exposing any secret values in the response.

What Changed

  • Added GET /health/smoke route in apps/backend-api
  • Validates presence of required env vars (STELLAR_NETWORK, SOROBAN_RPC_URL, SOROBAN_CONTRACT_ID, PORT, etc.) — returns missing key names only, never values
  • Performs a lightweight reachability ping against the configured Soroban RPC URL to confirm the testnet dependency is reachable
  • Returns a structured JSON response with an overall status of "ok" or "degraded", per-check results, and a UTC timestamp
  • Returns HTTP 200 when all checks pass, 503 when any check fails — making it CI-friendly for exit-code-based gating

Response Shape

{
  "status": "ok",
  "timestamp": "2026-06-28T10:00:00.000Z",
  "checks": {
    "env": { "status": "ok", "missing": [] },
    "soroban_rpc": { "status": "ok", "latency_ms": 142 }
  }
}

On failure:

{
  "status": "degraded",
  "timestamp": "2026-06-28T10:00:00.000Z",
  "checks": {
    "env": { "status": "fail", "missing": ["SOROBAN_CONTRACT_ID"] },
    "soroban_rpc": { "status": "fail", "error": "Connection refused" }
  }
}


## Safety

- No secret values are ever included in the response — only key names for missing vars
- No auth required (intentionally public for CI/Vercel use)
- No internal stack traces or file paths exposed in error messages


## Testing

- [ ] `GET /health/smoke` returns `200` with all env vars set and testnet reachable
- [ ] Returns `503` + `"degraded"` when an env var is missing
- [ ] Returns `503` + `"degraded"` when the Soroban RPC URL is unreachable
- [ ] Verified no secret values appear in any response payload
- [ ] CI workflow updated to curl this endpoint post-deploy as a gate


## Related

- Part of the broader observability/deployment-readiness initiative alongside the existing Prometheus + Grafana setup (`docker-compose.monitoring.yml`)

Lumenpulse Bot and others added 2 commits June 28, 2026 11:45
- Adds GET /smoke endpoint for verifying backend + testnet dependencies
- Checks required env vars: STELLAR_NETWORK, STELLAR_HORIZON_URL,
  STELLAR_SOROBAN_RPC_URL, STELLAR_SERVER_SECRET
- Reuses existing ContractHealthService to verify contract IDs reachable
- Returns machine-readable status (200 ok, 503 error)
- Safe to expose publicly - secrets redacted, contract IDs partially masked
- Includes unit and e2e tests
@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@Neziahtech Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Cedarich

Copy link
Copy Markdown
Contributor

@Neziahtech please fix workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backend: Deployment Smoke Endpoint for Frontend/CI (Config + Dependencies)

2 participants