feat(server): add /api/healthz endpoint with rich health info #20

Merged
arcodange merged 1 commits from feat/healthz-endpoint into main 2026-05-03 12:25:55 +02:00
Owner

Summary

Ajoute un endpoint /api/healthz style Kubernetes retournant un JSON enrichi avec status, version, uptime_seconds et timestamp.

Non-breaking : /api/health existant est préservé tel quel.

Spec

GET /api/healthz HTTP/1.1

Response :

{
  "status": "healthy",
  "version": "1.4.0",
  "uptime_seconds": 1234,
  "timestamp": "2026-05-03T12:34:56Z"
}

Changes

  • pkg/server/server.go : route + handler handleHealthz + struct HealthzResponse + champ startedAt sur Server
  • pkg/server/healthz_test.go : test unitaire (assert HTTP 200 + Content-Type + JSON fields)
  • features/health/health.feature : nouveau scénario BDD pour /api/healthz
  • pkg/bdd/steps/health_steps.go, common_steps.go, steps.go : steps Gherkin associés

Test plan

  • go build ./pkg/server/... passe
  • go test ./pkg/server/... -run TestHandleHealthz passe localement
  • go test ./features/... (BDD) — nécessite Postgres, validé par CI
  • CI globale passe sur la branche

Migration context

Phase 1 ARCODANGE — autonomous run de Mistral Vibe via workspace ICM :
~/Work/Vibe/workspaces/healthz-feature/

Architecture ICM (Jake Van Clief) validée : ~95 % du travail effectué en autonomie par Mistral, avec stages observables sur disque.

🤖 Co-Authored-By: Mistral Vibe (devstral-2 / mistral-medium-3.5)

## Summary Ajoute un endpoint `/api/healthz` style Kubernetes retournant un JSON enrichi avec status, version, uptime_seconds et timestamp. Non-breaking : `/api/health` existant est préservé tel quel. ## Spec ```http GET /api/healthz HTTP/1.1 ``` Response : ```json { "status": "healthy", "version": "1.4.0", "uptime_seconds": 1234, "timestamp": "2026-05-03T12:34:56Z" } ``` ## Changes - `pkg/server/server.go` : route + handler `handleHealthz` + struct `HealthzResponse` + champ `startedAt` sur `Server` - `pkg/server/healthz_test.go` : test unitaire (assert HTTP 200 + Content-Type + JSON fields) - `features/health/health.feature` : nouveau scénario BDD pour `/api/healthz` - `pkg/bdd/steps/health_steps.go`, `common_steps.go`, `steps.go` : steps Gherkin associés ## Test plan - [x] `go build ./pkg/server/...` passe - [x] `go test ./pkg/server/... -run TestHandleHealthz` passe localement - [ ] `go test ./features/...` (BDD) — nécessite Postgres, validé par CI - [ ] CI globale passe sur la branche ## Migration context Phase 1 ARCODANGE — autonomous run de Mistral Vibe via workspace ICM : `~/Work/Vibe/workspaces/healthz-feature/` Architecture ICM (Jake Van Clief) validée : ~95 % du travail effectué en autonomie par Mistral, avec stages observables sur disque. 🤖 Co-Authored-By: Mistral Vibe (devstral-2 / mistral-medium-3.5)
arcodange added 1 commit 2026-05-03 12:25:34 +02:00
Adds a Kubernetes-style healthz endpoint returning status, version,
uptime_seconds and timestamp. Non-breaking — /api/health is preserved.

- New route: GET /api/healthz
- New handler: handleHealthz with HealthzResponse struct
- New unit test: pkg/server/healthz_test.go (passes locally)
- New BDD scenario: features/health/health.feature
- BDD steps: pkg/bdd/steps/health_steps.go, common_steps.go

Note: BDD tests require Postgres and will be validated by CI.

🤖 Co-Authored-By: Mistral Vibe (devstral-2 / mistral-medium-3.5)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
arcodange merged commit 045823ec8e into main 2026-05-03 12:25:55 +02:00
arcodange deleted branch feat/healthz-endpoint 2026-05-03 12:25:56 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: arcodange/dance-lessons-coach#20