Repository navigation
ci: install the PostgreSQL 18 client for database tests - #3466
Conversation
The Go DB pins job runs the database tests in db-contracts.txt against a pgvector/pgvector:pg18 server, and the hosted runner's pg_dump and pg_restore are version 16, which refuse to dump a newer server. Install postgresql-client-18 from PGDG in that job, with the signing key checked against its published fingerprint and trusted for that source only, and cache the packages per runner image as the libvips install does. The step does nothing when the client is already installed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
apt trusts every key in a Signed-By file, and the fingerprint check read only the first key, so a file with PGDG's key followed by another passed. Check every primary key's fingerprint and require exactly PGDG's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Problem
Related issue: N/A
Validation tasks: none
The Go DB pins job runs its database tests against a PostgreSQL 18 server, but the hosted runner ships the version 16
pg_dumpandpg_restore. pg_dump refuses to dump a newer server, so every test that takes a backup fails withpg_dump is older than the database server: pg_dump 16, server 18; install postgresql-client-18. This blocks the backups stack (#3397–#3402): about 30 of its tests, including the full backup and restore round trip, have never passed in CI, and Go DB pins is red on all six PRs. The stack can't fix this itself.ci.ymlalways runs the copy oftrusted-linux-ci.ymlonmain, so the client install has to land onmainfirst.This change installs
postgresql-client-18in the Go DB pins job.Approach
Only Go DB pins needs the client. It is the only job that runs
scripts/ci/db-contracts.txt, where the stack lists its backup tests. Go integration and Go DB external auth run fixed test lists with no backup tests.The install follows the libvips step. apt reads only the official Ubuntu sources plus PGDG. The PGDG source lives in its own directory, so other apt commands in the job don't see it. The PGDG key file must hold exactly one primary key, matching the published fingerprint, and is trusted only for that source through
Signed-By. On GitHub-hosted runners the downloaded packages are cached per runner image. The step skips when/usr/lib/postgresql/18/bin/pg_dumpalready runs.The version 16 client stays on PATH. The stack's
backup.FindToolslooks in every/usr/lib/postgresql/<major>/binand uses the highest major, so it finds 18 without a PATH change.Once this merges, the stack drops its copy of the step.
Validation
main's copy of the trusted workflow, so it does not run the new step. The step first runs on the push tomainafter merge, which also saves the package cache..github/actionlint.yaml, including ShellCheck on the step: clean.make verify-actionlint,verify-shellcheck,verify-local-paths,verify-case-collisions,verify-bidi,verify-size-ratchet: pass. No Go or web files changed, so the Go and web build and test targets were not run.ubuntu:24.04containers (x86_64) prepared like the hosted image, with the version 16 client installed. A cold install took 4 s and a cache hit 3 s; a rerun skipped. In every casepg_dump --versionandpg_restore --versionreported 18.6. A key file holding a different key, or the PGDG key plus a second one, failed the step before it wrote a key or source.silo-linuxrunners, whichci.ymldoes not use today.Evidence
No user-visible change. The evidence page has the container output and check results.
Evidence: https://evidence.siloserver.org/r/silo-server/pr-3466/
Risks
The job now depends on
www.postgresql.organdapt.postgresql.orgon a cache miss, and onmainuntil the first cache save. If PGDG rotates its signing key, the fingerprint check fails the job and the expected fingerprint needs updating. On a self-hosted runner without PostgreSQL 18, the step needsubuntu.sources,gpg, andsudo, as the libvips install does.Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Install PostgreSQL 18 client in CI with package caching
Adds a workflow step in trusted-linux-ci.yml that installs the PostgreSQL 18 client from the PGDG apt repository, verifying the repository key fingerprint first. The step skips installation when
pg_dumpfor PostgreSQL 18 is already present..debfiles keyed on PostgreSQL major version, runner OS, and architecture, and save them after non-PR builds on cache misses.Macroscope summarized af93453.