Repository navigation
ci: wait for the init server to finish before the security checks - #21
Conversation
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Review complete. 🟡 1 medium 💬 Inline comments (1)
🧹 Nitpicks (1) — 🟢 1 low
This PR introduces container-level security verification into
Not reviewed: no other files were changed. Reviewed commit: ff5e600 |
There was a problem hiding this comment.
Adds a Docker image verification step (PostGIS container init-wait plus three security check scripts) to the PR and push gates of the GitHub Actions workflow.
Key findings
- 🟡 Bound the container init-wait loops — docker.yml:93
| until docker logs postgis-verify 2>&1 | grep -q 'PostgreSQL init process complete'; do sleep 1; done | ||
| until docker exec postgis-verify pg_isready -U postgres -q; do sleep 1; done |
There was a problem hiding this comment.
🟡 bug · medium
Bound the container init-wait loops
The new wait loops at .github/workflows/docker.yml:93 and .github/workflows/docker.yml:121 are unbounded until ...; do sleep 1; done with no iteration cap, and the adjacent pg_isready loops at lines 94 and 122 are likewise unbounded. If the container fails to initialize (e.g. initdb error, bad POSTGRES_PASSWORD, OOM), the log never contains PostgreSQL init process complete, and since an until condition is exempt from set -e/pipefail, the step spins until the GitHub Actions job timeout (default 6 hours). This burns runner minutes and masks the real failure; on the push job it also delays manifest tagging of latest/18.
📋 Prompt for AI Agents
In .github/workflows/docker.yml at lines 93-94 and the duplicate at lines 121-122, replace the unbounded until ...; do sleep 1; done loops (both the docker logs | grep loop and the pg_isready loop) with bounded loops: keep an attempts counter incremented each sleep, and after ~120 attempts (2 minutes) exit 1 while printing docker logs postgis-verify so a failed container init fails the step instead of hanging until the 6-hour job timeout.
Summary
The image's entrypoint runs a temporary server during
initdb, then stops it and starts the real one. The verify steps waited only onpg_isready, which can succeed against the temporary server; a check then ran in the gap and failed withconnection to server on socket ... failed: No such file or directory. That failed the amd64 publish job on main after #19 (run 44194672984; a rerun passed).Both verify steps now first wait for
PostgreSQL init process completein the container log, then forpg_isready.Link to Devin session: https://app.devin.ai/sessions/b173266337744ea581f05064e3d567f4
Open in Devin Desktop: https://app.devin.ai/desktop/session/b173266337744ea581f05064e3d567f4?variant=devin
Requested by: @pyramation
🟢 Devin Review found nothing to fix · View findings