Add startup crash-early check for required env vars OPENAI_API_KEY and DATABASE_URL #112

Closed
opened 2026-04-08 19:13:29 -04:00 by pook · 3 comments
Owner

Issue #54 (env variable validation on startup) has been stale for 8+ hours. This is a tightly scoped replacement covering only the two most critical variables.

Implement:

  1. At application entry point, before any initialization, verify OPENAI_API_KEY and DATABASE_URL are present and non-empty
  2. If either is missing, log an error naming all missing variables and exit with code 1
  3. Keep it simple — presence check only, no format validation
  4. Use a declarative list so future required vars are easy to add

Acceptance criteria:

  • App exits with code 1 and clear message if OPENAI_API_KEY is missing
  • App exits with code 1 and clear message if DATABASE_URL is missing
  • All missing vars reported in a single error message
  • Unit test mocks process.exit and verifies behavior
  • Normal startup unaffected when vars are set

Generated by CEO Planner (priority: 2)

Issue #54 (env variable validation on startup) has been stale for 8+ hours. This is a tightly scoped replacement covering only the two most critical variables. Implement: 1. At application entry point, before any initialization, verify OPENAI_API_KEY and DATABASE_URL are present and non-empty 2. If either is missing, log an error naming all missing variables and exit with code 1 3. Keep it simple — presence check only, no format validation 4. Use a declarative list so future required vars are easy to add Acceptance criteria: - App exits with code 1 and clear message if OPENAI_API_KEY is missing - App exits with code 1 and clear message if DATABASE_URL is missing - All missing vars reported in a single error message - Unit test mocks process.exit and verifies behavior - Normal startup unaffected when vars are set --- *Generated by CEO Planner (priority: 2)*
Author
Owner

Closing as duplicate of #114, which is the canonical env var validation issue.

Closing as duplicate of #114, which is the canonical env var validation issue.
pook closed this issue 2026-04-08 21:32:08 -04:00
Author
Owner

Duplicate of #114 (env var validation).

Duplicate of #114 (env var validation).
Author
Owner

Closed: housekeeping batch via #154.

Closed: housekeeping batch via #154.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot#112
No description provided.