Follow-up from the review of #286. Non-blocking; #286 intentionally kept the fix consistent with the existing per-job copies.
The PostgreSQL readiness wait (ready=0 flag loop + timeout diagnostic + docker logs dump) is duplicated across roughly eight jobs in .github/workflows/ci.yml, differing only in the container name. The original bug #286 fixed (a dead || { ...; exit 1; } branch) spread to four jobs precisely because this logic was copy-pasted; eight divergent copies invite the same drift the next time the wait logic changes.
Extract the wait into a single parameterized helper invoked from each job — either:
scripts/wait-for-pg.sh <container> [timeout_seconds] (shell style per CLAUDE.md: set -Eeuo pipefail, 2-space indent, quoted expansions), or
- a composite action with a
container input.
All jobs should call the shared helper; behavior (30 s timeout, diagnostic message, docker logs on failure) stays identical. Verify by stubbing docker locally for both the success and never-ready paths, as done in #286's PR body.
Origin: review comment on #286. Related: #283 finding D1.
Follow-up from the review of #286. Non-blocking; #286 intentionally kept the fix consistent with the existing per-job copies.
The PostgreSQL readiness wait (
ready=0flag loop + timeout diagnostic +docker logsdump) is duplicated across roughly eight jobs in.github/workflows/ci.yml, differing only in the container name. The original bug #286 fixed (a dead|| { ...; exit 1; }branch) spread to four jobs precisely because this logic was copy-pasted; eight divergent copies invite the same drift the next time the wait logic changes.Extract the wait into a single parameterized helper invoked from each job — either:
scripts/wait-for-pg.sh <container> [timeout_seconds](shell style per CLAUDE.md:set -Eeuo pipefail, 2-space indent, quoted expansions), orcontainerinput.All jobs should call the shared helper; behavior (30 s timeout, diagnostic message,
docker logson failure) stays identical. Verify by stubbingdockerlocally for both the success and never-ready paths, as done in #286's PR body.Origin: review comment on #286. Related: #283 finding D1.