Repository navigation
fix(deploy): healthcheck must probe the open /health endpoint (accounts lockdown) - #46
Merged
Merged
Conversation
The accounts lockdown puts every /api/* route behind a login, so the existing healthcheck (`curl -f http://localhost:4688/api/artists`) now gets 403 and Docker reports the container UNHEALTHY even though the app is fine. Probe /health instead — the always-open liveness endpoint (also exempted in Open_PATHs by the accounts guard). Both places are fixed: the image-level HEALTHCHECK in the Dockerfile and the compose healthcheck. New regression test asserts every container health probe targets /health and never a login-gated /api/ route.
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.
Problem (found during post-merge live verification)
The accounts lockdown (merged #45) gates every
/api/*route behind a login. The container healthcheck probedhttp://localhost:4688/api/artists, which now returns 403, so a freshly deployed container reports unhealthy even though the app is running perfectly:Fix
Probe
/health— the always-open liveness endpoint (app.py/health, and it is in the accounts guard's open-path list):Dockerfile: image-levelHEALTHCHECK→/healthdocker-compose.yml:healthcheck.test→/healthBoth carry a comment explaining why
/api/*must not be probed.Regression test
tests/architecture/test_accounts_first_run.py::test_container_healthcheck_probes_an_open_endpoint— asserts every container health probe in the Dockerfile and compose targets/healthand never a login-gated/api/route.Verification
--health-cmd "curl -f http://localhost:4688/health") and reports healthy; this PR makes the baked-in healthcheck correct so no override is needed.