Description

We are currently building out drush commands but will need to support drush 9. At this time, the drush commands are in progress so I don't want to refer to them by name in fear that they could drastically changes. Whoever does this task should review all drush commands in system_monitor.drush.inc and update them accordingly.

CommentFileSizeAuthor
#4 3094757-4.patch10.18 KBrobpowell

Comments

robpowell created an issue. See original summary.

robpowell’s picture

Issue summary: View changes
robpowell’s picture

StatusFileSize
new10.18 KB

here is the first attempt. To get running in ddev you have to do composer require drush/drush:~9.

I am hoping to get some phpunit tests up to test the new SystemMonitorCommands class.

robpowell’s picture

Assigned: Unassigned » robpowell
merauluka’s picture

@robpowell We should consider updating the drush 8 commands to use the drush 9 class-based approach so we only have to maintain a single set of commands.

robpowell’s picture

@merauluka, I believe this is the class approach. Let me know if there is a different format I should be following. To test you have to update to drush 9: composer require drush/drush:~9.

robpowell’s picture

Assigned: robpowell » merauluka
Status: Active » Needs review
merauluka’s picture

Assigned: merauluka » robpowell
Status: Needs review » Needs work

A suggestion for this patch would be to avoid backslashes in translated text. It's easier to read if you simply enclose the text in double quotes, which would make escaping the single quotes unnecessary.

See the coding standards doc:
https://www.drupal.org/docs/develop/standards/coding-standards#quotes

    if (empty($type)) {
      $this->output()->writeln(dt('Type value must be either \'monitor\' or \'task\'. Please resubmit with one of these values.'));
      return;
    }

    $tags = $options['tags'];
    $tags = !empty($tags) ? explode(',', $tags) : [];
    $list = !empty($list) ? explode(',', $list_to_run) : [];

    $approved_type = in_array($type, ['monitor', 'task']);
    if (!$approved_type) {
      $this->output()->writeln(dt('Type value must be either \'monitor\' or \'task\'. Please resubmit with one of these values.'));
      return;
    }

merauluka’s picture

Status: Needs work » Fixed

I have committed the changes here with a couple of small updates. It appears a single existence check was calling a non-existent variable.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.