Repository navigation
Pull the db-backup image before restore testing; warn about sets from newer versions - #6
Merged
Merged
Conversation
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>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
scripts/restore-test.shpulls the image first. It pulls the db-backup image (defaultghcr.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.--buildskips the pull, as before.dbbackup restore-testwarns about newer sets. It logs a warning when the set's manifesttool_versionis newer than the dbbackup running the test, since such a set may record things this version doesn't check.--helpand the options table indocs/restore.mdmention the pull.Why
docker compose runuses any local copy of an image as is. After 0.3.0 was released and deployed, the first restore test of the newpostgres-memlordset ran a cached:latestthat was still 0.2.0. 0.2.0 doesn't know about recorded extensions, so:postgres:18instead ofpgvector/pgvector:pg18as the scratch serverpg_restorefailed onCREATE EXTENSION vectorNotes for review
Testing
make lintandmake testpass: 101 tests, three of them new, covering the warning for a newer, an older and an unrecordedtool_version.:latest(0.2.0), reproducing the failure: the script pulled 0.3.0, pickedpgvector/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