Skip to content

build(postgres): rebuild weekly instead of bumping pins - #250

Merged
vishr merged 2 commits into
mainfrom
build/simplify-postgres-updates
Nov 29, 2026
Merged

vishr merged 2 commits into
mainfrom
build/simplify-postgres-updates

Conversation

@vishr

@vishr vishr commented Nov 29, 2026

Copy link
Copy Markdown
Member

What this changes

This replaces the weekly pin-bump pull request (#248, #249) with a weekly rebuild:

  • Dockerfile: follows postgres:18-trixie and debian:trixie-slim by tag, and installs the pgdg extensions without version pins. WAL-G, pgvector and pgvectorscale stay pinned by checksum or commit.
  • postgres-image.yml:
    • Runs every Monday at 05:00 UTC, in addition to the existing push and manual triggers.
    • Scheduled and manual runs build with no-cache; a cached apt layer would hide every package update. They still write the cache, so the next push stays fast.
    • Each runner verifies the image by the digest it just pushed.
    • Tags include the run ID (18-<sha>-<run_id>), so a weekly rebuild of the same commit never overwrites an earlier image, and every published image stays a rollback target.
    • Publishes queue instead of cancelling each other (cancel-in-progress: false).
    • A scheduled run publishes :18 only if the SBOM package list differs from the published :18, so an unchanged rebuild never restarts Postgres on a host. The run summary shows the package diff, which replaces the bump PR as the record of what changed.
  • Removed: postgres-bump.sh, postgres-image-bump.yml, and the github-actions[bot] CLA allowlist entry.

Why this is correct

  • Fable reviewed the plan independently. It confirmed the approach and flagged the stale-cache, tag-overwrite and same-commit race problems; this PR fixes all three. It also suggested the publish-only-when-changed check.
  • The SBOM comparison, tested against published images:
  • The unpinned Dockerfile builds locally (arm64) and passes postgres-verify.sh.
  • just check passes. actionlint passes, and shellcheck passes on every run block.

The schedule and the publish-only-when-changed path can first run after merge. Merging also runs a push build, which publishes, because a push always publishes.

Effect on the safety envelope

PostgreSQL minor releases and pgdg extension updates now reach hosts that follow :18 within a week, without a pull request, each time behind the per-platform verify step. Services with backups on are unaffected: they run a pinned digest and change only through a refresh candidate (internal/app/service_image_state.go:116). No change to ob.

Checklist

  • just check passes locally.
  • Tests cover the new behaviour, including the failure paths. (CI-only change; verified as above.)
  • Generated documentation is current (just check verifies this).
  • I have accepted the CLA, or will when the bot asks on my first pull request.

🤖 Generated with Claude Code

vishr and others added 2 commits November 29, 2026 07:05
Exact apt pins go stale because apt.postgresql.org drops old builds, and
keeping them current needed a bump script, a bot pull request, a token
workaround, and a CLA exception. That is more machinery than a two-host
alpha needs.

Follow postgres:18-trixie and the current pgdg packages instead, and
rebuild every Monday. Scheduled and manual runs skip the layer cache so
package updates actually land, verify both platforms as before, and
publish :18 only when the SBOM package list differs from the published
image, so an unchanged rebuild never restarts Postgres on a host. The
summary shows the package diff that replaces the bump pull request.

Each run tags its images with the run ID, so a rebuild of the same
commit never overwrites an earlier image and every publish stays a
rollback target. Publishes now queue instead of cancelling each other.
WAL-G, pgvector, and pgvectorscale stay pinned by checksum or commit.

Remove postgres-bump.sh, postgres-image-bump.yml, and the
github-actions[bot] CLA allowlist entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Resolve the postgres:18-trixie digest once and build both platforms
  on it, labelled with org.opencontainers.image.base.digest.
- Count a changed base digest as a change, not only changed packages.
- Refuse to publish when amd64 and arm64 differ in PostgreSQL or
  extension packages.
- Fail closed when the published image's SBOM cannot be read.
- Drop the layer cache: a cached apt layer hid updates and let a push
  roll packages back. Native builds take a few minutes.
- Gate manual runs like scheduled ones; only a push always publishes.
- Add run_attempt to the run tag so a re-run never overwrites an image
  that may already be promoted.
- Correct the concurrency comment and drop an unused env variable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vishr
vishr merged commit 1cd9e3e into main Nov 29, 2026
6 checks passed
@vishr
vishr deleted the build/simplify-postgres-updates branch November 29, 2026 15:14
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