Implement readiness checks for required API dependencies#1581
Open
Chigybillionz wants to merge 6 commits into
Open
Implement readiness checks for required API dependencies#1581Chigybillionz wants to merge 6 commits into
Chigybillionz wants to merge 6 commits into
Conversation
Collaborator
|
@Chigybillionz fix conflict |
Author
Chigybillionz
force-pushed
the
readiness-cjeck
branch
from
July 20, 2026 12:46
0f28b63 to
334010a
Compare
Chigybillionz
force-pushed
the
readiness-cjeck
branch
from
July 20, 2026 19:27
e97fe3c to
b25bdba
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.
Closes #1515
Summary of the issue
The API exposed a health endpoint, but it only reported that the process could respond. A live process could still be unable to serve traffic if required API dependencies such as storage or Cloudflare bindings were missing or unavailable.
Root cause
GET /api/v1/healthreturned a static success payload and did not define separate liveness and readiness semantics. It also did not probe required production dependencies, enforce bounded dependency check timeouts, or guarantee sanitized readiness output.Solution implemented
Separated liveness from readiness within the existing health route:
GET /api/v1/healthremains a liveness check and does not depend on external systems.GET /api/v1/health?check=readinessperforms required dependency readiness checks.Key changes made
checkApiReadinesshelper for testable readiness checks.503when readiness fails.Trade-offs or considerations
The readiness check uses lightweight read-only probes so it can verify dependency availability without mutating production data. Dependency failures are intentionally sanitized, so operators get a clear component-level status without exposing internal configuration or connection details.
Testing steps
Run unit tests:
npm test -- tests/unit/api/health.test.tscurl -i http://localhost:8080/api/v1/health
curl -i "http://localhost:8080/api/v1/health?check=readiness"
Please kindly review this task. If there are any corrections, improvements, adjustments, or merge conflicts that you notice regarding my implementation, I'd really appreciate your feedback. I'd also love to hear your overall review of my work on this branch.Thank you!