Skip to content

feat: add health endpoint at GET /api/health#1065

Merged
perber merged 1 commit into
mainfrom
feat/health-endpoint
May 29, 2026
Merged

feat: add health endpoint at GET /api/health#1065
perber merged 1 commit into
mainfrom
feat/health-endpoint

Conversation

@perber
Copy link
Copy Markdown
Owner

@perber perber commented May 29, 2026

Adds a lightweight health check endpoint that verifies SQLite connectivity, the data directory, and search index status. Returns 200 OK with check details or 503 if degraded. No authentication required. Prometheus dependency removed.

Includes e2e tests for the health endpoint.

Copilot AI review requested due to automatic review settings May 29, 2026 12:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a lightweight unauthenticated health check endpoint (GET /api/health) to report basic system readiness (SQLite/search, storage directory, and search indexing status) and backs it with a Playwright e2e test.

Changes:

  • Register new health routes in the main wiki router and implement /api/health response shape/status codes (200 vs 503).
  • Add search status helpers (IsFailed/IsReady) and a SQLiteIndex.Ping() method used by the health check.
  • Add e2e coverage for the health endpoint (and a small local e2e runner tweak).

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal/wiki/wiki.go Wires the new health route registrar into the Wiki router construction/registration.
internal/wiki/importer/use_cases.go Minor import ordering adjustment.
internal/wiki/health/use_cases.go Implements health checks (sqlite ping, storage dir existence, search indexing status).
internal/wiki/health/routes.go Exposes GET /api/health and maps health result to HTTP 200/503 JSON response.
internal/wiki/auth/use_cases.go Formats NewLoginUseCase as a multi-line function body.
internal/search/sqlite_index.go Adds Ping() on the SQLite search index.
internal/search/indexing_status.go Adds IsFailed() and IsReady() helpers for indexing state.
e2e/tests/health.spec.ts Adds Playwright tests validating health endpoint behavior and unauthenticated access.
e2e/run.sh Adjusts an argument indentation in local e2e startup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/search/sqlite_index.go
Comment thread internal/wiki/health/use_cases.go Outdated
@perber perber force-pushed the feat/health-endpoint branch from d66a116 to 027667a Compare May 29, 2026 12:14
Adds a lightweight health check endpoint that verifies SQLite
connectivity, the data directory, and search index status.
Returns 200 OK with check details or 503 if degraded.
No authentication required. Prometheus dependency removed.

Includes e2e tests for the health endpoint.
@perber perber force-pushed the feat/health-endpoint branch from 027667a to 5c3953f Compare May 29, 2026 12:14
@perber perber linked an issue May 29, 2026 that may be closed by this pull request
@perber perber merged commit a9707af into main May 29, 2026
8 checks passed
@perber perber deleted the feat/health-endpoint branch May 29, 2026 12:48
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.

add /api/health endpoint

2 participants