drush icon indicating copy to clipboard operation
drush copied to clipboard

Add a soft confirm option to drush updb

Open Berdir opened this issue 2 years ago • 5 comments

Is your feature request related to a problem? Please describe.

Drush updb has two very different confirmation messages

a) Everything is good to go, here are the update functions I'll run, should I? b) There are requirement errors that will likely break your site if you proceed, are you sure?

drush updb -y says yes to both of them. Automated deployments both need -y atm but should in most cases not proceed in case b)

Describe the solution you'd like

Add something like a soft confirm that only confirms a) but not b in this scenario. Not sure how to name it. --yes-if-no-errors or something? or --no-(ok)-confirm(-without-errors)?

Describe alternatives you've considered

  • No longer ask for confirmation for case a? BC change I guess
  • Have a separate command to check update requirements? would require more complex deploy steps.

Additional context Add any other context or screenshots about the feature request here.

Berdir avatar Nov 06 '23 13:11 Berdir

Slight correction/addendum, it's not either a OR b. a) is always asked after listing the updates while b) is asked before the updates are listed.

Berdir avatar Nov 06 '23 13:11 Berdir

And this is an example why I didn't want to add requirements check to updatedb.

Folks who care about this should run drush rq before updatedb and halt as needed.

weitzman avatar Nov 06 '23 13:11 weitzman

drush rq in its current from doesn't do the same thing. That command is hardcoded to runtime requirements.

the update requirements are a specific requirements scope that only lists relevant problems for the upgrade, things like missing updates and incompatible modules, things that are critical for the success for updating your site. runtime problems are often fairly OK to ignore, especially on test/local environments, upgrade problems very much not.

Berdir avatar Nov 06 '23 14:11 Berdir

Good point. I suggest expanding rq so it can run eitther requirement type.

weitzman avatar Nov 06 '23 14:11 weitzman