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
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
9603c55
Rough in usage of SiteProcess
weitzman Oct 24, 2018
525ff91
Put cd at end.
weitzman Oct 24, 2018
354009a
Rough in handling during RedispatchHook.
weitzman Oct 24, 2018
fa6c708
Set minimum php to 7.1. Inject site alias manager into redispatch hoo…
greg-1-anderson Oct 24, 2018
f557f7e
Use site-process in sql:sync.
weitzman Oct 24, 2018
61594a5
Handle ssh-wrapping with tty
greg-1-anderson Oct 25, 2018
dd9df38
Merge
greg-1-anderson Oct 25, 2018
f5ef535
sql:sync now uses site-process
weitzman Oct 25, 2018
d835cc5
If runner is a string, convert it to an alias record.
greg-1-anderson Oct 25, 2018
7431c5b
Restore php5 compatibility
greg-1-anderson Oct 25, 2018
6ea40a8
Use constraint proposed by Composer.
weitzman Oct 25, 2018
92e60e4
rsync improvements, config:pull, and options_double_dash
weitzman Oct 25, 2018
113ca9a
Use new Process in all the places
weitzman Oct 25, 2018
f748f93
Back out output formatters since its not on packagist yet
weitzman Oct 25, 2018
cd45601
Use hasRoot(), not empty($self->root()).
greg-1-anderson Oct 25, 2018
3a59d88
Some fixes.
weitzman Oct 25, 2018
d36d55c
Follow the releases.
weitzman Oct 25, 2018
c7e8349
Return an array from cex.
weitzman Oct 26, 2018
a0e4a3f
Fix double dash values.
weitzman Oct 26, 2018
6008e7b
Avoid a write to stdout.
weitzman Oct 26, 2018
900c46e
sql:sync and site:ssh fixes.
weitzman Oct 26, 2018
dcee761
Add 'fields' => '*' to BackendPathEvaluator
weitzman Oct 26, 2018
68514b6
[ci skip] Use UNISH_DB_URL environment variable in sut:si if it is de…
greg-1-anderson Oct 26, 2018
91a954e
Fix tests
weitzman Oct 26, 2018
8c5eba2
Fix up data access in BackendPathEvaluator
greg-1-anderson Oct 26, 2018
930eec3
Update assertion in rsync test
greg-1-anderson Oct 26, 2018
35d3ee8
Merge with Moshe's changes
greg-1-anderson Oct 26, 2018
d0ccd8c
[ci skip] Code style
greg-1-anderson Oct 26, 2018
b3d7f7e
Trim output when looking up info in sql:sync
greg-1-anderson Oct 26, 2018
5d2cb3d
Fix up expectations in SqlSyncTest
greg-1-anderson Oct 26, 2018
2355d46
Add real time output API and use in updatedb
weitzman Oct 26, 2018
27c8d4b
UpdatedbTest fixes
weitzman Oct 26, 2018
862bdcd
Lose extra text.
weitzman Oct 26, 2018
42c7bf7
Fix config pull test
greg-1-anderson Oct 26, 2018
38ad515
Fix handling of sql:dump path output
greg-1-anderson Oct 26, 2018
c88fdbe
Add Doxygen.
weitzman Oct 26, 2018
d9a0d28
Add doxygen and real-time to rsync.
weitzman Oct 26, 2018
3cd0ad2
Use new showRealtime() method.
weitzman Oct 26, 2018
4b816f6
Use ProcessBase from Consolidation.
weitzman Oct 26, 2018
992d78f
Populate io()
weitzman Oct 26, 2018
c2af76d
Deprecate DRUSH_COMMAND in favor of "$config->get('runtime.drush.scri…
greg-1-anderson Oct 27, 2018
78d9253
Remove a use statement.
weitzman Oct 27, 2018
f3639ac
Set an alias.
weitzman Oct 27, 2018
e3bab63
Fix CLI command args.
weitzman Oct 27, 2018
a558fc8
Do not use local path to Drush on remote calls
greg-1-anderson Oct 27, 2018
ae9480d
Merge branch 'siteProcess' of github.com:drush-ops/drush into sitePro…
greg-1-anderson Oct 27, 2018
98fe3bd
No need for setAlias() anymore
weitzman Oct 27, 2018
d900eb5
Slight dedupe to updatedb log message
weitzman Oct 27, 2018
3d04f8e
Up Process timeout.
weitzman Oct 27, 2018
e329616
Use getSelf() in sqlSync
weitzman Oct 27, 2018
fa633f5
Remove no longer needed calls to setIo()
weitzman Oct 27, 2018
53bee38
Use new realtime output callable
weitzman Oct 27, 2018
bef32e2
Inject a DrushStyle into the ProcessBase's outputStyle.
greg-1-anderson Oct 27, 2018
2d3dc8c
Use dev-master of consolidation/site-process for now.
greg-1-anderson Oct 27, 2018
089b6cd
Try dev-master of site-alias
greg-1-anderson Oct 27, 2018
257dddd
Use refactored site-process project.
greg-1-anderson Oct 27, 2018
ce57a63
Update to latest consolidation/site-process and fix some simulated te…
greg-1-anderson Oct 28, 2018
2eef719
Fix up sql:sync test exceptions
greg-1-anderson Oct 28, 2018
ee2ad19
Start converting batch system - start with updatedb
weitzman Oct 29, 2018
a6eda48
Test fixes
weitzman Oct 29, 2018
96564b6
Progress on batchTest.
weitzman Oct 29, 2018
b646582
Break out a UnitBatchOperations class.
weitzman Oct 29, 2018
49f778c
Code style (include renaming constant timeout to TIMEOUT)
greg-1-anderson Oct 29, 2018
e522775
updatedb tests
weitzman Oct 29, 2018
9fdbee0
CS
weitzman Oct 29, 2018
762a678
Use UnstructuredListData and suppress reatime stdout during batches.
weitzman Oct 29, 2018
38060cf
Seat belt for empty path during sql:sync.
weitzman Oct 30, 2018
dcd08bf
Fix update db tests for latest site-process project.
greg-1-anderson Oct 31, 2018
1a9ebeb
Rename process commands e.g. to Drush::drush for better clarity
greg-1-anderson Oct 31, 2018
07266a6
Use showRealtime()->hideStdout() in _drush_backend_batch_process
greg-1-anderson Oct 31, 2018
0ef648d
Rename siteProcessCommand to siteProcess.
greg-1-anderson Oct 31, 2018
255f219
Make sql:sync backward compatible.
weitzman Oct 31, 2018
88753cf
Fix parens and use getOutputAsJson().
weitzman Oct 31, 2018
cfb80f9
CS
weitzman Oct 31, 2018
978709c
Fix sqlsync test
weitzman Oct 31, 2018
e58a950
CS
weitzman Oct 31, 2018
0c4c65c
Stop --backend from eating the next argument
greg-1-anderson Oct 31, 2018
10f2e9c
Remove commented code and chnge var name.
weitzman Oct 31, 2018
cbb37f4
Misc updates to RedispatchHook, PreflightArgs
weitzman Oct 31, 2018
9277617
Fix test fails and re-enable testNonExistentCommand().
weitzman Oct 31, 2018
8494a9b
Move 2 tests into a new RedispatchTest class.
weitzman Nov 1, 2018
04d392e
Woops - add the file
weitzman Nov 1, 2018
127f8db
CS
weitzman Nov 1, 2018
4712ee6
Straighten out command name in redispatch hook
greg-1-anderson Nov 1, 2018
7d4d387
Merge branch 'siteProcess' of github.com:drush-ops/drush into sitePro…
greg-1-anderson Nov 1, 2018
ce1766d
Deprecate core:execute. Add missing docs reference
weitzman Nov 1, 2018
4a75fe7
Add deprecated notices, and update drush_start_browser().
weitzman Nov 1, 2018
84a464a
Fix right version of startBrowser(), and remove stray exec().
weitzman Nov 1, 2018
7ef1d9f
CS
weitzman Nov 1, 2018
403b89e
Update to site-alias ^2
greg-1-anderson Nov 2, 2018
7d5e3e3
Fix browser start method.
weitzman Nov 2, 2018
20dbeb4
Update NotifyCommands.
weitzman Nov 2, 2018
107c8f7
Update SyncViaHttpCommands.
weitzman Nov 2, 2018
89a98c5
Rename drush.script in alias records to drush-script, as it already i…
greg-1-anderson Nov 3, 2018
2aff75f
Improve error msg in Notify.
weitzman Nov 3, 2018
2172d1d
Port a config:edit process.
weitzman Nov 3, 2018
602a701
Port 2 more shell execs.
weitzman Nov 3, 2018
8be7769
Use shellArg()
weitzman Nov 3, 2018
ac61643
Fix notify error message - cant use
weitzman Nov 4, 2018
62a3b3f
Merge branch 'master' into siteProcess
weitzman Nov 6, 2018
0382c22
Test reorg (#3759)
greg-1-anderson Nov 6, 2018
1a0a8d0
Remove scenario from Travis for now.
greg-1-anderson Nov 6, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions includes/drush.inc
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,6 @@ function drush_get_global_options($brief = FALSE) {
* (e.g. unlink() and other file system functions) so that can be suppressed
* if the simulation mode is enabled.
*
* Important: Call @see drush_op_system() to execute a shell command,
* or @see drush_shell_exec() to execute a shell command and capture the
* shell output.
*
* @param $callable
* The name of the function. Any additional arguments are passed along.
* @return
Expand Down
9 changes: 5 additions & 4 deletions src/Commands/core/NotifyCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
namespace Drush\Commands\core;

use Consolidation\AnnotatedCommand\CommandData;
use Consolidation\SiteProcess\Util\Escape;
use Drush\Commands\DrushCommands;
use Drush\Drush;
use Symfony\Component\Config\Definition\Exception\Exception;
use Webmozart\PathUtil\Path;

class NotifyCommands extends DrushCommands
Expand Down Expand Up @@ -88,9 +88,10 @@ public static function shutdownSendText($msg, CommandData $commandData)
}
}

if (!drush_shell_exec($cmd, $msg)) {
throw new \Exception($error_message . ' ' . dt('Or you may specify an alternate command to run by setting notify:cmd in a drush.yml file'));
}
// 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.

$process->mustRun();

return true;
}
Expand Down