Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add separate liveness and readiness checks #5151

Merged
merged 1 commit into from
Feb 21, 2025

Conversation

rolodato
Copy link
Member

This PR adds separate liveness and readiness checks, to be added later in the Helm charts. The existing /health endpoint is maintained with no changes for backwards compatibility.

The liveness check is the same as calling /version, which has no external dependencies. It does check that the filesystem is readable, since the version data is read from the filesystem. This is just testing that the API can respond to requests.

The readiness check is the same as the current /health endpoint, which checks that all migrations have been applied, and the database is available. We add a separate /health/readiness endpoint to make this obvious.

We also modify the api/scripts/healthcheck.py script, which is used by the default Docker Compose setup. Docker Compose health checks should effectively be liveness and not readiness health checks.

Tested manually by making requests to all the endpoints, and confirming there are no warnings about URL namespaces.

@rolodato rolodato requested a review from a team as a code owner February 21, 2025 21:10
@rolodato rolodato requested review from gagantrivedi and removed request for a team February 21, 2025 21:10
Copy link

vercel bot commented Feb 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Feb 21, 2025 9:10pm
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Feb 21, 2025 9:10pm
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Feb 21, 2025 9:10pm

@github-actions github-actions bot added the api Issue related to the REST API label Feb 21, 2025
Copy link
Contributor

github-actions bot commented Feb 21, 2025

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-5151 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-5151 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-5151 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-5151 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-5151 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-5151 Finished ✅ Results

@github-actions github-actions bot added the feature New feature or request label Feb 21, 2025
Copy link
Member

@khvn26 khvn26 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Contributor

github-actions bot commented Feb 21, 2025

Uffizzi Preview deployment-61209 was deleted.

Copy link

codecov bot commented Feb 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.47%. Comparing base (210519e) to head (6641b3d).
Report is 9 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5151   +/-   ##
=======================================
  Coverage   97.46%   97.47%           
=======================================
  Files        1224     1224           
  Lines       42545    42567   +22     
=======================================
+ Hits        41466    41491   +25     
+ Misses       1079     1076    -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants