Skip to content

fix: force non-interactive ssh for db push, add unit tests#11

Merged
nlemoine merged 1 commit into
mainfrom
fix/export-db-tty-and-tests
Jun 17, 2026
Merged

fix: force non-interactive ssh for db push, add unit tests#11
nlemoine merged 1 commit into
mainfrom
fix/export-db-tty-and-tests

Conversation

@nlemoine

@nlemoine nlemoine commented Jun 17, 2026

Copy link
Copy Markdown
Owner

export_db() pipes gzip'd SQL through generate_ssh_command(), which requests a TTY (-t) when WP-CLI's STDOUT is a TTY. A forced PTY (e.g. an ssh_config RequestTTY force) corrupts that binary stream. Alias::force_no_tty() rewrites -t to -T for plain ssh transports, applied inside generate_ssh_command() so both export_db() and run_command() are covered.

Also adds the project's first PHPUnit suite covering get_rsync_rsh(), get_rsync_location() (including an empty-remote-host regression), and force_no_tty().

@nlemoine nlemoine changed the title Fix/export db tty and tests fix: force non-interactive ssh for db push, add unit tests Jun 17, 2026
export_db() pipes gzip'd SQL through generate_ssh_command(), which requests a
TTY (-t) when WP-CLI's STDOUT is a TTY. A forced PTY (e.g. an ssh_config
`RequestTTY force`) corrupts that binary stream. New Alias::force_no_tty()
rewrites -t to -T for plain ssh transports, applied inside generate_ssh_command()
so both export_db() and run_command() are covered (docker/vagrant builders are
left untouched).

Adds the project's first PHPUnit suite (phpunit.xml.dist + tests/AliasTest.php)
covering get_rsync_rsh(), get_rsync_location() -- including an empty-remote-host
regression -- and force_no_tty().
@nlemoine nlemoine force-pushed the fix/export-db-tty-and-tests branch from d82e3fe to 7ef368e Compare June 17, 2026 14:11
@nlemoine nlemoine merged commit 46e7e06 into main Jun 17, 2026
6 checks passed
@nlemoine nlemoine deleted the fix/export-db-tty-and-tests branch June 17, 2026 14: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