feat(backend): implement add /health/smoke deployment readiness endpoint #990
Open
Neziahtech wants to merge 2 commits into
Open
feat(backend): implement add /health/smoke deployment readiness endpoint #990Neziahtech wants to merge 2 commits into
Neziahtech wants to merge 2 commits into
Conversation
- 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
|
@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! 🚀 |
Contributor
|
@Neziahtech please fix workflow |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #720
Summary
Adds a
GET /health/smokeendpoint 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
GET /health/smokeroute inapps/backend-apiSTELLAR_NETWORK,SOROBAN_RPC_URL,SOROBAN_CONTRACT_ID,PORT, etc.) — returnsmissingkey names only, never valuesstatusof"ok"or"degraded", per-check results, and a UTC timestamp200when all checks pass,503when any check fails — making it CI-friendly for exit-code-based gatingResponse 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`)