ci(pg19): one-command smoke harness — live verification of every Phase 3 tool#143
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a local smoke test harness for PostgreSQL 19 readiness, consisting of documentation updates, a Python script (smoke_test_pg19.py) to run probes and writes, and a bash launcher (smoke_test_pg19.sh) to manage the test container. Key feedback includes handling potential ImportError exceptions for the unimplemented pg19_runtime module, moving the database connection call inside the try block to guarantee proper resource cleanup on failure, and adding a pre-flight Docker check along with an EXIT trap in the bash script to ensure reliable container teardown.
…e 3 tool
User direction: "can we install postgresql 19 beta1 for live testing
our functionality?" — Docker daemon isn't available in the Claude
Code sandbox, so this lands a one-command harness operators can run
locally instead.
What lands:
scripts/smoke_test_pg19.sh — bash launcher that:
- Builds the existing .github/ci-postgres-pg19.Dockerfile
- Starts mcpg-pg19-smoke on port 5443 (no clash with PG 14-18)
- Runs the Python smoke driver
- Tears down the container (unless --keep)
- Supports --down for cleanup only
scripts/smoke_test_pg19.py — Python driver that exercises every
Phase 3 tool against the live server:
- All 6 status probes (PGQ / REPACK / AIO / pg19_stats /
checksums / logical replication) — printed as a capability
matrix
- 4 read-only advisors / readers (recommend_io_method,
analyze_lock_hotspots, read_pg_stat_lock, read_pg_stat_recovery,
list_property_graphs)
- 2 representative writes (enable_logical_replication_on_demand,
enable_data_checksums) — gated on the corresponding status
probe so the smoke completes cleanly on Beta builds that
haven't shipped every feature yet
docs/plans/pg19-readiness.md — "Local testing" section restructured
to feature the harness as the recommended path.
Pure tooling — no production code changes; no impact on existing
tests, snapshots, or contracts. Operators run this manually whenever
they want to verify a Phase 3 tool against an actual PG 19 server,
and the GA-day-0 verification milestone (documented earlier in
docs/plans/pg19-readiness.md) becomes "run this script and read the
output".
… reviews) Three independent critical reviews on PR #143: 1. scripts/smoke_test_pg19.py: database.connect() lived outside the try/finally, so a connection failure (slow container start, auth mismatch, etc.) raised an unhandled exception and skipped the close() cleanup. Moved inside the try block. 2. scripts/smoke_test_pg19.sh: no preflight check for the Docker daemon. With `set -e` active, calling `docker rm` on a missing daemon blew up inside the `down()` helper with a cryptic error. Added an explicit `docker info` probe that bails with a friendly message before doing anything else. 3. scripts/smoke_test_pg19.sh: if the Python smoke run crashed, the explicit `down` at the bottom never fired and left the container running on port 5443. Switched to an EXIT trap that respects $KEEP — single-entry cleanup path that fires regardless of how the script exits (success / failure / interrupt). Removed the redundant trailing `down` call. Two earlier gemini comments (the `pg19_runtime` import guards) are moot now that PR #142 (the runtime-toggles module) has landed — the imports succeed on the rebased branch.
a24f3f1 to
3cc7d90
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
User direction: "can we install postgresql 19 beta1 for live testing our functionality?" — Docker daemon isn't available in the Claude Code sandbox, so this PR lands a one-command harness operators can run locally to spin up PG 19, exercise every Phase 3 tool against the live server, and tear down.
What lands
scripts/smoke_test_pg19.sh.github/ci-postgres-pg19.Dockerfile, starts a container on port 5443 (no clash with PG 14-18), runs the Python driver, tears down. Supports--keep(leave container running) and--down(cleanup only). Idempotent — re-run anytime.scripts/smoke_test_pg19.pyenable_logical_replication_on_demand,enable_data_checksums), all gated on the corresponding status probe so the smoke completes cleanly on Beta builds that haven't shipped every feature yet.docs/plans/pg19-readiness.mdUsage
What it prints
A capability matrix first:
Then per-tool JSON output for every probe + advisor + safe write.
Why this is the right shape
scripts/; never imported bymcpg.*.docs/plans/pg19-readiness.md— "run this script and read the output" becomes the canonical verification flow once PG 19 hits GA.Test plan
ruff check scripts/smoke_test_pg19.py— clean.python -c "import scripts.smoke_test_pg19"— imports cleanly.scripts/smoke_test_pg19.shon a workstation with Docker. (Can't be automated from CI without a Docker-in-Docker setup; the launcher itself stays a local-dev / GA-verification tool.)🤖 Generated with Claude Code
https://claude.ai/code/session_0122yLZLJ8t4W43sdN6BmTZc
Generated by Claude Code