Skip to content

fix: health endpoint uses machine-readable reason field for env guard (#36)#43

Merged
zacharias-ona merged 1 commit into
mainfrom
fix/36-health-env-guard-v2
Apr 15, 2026
Merged

fix: health endpoint uses machine-readable reason field for env guard (#36)#43
zacharias-ona merged 1 commit into
mainfrom
fix/36-health-env-guard-v2

Conversation

@zacharias-ona
Copy link
Copy Markdown
Collaborator

Closes #36

Supersedes #41 (rebased cleanly onto current main to resolve merge conflicts).

What

Changes the health endpoint's env var guard response from message: "not configured" to reason: "not_configured" — a machine-readable snake_case value suitable for programmatic consumption.

Changes

  • src/app/api/health/route.ts: db.messagedb.reason with "not_configured" value, added explanatory comment
  • src/app/api/health/route.test.ts: Updated assertions to match new field name
  • .agents/conventions.md: Added env var guard to API route code example, added "Guarding Supabase env vars" subsection documenting the pattern

Testing

All 8 tests pass: pnpm lint && pnpm typecheck && pnpm test

)

Change db.message to db.reason with snake_case value for programmatic consumption.
Add env var guard to conventions API route example and document the pattern.

Co-authored-by: Ona <no-reply@ona.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
memo Ready Ready Preview, Comment Apr 15, 2026 10:10am

Request Review

@zacharias-ona zacharias-ona merged commit d67fe1f into main Apr 15, 2026
5 checks passed
@zacharias-ona zacharias-ona deleted the fix/36-health-env-guard-v2 branch April 15, 2026 10:11
@zacharias-ona
Copy link
Copy Markdown
Collaborator Author

✅ UI verification skipped — no UI files changed (no src/components/*, src/app/**/page.tsx, or src/app/**/layout.tsx in diff).

@zacharias-ona
Copy link
Copy Markdown
Collaborator Author

✅ Post-merge verification passed.

Routes tested:

  • / — landing page loaded, title present
  • /login — email input found
  • /api/health — returned OK, no "status":"down"
  • /dashboard — no 500 error (redirects to login as expected)

Skipped: none

Console errors: none

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.

bug: UI regression after PR #34 — Health endpoint reports database down

1 participant