Skip to content

ci: wait for the init server to finish before the security checks - #21

Merged
devin-ai-integration[bot] merged 1 commit into
mainfrom
fix/verify-wait-for-init
Nov 17, 2026
Merged

devin-ai-integration[bot] merged 1 commit into
mainfrom
fix/verify-wait-for-init

Conversation

@pyramation

@pyramation pyramation commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The image's entrypoint runs a temporary server during initdb, then stops it and starts the real one. The verify steps waited only on pg_isready, which can succeed against the temporary server; a check then ran in the gap and failed with connection 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 complete in the container log, then for pg_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

Devin Review

@devin-ai-integration

Copy link
Copy Markdown

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@luxor-code-review

luxor-code-review Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Review complete. 🟡 1 medium

💬 Inline comments (1)

🧹 Nitpicks (1) — 🟢 1 low
  • 🟢 Duplicated verify block will drift (docker.yml:88) — The identical docker run + wait + three verify-*-security.sh invocations are copy-pasted into the PR gate (.github/workflows/docker.yml:88-97) and the push gate (.github/workflows/docker.yml:116-125); the comment at lines 81-85 even notes the two gates must stay in lockstep.

This PR introduces container-level security verification into .github/workflows/docker.yml: each gate now runs the freshly built PostGIS image, waits for PostgreSQL to finish its init process, and executes the repository's three verify-*.sh security checks against it before the image is trusted. The same verification is wired into both the pull-request build and the pushed-digest job, with a comment noting the two blocks must stay in lockstep.

Files Change
.github/workflows/docker.yml Adds a docker run postgis-verify step plus wait loops and verify-*.sh invocations to both the PR gate and the push/manifest gate.

Not reviewed: no other files were changed.

Reviewed commit: ff5e600

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@luxor-code-review luxor-code-review Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines +93 to 94
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

@devin-ai-integration
devin-ai-integration Bot merged commit 295c2ec into main Nov 17, 2026
7 checks passed
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.

1 participant