Skip to content

Pull the db-backup image before restore testing; warn about sets from newer versions - #6

Merged
cerebrate merged 1 commit into
masterfrom
fix/restore-test-pull
Oct 31, 2026
Merged

cerebrate merged 1 commit into
masterfrom
fix/restore-test-pull

Conversation

@cerebrate

Copy link
Copy Markdown
Member

What

  • scripts/restore-test.sh pulls the image first. It pulls the db-backup image (default ghcr.io/arkane-systems/db-backup:latest, or --image / $DBBACKUP_IMAGE) before using it. If the pull fails, the script uses the local copy and says so; with no local copy, it stops with an error. --build skips the pull, as before.
  • dbbackup restore-test warns about newer sets. It logs a warning when the set's manifest tool_version is newer than the dbbackup running the test, since such a set may record things this version doesn't check.
  • Docs. The script's --help and the options table in docs/restore.md mention the pull.

Why

docker compose run uses any local copy of an image as is. After 0.3.0 was released and deployed, the first restore test of the new postgres-memlord set ran a cached :latest that was still 0.2.0. 0.2.0 doesn't know about recorded extensions, so:

  • it chose postgres:18 instead of pgvector/pgvector:pg18 as the scratch server
  • it skipped the extension preflight check
  • pg_restore failed on CREATE EXTENSION vector

Notes for review

  • The script fix works straight from a checkout. It needs no new image release.
  • The newer-set warning only reaches people with the next image release. Images up to 0.3.0 don't have it.
  • A pull happens once per script run, not once per target.

Testing

  • make lint and make test pass: 101 tests, three of them new, covering the warning for a newer, an older and an unrecorded tool_version.
  • The fixed script, run by hand against a pgvector set made by 0.3.0:
    • Stale local :latest (0.2.0), reproducing the failure: the script pulled 0.3.0, picked pgvector/pgvector:pg18, and passed.
    • --image dbbackup:restore-test (local only): it printed "couldn't pull dbbackup:restore-test; using the local copy" and passed.
    • --image dbbackup:no-such-tag: it printed "can't pull dbbackup:no-such-tag, and there's no local copy" and exited with status 2.

🤖 Generated with Claude Code

docker compose run uses any local copy of an image as is, so a cached
ghcr.io/arkane-systems/db-backup:latest can be releases behind the sets it
tests. That happened with 0.3.0's first pgvector set: a local 0.2.0 :latest
didn't know about recorded extensions, chose postgres:18 as the scratch
server, and pg_restore failed on CREATE EXTENSION vector.

scripts/restore-test.sh now pulls the image first (unless --build). If the
pull fails, it uses a local copy, saying so, or stops if there's none.

dbbackup restore-test also warns when a set was made by a newer dbbackup than
the one testing it (the manifest's tool_version), since it may record things
the older version doesn't check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cerebrate
cerebrate merged commit 23e4ce7 into master Oct 31, 2026
5 of 6 checks passed
@cerebrate
cerebrate deleted the fix/restore-test-pull branch October 31, 2026 22:06
@cerebrate cerebrate mentioned this pull request Oct 31, 2026
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