fix: address review of the Postgres move

- close the pool on SIGTERM before exiting; query_timeout on the pool
- SIGTERM test fails instead of hanging; test cleanup in finally
- preStop sleep so rollouts don't drop form posts; Postgres startupProbe
- CI step timeout, clear error if test Postgres never starts, remove test image
- export stops on SQL errors; README note on changing the DB password

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfmHGGiYUjNcvJoyzdf
This commit is contained in:
ngqileandClaude Opus 5.5 committed 2026-12-01 11:59:55 +08:00
1 parent 20e07e9d80
commit ad5996283e
7 files changed
+42 -14

No files matched your search

@@ -62,4 +62,4 @@ Decision (user, 2026-12-01): move lead storage to Postgres so the team can open
- New dependency: `pg` (node-postgres), pinned exactly. Node has no built-in Postgres client. This ends "zero npm dependencies".
- The app reads `DATABASE_URL`, creates the `leads` table on start if missing, and closes the pool on SIGTERM.
- Tests run against a real Postgres, each run in its own throwaway schema, so they never touch existing tables. CI starts a Postgres container on the DinD daemon and runs the test image against it.
- DBeaver: `kubectl port-forward` to the Postgres service. CSV export via `psql \copy`.
- DBeaver: `kubectl port-forward` to the Postgres service. CSV export via `psql` running `COPY ... TO STDOUT` (docs/export-leads.sql).