Skip to content

feat: add deploy_health handler with DB, Redis caching, and tests#307

Open
malik203 wants to merge 1 commit into
benelabs:mainfrom
malik203:feature/deploy-health
Open

feat: add deploy_health handler with DB, Redis caching, and tests#307
malik203 wants to merge 1 commit into
benelabs:mainfrom
malik203:feature/deploy-health

Conversation

@malik203
Copy link
Copy Markdown

feat: add deploy health handler

Adds GET/POST/PATCH endpoints for tracking contract deployment health, backed by PostgreSQL
and Redis.

Changes

  • migrations/20260527000000_deployments.sql — new deployments table (contract_id, version,
    status, error_message, metadata, timestamps)

  • src/api/handlers/deploy_health.rs — four handlers:

    • POST /api/v1/deployments — register a deployment (starts as pending)
    • GET /api/v1/deployments/:id — fetch by UUID (Redis-cached, 30s TTL)
    • GET /api/v1/deployments/contract/:contract_id — list all deployments for a contract
      (cached)
    • PATCH /api/v1/deployments/:id/status — update health status (pending | healthy | degraded
      | failed), invalidates cache
  • src/api/handlers/mod.rs — registers the new module

  • README.md — documents the new endpoints

Testing

13 unit tests covering status parsing, serde roundtrips, request deserialization, and input
validation. No external services required to run the unit tests.
closes #181

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 27, 2026

@malik203 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

[Backend] 10.7 Add Deployment Health Checks

1 participant