Skip to content

ci: install the PostgreSQL 18 client for database tests - #3466

Merged
Quick104 merged 2 commits into
mainfrom
ci/pg18-client
Nov 4, 2026
Merged

Quick104 merged 2 commits into
mainfrom
ci/pg18-client

Conversation

@Quick104

@Quick104 Quick104 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

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_dump and pg_restore. pg_dump refuses to dump a newer server, so every test that takes a backup fails with pg_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.yml always runs the copy of trusted-linux-ci.yml on main, so the client install has to land on main first.

This change installs postgresql-client-18 in 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_dump already runs.

The version 16 client stays on PATH. The stack's backup.FindTools looks in every /usr/lib/postgresql/<major>/bin and uses the highest major, so it finds 18 without a PATH change.

Once this merges, the stack drops its copy of the step.

Validation

  • This PR's CI runs main's copy of the trusted workflow, so it does not run the new step. The step first runs on the push to main after merge, which also saves the package cache.
  • actionlint 1.7.12 with .github/actionlint.yaml, including ShellCheck on the step: clean.
  • ci-tools Python tests: 49 passed.
  • 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.
  • The step's script, taken from the workflow file, ran in fresh ubuntu:24.04 containers (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 case pg_dump --version and pg_restore --version reported 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.
  • Not tested on self-hosted silo-linux runners, which ci.yml does 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.org and apt.postgresql.org on a cache miss, and on main until 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 needs ubuntu.sources, gpg, and sudo, as the libvips install does.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
  • The Evidence section shows every change a user can see, or says there is none.

AI Disclosure

  • Harness: T3 Code (Claude Code harness)
  • Tool(s): Claude Code
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: n/a

🤖 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_dump for PostgreSQL 18 is already present.

  • Hosted runners restore cached .deb files keyed on PostgreSQL major version, runner OS, and architecture, and save them after non-PR builds on cache misses.
  • Behavioral Change: database test jobs now run against the PostgreSQL 18 client instead of whatever the runner image ships.

Macroscope summarized af93453.

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-triage silo-triage Bot added the size/M 50–199 added + deleted lines (all files); change volume, not priority. label Nov 3, 2026
@silo-kody

silo-kody Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌
⚠️ 4 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Preserve optional store capabilities through production wrappers
  • Detach mandatory cleanup from request cancellation and bound its lifetime
  • Preserve durable media identity and share identity-evidence precedence
  • Bound decoder throughput trades and share direct-play eligibility

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-03T20:51:05.340957Z
We couldn’t complete this review. Comment @codex review to try again.
21ccb45 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The go-db-pins job now checks for PostgreSQL 18 client tools and installs them when needed. Hosted runners can restore and save a package cache. The installation step verifies the PGDG signing-key fingerprint before using that package source.

Changes: PostgreSQL 18 client provisioning

Layer / File(s) Summary
Client selection, installation, and caching
.github/workflows/trusted-linux-ci.yml
The job documents the client requirement and checks for an existing PostgreSQL 18 pg_dump. If unavailable, it tries cached packages on hosted runners, verifies the PGDG signing-key fingerprint, installs postgresql-client-18, and checks the client. It saves packages on hosted runners when the event is not a pull request and the cache was not restored.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Suggested reviewers: darthshadow

Merge Risk: Minimal · up to af934

The job adds client provisioning and its external dependencies, but no merge-blocking failure was established.

Architecture risk: Low · up to af934

The changed surface does not map to a changed system, dependency edge, entrypoint, or external dependency.

Changed systems: None identified.

Architecture concerns
No architecture-level concerns identified.

Review details

Before / after behavior

  • observed — Modified behavior in .github/workflows/trusted-linux-ci.yml: Adds documentation that the backup tests require a PostgreSQL client at least as new as the PostgreSQL 18 server and describes the package-source and caching policy.
  • observed — Modified behavior in .github/workflows/trusted-linux-ci.yml: Adds a GitHub-hosted-only cache key and restore step for PostgreSQL 18 client packages, keyed by runner image and architecture.
  • observed — Modified behavior in .github/workflows/trusted-linux-ci.yml: Adds installation logic that skips when PostgreSQL 18’s pg_dump is already available; otherwise it tries cached packages on hosted runners, then configures Ubuntu and PGDG sources and installs the client. It verifies the downloaded key contains exactly the published PGDG primary-key fingerprint, failing before repository configuration if the fingerprint differs, and checks pg_dump after installation.
  • observed — Modified behavior in .github/workflows/trusted-linux-ci.yml: Adds saving the PostgreSQL client package cache on GitHub-hosted non-PR runs when the restore did not hit.
Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title "ci: install the PostgreSQL 18 client for database tests" matches the main change: the diff adds a workflow step that installs postgresql-client-18 in the Go DB pins job. It is short, specif…
Description check Passed The description states the problem (the runner ships pg_dump 16 while the job tests against PostgreSQL 18), the approach (a PGDG install step with fingerprint verification, a skip condition, and per-r…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "ci: install the PostgreSQL 18 client for database tests" matches the main change: the diff adds a workflow step that installs postgresql-client-18 in the Go DB pins job. It is short, specific, and follows the conventional-commit style. It omits the caching and fingerprint checks, which is expected for a title.

Full details: Description check

Explanation

The description states the problem (the runner ships pg_dump 16 while the job tests against PostgreSQL 18), the approach (a PGDG install step with fingerprint verification, a skip condition, and per-runner-image caching), validation steps, and risks. It matches the workflow change described in the summary, so it is clearly related to the changeset.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2216d0d6-0007-4761-8949-4a419f3c18d0
Commits

Reviewing files that changed from the base of the PR and between 21ccb45 and af93453.

Files selected for processing: 1
  • .github/workflows/trusted-linux-ci.yml

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

@silo-triage silo-triage Bot added bug Something isn't working priority: P1 Core-path bug; painful workaround — next after P0 labels Nov 3, 2026
Comment thread .github/workflows/trusted-linux-ci.yml Resolved
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

silo-kody Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌
⚠️ 4 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Preserve optional store capabilities through production wrappers
  • Detach mandatory cleanup from request cancellation and bound its lifetime
  • Preserve durable media identity and share identity-evidence precedence
  • Bound decoder throughput trades and share direct-play eligibility

@Quick104
Quick104 merged commit c0e9f8f into main Nov 4, 2026
30 checks passed
@Quick104
Quick104 deleted the ci/pg18-client branch November 4, 2026 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: P1 Core-path bug; painful workaround — next after P0 size/M 50–199 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant