feat: db push --verify / --sr-tables + db backups list/prune (#16)#6
Closed
vikasiwp wants to merge 1 commit into
Closed
feat: db push --verify / --sr-tables + db backups list/prune (#16)#6vikasiwp wants to merge 1 commit into
vikasiwp wants to merge 1 commit into
Conversation
Closes the round-3 large-DB grab-bag: - db push --verify: poll the site URL after import until it answers HTTP (large imports can briefly return 000 right after import/flush); reported as `verified` in the summary - db push --sr-tables <table...>: scope --search-replace to specific tables instead of --all-tables (faster on big DBs whose bulk has no URLs) - db backups list / db backups prune --keep/--older-than/--force: manage the ~/db-backup-*.sql.gz files db push leaves behind Extracted waitForHttp to lib/http-ready.ts (shared by sites create + db push). New pure libs (http-ready, db-backups) with unit tests; full suite 341 green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
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.
Closes the round-3 large-DB grab-bag (#16) — the last open item from the feedback. All three pieces verified against the source; new logic is in pure, unit-tested libs.
Changes
db push --verify— after import, polls the site URL until it answers HTTP (~90s budget). A large import can briefly return000right after import/flush; this replaces the hand-rolled curl-retry. Reported asverified: ok|timeoutin the summary. (Push still exits 0 — the DB import succeeded; readiness is informational.)db push --sr-tables <table...>— scope--search-replaceto specific (prefixed) tables instead of--all-tables. Faster on big DBs whose bulk rows (e.g. a 197K-row postmeta ingest) have no URLs. Default stays--all-tables(thorough). Table names are validated identifier-safe before going into the remote command.db backups list <site>/db backups prune <site> [--keep <n>] [--older-than <days>] [--force]— manage the~/db-backup-*.sql.gzfilesdb pushwrites (they accumulated with no way to view/clean them).prunerefuses to run without a selector, confirms before deleting, and--force/--jsongate it for CI.Internal
waitForHttpfromsites.tstolib/http-ready.ts(now shared bysites createanddb push --verify).lib/db-backups.ts(parseBackupList,selectBackupsToPrune) — pure, MOTD-tolerant parsing + prune selection.Tests
db-backups(parse + prune selection: keep / older-than / OR / no-criteria),http-ready(answers→true, exhausted-budget→false-without-fetch).tscclean; help output verified for all new flags/subcommands.Builds on the shipped #1–#15 work (
0.0.1-beta.25). #17 (incremental row-deltadb push) is a separate, larger enhancement — planning that next, not in this PR.🤖 Generated with Claude Code