Skip to content

fix(selfhost): retry the /ready probe in selfhost-post-update-check.sh instead of a single attempt - #5086

Merged
JSONbored merged 1 commit into
mainfrom
fix/5085-post-update-check-retry
Jul 11, 2026
Merged

fix(selfhost): retry the /ready probe in selfhost-post-update-check.sh instead of a single attempt#5086
JSONbored merged 1 commit into
mainfrom
fix/5085-post-update-check-retry

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • `docker compose up -d` returns as soon as the container starts, well before the app inside has finished booting and bound its port — a single immediate `curl -sf` reliably false-failed on a completely normal deploy. Hit twice today deploying today's other fixes.
  • The `gittensory` service's own Docker healthcheck (`docker-compose.yml`) already documents and tolerates exactly this: `start_period: 60s` "tolerates the Postgres cold start." `selfhost-post-update-check.sh` had no equivalent tolerance.
  • Replaced the single probe with a bounded retry loop (default 45 × 2s = 90s, over the documented 60s `start_period`), configurable via `SELFHOST_READY_RETRIES`/`SELFHOST_READY_RETRY_DELAY_SECONDS`.

Closes #5085

Scope

Validation

  • `git diff --check`
  • `bash -n` + `shellcheck` clean (only a pre-existing, unrelated SC1091 info note on the sourced lib file)
  • `npm run typecheck`
  • Ran the 3 existing test files that reference this script (`docs-selfhost-update-rollback.test.ts`, `docs-selfhost-git-deploy-hygiene.test.ts`, `selfhost-update-script.test.ts`) — all pass unchanged.
  • Functionally verified the retry loop against local mock servers: one that returns 503 twice then 200 (succeeds on the 3rd attempt), and one that never responds (exhausts retries, exits non-zero with a clear message).
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries — this is a bash deploy script under `scripts/`, which Codecov's patch gate does not measure (only `src/` is measured); verified via the functional checks above instead of a vitest unit test, matching how the pre-existing tests for this file (stub-based, doc-hygiene) already treat it.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. (N/A.)
  • API/OpenAPI/MCP behavior is updated and tested where needed. (N/A.)
  • UI changes use live API data or real empty/error/loading states. (N/A.)
  • Visible UI changes include a `UI Evidence` section. (N/A — no UI changed.)
  • Public docs/changelogs are updated where needed. (N/A — the operator-facing docs already reference this script by name only, no specific retry-count claim to keep in sync.)

…h instead of a single attempt (#5085)

docker compose up -d returns as soon as the container starts, well
before the app inside has finished booting and bound its port, so a
single immediate curl reliably false-failed on a completely normal
deploy -- hit twice today. The gittensory service's own Docker
healthcheck already documents and tolerates this (start_period: 60s,
"tolerates the Postgres cold start"); the post-update script had no
equivalent tolerance. Retries up to 90s by default (configurable via
SELFHOST_READY_RETRIES/SELFHOST_READY_RETRY_DELAY_SECONDS), verified
against a local mock server that fails twice before succeeding, and
against one that never succeeds (exhausts and exits non-zero).
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.20%. Comparing base (f22516c) to head (60242f3).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5086   +/-   ##
=======================================
  Coverage   94.20%   94.20%           
=======================================
  Files         470      470           
  Lines       39722    39722           
  Branches    14493    14493           
=======================================
  Hits        37421    37421           
  Misses       1645     1645           
  Partials      656      656           
Flag Coverage Δ
shard-1 46.42% <ø> (ø)
shard-2 33.58% <ø> (ø)
shard-3 31.34% <ø> (ø)
shard-4 32.80% <ø> (ø)
shard-5 33.54% <ø> (ø)
shard-6 44.90% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored JSONbored self-assigned this Jul 11, 2026
@JSONbored
JSONbored merged commit 0800f23 into main Jul 11, 2026
16 checks passed
@JSONbored
JSONbored deleted the fix/5085-post-update-check-retry branch July 11, 2026 14:01
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.

selfhost-post-update-check.sh false-fails on a normal deploy: single /ready probe, no retry

1 participant