fix(selfhost): gate gittensory's depends_on on postgres/pgbouncer health#2546
Conversation
gittensory's depends_on only gated on redis and qdrant, never postgres or pgbouncer, even though --profile postgres/--profile pgbouncer are documented first-class deployment modes. On a cold Postgres volume, compose started gittensory in parallel with postgres initdb instead of waiting for the healthcheck; the app's own waitForPostgres() fallback (~30s hard cap) commonly lost that race on a slow disk/first pull, crash-looping the app via restart: unless-stopped before Postgres was reachable. Add postgres/pgbouncer to depends_on with condition: service_healthy, required: false (mirroring the existing qdrant entry), and give pgbouncer a pg_isready healthcheck so there's an actual readiness signal to gate on -- it had none, so nothing could depend on it even conceptually. required: false keeps the default (no-profile) SQLite path unaffected.
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-02 09:11:10 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 6 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2546 +/- ##
==========================================
+ Coverage 95.95% 95.97% +0.01%
==========================================
Files 226 228 +2
Lines 25423 25709 +286
Branches 9244 9349 +105
==========================================
+ Hits 24395 24674 +279
- Misses 417 425 +8
+ Partials 611 610 -1 🚀 New features to boost your workflow:
|
Summary
gittensory'sdepends_onindocker-compose.ymlonly gated onredisandqdrant, neverpostgresorpgbouncer, even though--profile postgres/--profile pgbouncerare documented first-class deployment modes. On a cold Postgres volume, compose startedgittensoryin parallel withpostgresinitdb instead of waiting for the healthcheck; the app's ownwaitForPostgres()fallback (~30s hard cap) commonly lost that race on a slow disk/first pull, crash-looping the app viarestart: unless-stoppedbefore Postgres was reachable.pgbouncerhad nohealthcheck:block at all, so there was no readiness signal to gate on even conceptually.postgres/pgbouncertogittensory'sdepends_onwithcondition: service_healthy, required: false(mirroring the existingqdrantentry —required: falsekeeps the default no-profile SQLite path unaffected), and gavepgbouncerapg_isready-based healthcheck (same approachpostgresitself uses — verified locally against a runningedoburu/pgbouncercontainer thatpg_isreadyreports "accepting connections" purely from the pooler accepting the startup packet, independent of whether the upstream Postgres is reachable, which is the correct pooler-layer liveness signal).docker compose --profile postgres --profile pgbouncer config(and the full profile combination) — both parse clean.Closes #2500. Closes #2503.
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally — this is adocker-compose.yml/test/**change with nosrc/**lines, so it carries no Codecov patch obligation; the new structural YAML assertions pass.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateSafety
UI Evidencesection below — N/A, no UI changes.Notes