Repository navigation
fix(wp-migration): SSH multiplex + fail loudly on DB import error (v0.0.1.2) - #24
Merged
Merged
Conversation
…loses #23) Two UX/correctness fixes for wp-migration.sh: 1. SSH connection multiplexing The script runs ~8 separate ssh/rsync invocations. With password auth the user was prompted every single time. Add ControlMaster=auto + ControlPath in a per-run mktemp dir + ControlPersist=10m so the first connection opens a control socket and subsequent calls reuse it. Trap on EXIT cleans up the socket dir. 2. Database import error masking The mysql import was piped through `grep -v ... || true`, which masked real failures: an `ERROR 1045 Access denied` would print to the screen and the very next line would still claim "Database imported successfully". Switch to `bash -s` heredoc so process substitution `2> >(grep -v ...)` filters only deprecation warnings without touching mysql's exit code, capture status, exit with it. Local side gates the success message behind `if !` and prints an actionable hint about destination DB/user/password requirements. Bumps VERSION to 0.0.1.2. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
ControlMaster=auto+ControlPersist=10mso password is prompted at most once per migration run, not ~8 times.mysqlexit code is no longer masked bygrep -v ... || true. Failures now abort with an actionable hint instead of being followed by a bogus "Database imported successfully" line.Closes #23.
Test plan
bash -n wp-migration.shpasses🤖 Generated with Claude Code