Skip to content

fix: use redis_url instead of nonexistent redis_host/redis_port in health check#175

Open
grod718 wants to merge 5 commits into
ascherj:mainfrom
grod718:fix/155-redis-host-config
Open

fix: use redis_url instead of nonexistent redis_host/redis_port in health check#175
grod718 wants to merge 5 commits into
ascherj:mainfrom
grod718:fix/155-redis-host-config

Conversation

@grod718

@grod718 grod718 commented Jul 16, 2026

Copy link
Copy Markdown

Summary

Fixes the /health endpoint's Redis check, which referenced nonexistent settings.redis_host/settings.redis_port fields, causing it to silently report Redis as unhealthy on every request regardless of Redis's actual status.

Issue

Closes #155

Changes

  • Replaced redis.Redis(host=settings.redis_host, port=settings.redis_port, ...) with redis.Redis.from_url(settings.redis_url, ...) in api/routes/health.py, matching the only Redis config field that actually exists on Settings
  • Added tests/unit/test_health_routes.py — the first route-level test in this codebase, covering both the healthy and genuinely-unhealthy Redis paths

Testing

  • Unit tests pass (make test-unit) — confirmed via git stash comparison that this PR introduces zero new failures; the 53 pre-existing failures in the suite are unrelated to this change (see JOURNAL.md for details)
  • Integration tests pass — not run, no integration tests apply to this change
  • Linter passes (make lint) — pre-existing ruff warning on the untouched Depends(get_db) default-argument pattern in this file; not introduced by this PR
  • Type checker passes (make typecheck) — pre-existing mypy debt across many unrelated files in this codebase (see JOURNAL.md); this PR introduces zero new mypy errors in files it touches
  • New/updated tests cover the changes

Screenshots / Demo

curl http://localhost:8000/health before: "redis":"unhealthy" — after: "redis":"healthy" (Redis genuinely healthy the whole time, confirmed via docker compose ps).

Notes for Reviewers

This codebase currently has significant pre-existing test and type-check debt unrelated to this change (documented in JOURNAL.md) — I verified via git stash that none of it is introduced by this PR. Happy to discuss if there's a preferred way to handle the make check/pre-commit gate given this.

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.

Health check references settings.redis_host, which does not exist on Settings

1 participant