Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate backend.inc in favor of a new site-process library #3758

Merged
merged 102 commits into from
Nov 6, 2018

Conversation

weitzman
Copy link
Member

@weitzman weitzman commented Oct 24, 2018

See site-process.

See questions in the diff. Can be tested with composer -v sut @example.live ssh -- -v -s

Output shows new and then old (proc_open) shell command:

~/drush (siteProcess *=) $ composer -v sut @example.live ssh -- -v -s
> sut: ./drush --uri=dev '@example.live' 'ssh' '-v' '-s'
 [notice] Simulating: ssh -o PasswordAuthentication=example -t www-admin@service-provider.com cd /path/on/service-provider
Calling proc_open(ssh -o PasswordAuthentication=example -t www-admin@service-provider.com 'cd /path/on/service-provider && bash -l');

This is nowhere near ready - we'll be hacking more at Badcamp.

@weitzman weitzman changed the title Rough in usage of SiteProcess in core:ssh command Rough in usage of site-process [ci-skip] Oct 25, 2018
@weitzman weitzman changed the title Rough in usage of site-process [ci-skip] Replace backend.inc with new site-process library [ci-skip] Oct 25, 2018
@weitzman weitzman changed the title Replace backend.inc with new site-process library [ci-skip] Replace backend.inc with new site-process library Oct 25, 2018
@weitzman weitzman changed the title Replace backend.inc with new site-process library Deprecate backend.inc in favor of a new site-process library Nov 1, 2018
}
// Keep backward compat and prepare a string here.
$cmd = sprintf($cmd, Escape::forSite(Drush::aliasManager()->getSelf(), $msg));
$process = Drush::process($cmd);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not omit Escape::forSite and just:
$process = Drush::process($cmd, [$msg])?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the 2nd argument to process() is cwd, not a replacement array. And if there were two items in the $cmd array, it would quote the first long item which is invalid I think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My mistake. I meant:

$process = Drush::process([$cmd, $msg]);

That will escape the commands for you. Hm, that uses Symfony escaping instead of our improved escaping. Maybe we should have Drush::process use the Escape utilities to escape all of the parameters for the local machine. Escape::shellArg() is the API to use to just escape for the local system.

weitzman and others added 3 commits November 5, 2018 21:41
@weitzman weitzman merged commit 049d2a4 into master Nov 6, 2018
@weitzman weitzman deleted the siteProcess branch November 6, 2018 04:16
sjerdo added a commit to sjerdo/drush that referenced this pull request Aug 13, 2019
Since drush-ops#3758 syncing a database between two remote Drush 9 servers using Drush 8 seems broken. 
Since drush-ops#3758 the object resulted by Drush for sql dump is an array containing the path, instead of a string of the path.

Server specs:
Local: Drush 8
Server @A: Drush 9.7.1
Server @b: Drush 9.7.1

Command executed at server Local: drush sql-sync @A @b

Result before this PR:
```
The Drush sql-dump command did not report the path to the dump file produced.  Try upgrading the version of Drush you are using on the source machine.
```

Result with this fix:
```
Starting to import dump file onto Destination database.   [ok]
```
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.

2 participants