Skip to content
This repository was archived by the owner on Jul 1, 2022. It is now read-only.

Feature/backend options #36

Closed

Conversation

richardbporter
Copy link
Contributor

The 'fra' validatation function added in #34 prints unnecessary messages before a deployment is run, ex. 'Current state matches defaults, aborting.'

The only way to prevent those messages from printing, to my knowledge, is to specify $backend_options as FALSE in drush_invoke_process. This PR makes the $backend_options argument optional in the drush method but defaults it to TRUE for backwards compatibility.

if (!$this->drush('fra', array(), array('quiet' => TRUE, 'no' => TRUE))) {
return FALSE;
if (!$this->drush('fra', array(), array('quiet' => TRUE, 'no' => TRUE), FALSE)) {
return drush_set_error(dt("The drush command 'fra' could not be found."));
Copy link
Member

Choose a reason for hiding this comment

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

Not too fond of this message. As I see it, drush fra might fail horrible for many reasons apart from not finding the command, and telling the user that the command is missing might cause a lot of confusion.

Could we capture the output somehow, and just discard it on error? Then we'd be able ta output it in case of error.

@richardbporter
Copy link
Contributor Author

Agreed, good catch.

I looked into this a bit and realized that the --quiet option I'm passing for the 'fra' command should be hiding this output. I'm not sure why it isn't but maybe the features module doesn't implement/respect the global --quiet option.

If it did, this PR wouldn't be necessary. I'm going to look into that first.

Edit: Nevermind, It does work just not through drush_invoke_process().

@richardbporter
Copy link
Contributor Author

Do we need to explicitly return FALSE here since drush_deployotron_run_validate does?

@xendk
Copy link
Member

xendk commented Apr 14, 2015

It doesn't need to return false as null is taken as false, but I like to be explicit of the intention.

And I'd preface the error log with something like 'Running "drush fra" failed, output:'. The command could fail without any output, in which case it would be confusing.

Anyway, we should try to get this into https://github.com/reload/deployotron/tree/generic-commands

@richardbporter
Copy link
Contributor Author

I think #38 will work for me. I'm going to test it out and close this PR.

@richardbporter richardbporter deleted the feature/backend-options branch April 28, 2015 16:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants