feat: add health endpoint at GET /api/health#1065
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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/healthresponse shape/status codes (200 vs 503). - Add search status helpers (
IsFailed/IsReady) and aSQLiteIndex.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.
d66a116 to
027667a
Compare
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.
027667a to
5c3953f
Compare
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.
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.