Fix remote config loading when aliases contain connection properties #6210
+42
−1
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.
When running commands against SSH aliases, connection-specific properties (
proxyjump,key) were passed to the remote WP-CLI instance viaWP_CLI_RUNTIME_ALIAS. This caused the remote instance to skip loading config values from its localwp-cli.ymlfiles due to alias context activation.Changes
php/WP_CLI/Runner.phpssh,http,proxyjump,key) from runtime aliaspath,user,url) to remote instancefeatures/aliases.featureWP_CLI_RUNTIME_ALIASpassed)Behavior
Before:
Remote command:
WP_CLI_RUNTIME_ALIAS='{"@prod":{"proxyjump":"jumphost"}}' wp @prod ...→ Remote config files skipped
After:
Remote command:
wp ...→ Remote config files loaded normally
WordPress-specific properties still override remote configs when explicitly set:
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
3c4f3b.example.com/usr/bin/php /usr/bin/php /home/REDACTED/work/wp-cli/wp-cli/bin/../php/boot-fs.php core install-network --title=WP CLI Network --subdomains=1 un-linter-tests k/wp-cli/wp-cli/vendor/bin/sh(dns block)example.com/usr/bin/php /usr/bin/php /home/REDACTED/work/wp-cli/wp-cli/bin/../php/boot-fs.php core install --url=REDACTED --title=WP CLI Site --admin_user=admin --admin_email=admin@example.com --admin_password=password1 --skip-email(dns block)/usr/bin/php /usr/bin/php /home/REDACTED/work/wp-cli/wp-cli/bin/../php/boot-fs.php core install --url=REDACTED --title=WP CLI Site --admin_user=admin --admin_email=admin@example.com --admin_password=password1 --skip-email ev(dns block)/usr/bin/php /usr/bin/php /home/REDACTED/work/wp-cli/wp-cli/bin/../php/boot-fs.php core install --url=REDACTED --title=WP CLI Site --admin_user=admin --admin_email=admin@example.com --admin_password=password1 --skip-email --set-path=/path/to/wordpress sh bin/�� pdate home 'REDACTED' alias k/wp-cli/wp-cli/bin/wp -remote-wp-cli-cmysql(dns block)host/usr/bin/ssh ssh -i identityfile.key -T -vvv user@host cd '/path/to/wordpress'; wp '--debug' '--version' rgo/bin/git(dns block)/usr/bin/ssh ssh -T -vvv user@host cd '/path/to/wordpress'; WP_CLI_RUNTIME_ALIAS='{"@foo":{"user":"admin","path":"\/var\/www\/html"}}' wp @foo '--debug' 'core' 'version' d92a3deef4bd8d0b/wp-config.php d92a3deef4bd8d0b/wp-content n/git hpstan.neon.distsh(dns block)proxyhost/usr/bin/ssh ssh -vvv -W [host]:22 proxyhost abase/index.php d92a3deef4bd8d0b/wp-content/database omposer(dns block)/usr/bin/ssh ssh -vvv -W [host]:22 proxyhost _path=\(.*;\)\?\--user=admin ABLE_WP_CRON', true ); } /home/REDACTED/.config/composer/vendor/bin/bash(dns block)wordpress/usr/bin/ssh ssh -T -vvv wordpress cd '/my/path'; wp '--debug' '--version' ext\FeatureContext --require=foo.php n/bash s-than-wp-6.1&&~tput core cal/bin/which sh /hom�� li-test-run--697655b3a38da6.36564117/subdir/wp-content/uploads'/* '/tmp/wp-cli-test-core-installsh test-cmd n/php ache-6.9/index.pdirname ache-6.9/license-- bin/sh wp(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.