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

Skip drupal:update if Drupal is not installed #3831

Merged
merged 3 commits into from
Aug 29, 2019
Merged

Skip drupal:update if Drupal is not installed #3831

merged 3 commits into from
Aug 29, 2019

Conversation

richardbporter
Copy link
Contributor

Fixes #3277

Changes proposed

This change checks to see if a site can bootstrap via Inspector::isDrupalInstalled before invoking the drupal:update command. If the site cannot bootstrap, it logs a warning but continues to attempt database updates on other multisites.

Steps to replicate the issue

The steps originally outlined in #3277 suffice but locally you can replicate this by:

  • Creating two multisites locally
    • a.com
    • b.com
  • Installing Drupal in b.com and not in a.com
  • Run blt auda

Previous (bad) behavior, before applying PR

The previous behavior would cause the blt auda command to fail on a.com. This actually has potentially negative consequences like leaving b.com or any number of other multisites in a wonky state during AC deployments.

Expected behavior, after applying PR and re-running test steps

The blt auda command logs a warning, skips running database updates on a.com and proceeds to b.com.

@danepowell
Copy link
Contributor

Looks great! Thanks a lot for the contribution!

I tested on a local multisite with default installed, but not sites "foo" or "bar". As expected, updates were applied to default but skipped for foo and bar.

vagrant@local:/var/www/blt-canary$ blt auda
[warning] Drupal is not installed for bar. Skipping updates.
Deploying updates to default...
> drupal:update
[Acquia\Blt\Robo\Tasks\DrushTask] Running /var/www/blt-canary/vendor/bin/drush @self updb --no-interaction --ansi in /var/www/blt-canary/docroot
 [success] No pending updates.
[Acquia\Blt\Robo\Tasks\DrushTask] Done in 4.37s
> drupal:config:import
[Acquia\Blt\Robo\Tasks\DrushTask] Running /var/www/blt-canary/vendor/bin/drush @self config:set system.site uuid 641cfab7-0980-487d-b5b1-3d9c45dd10b3 --no-interaction --ansi &&
 /var/www/blt-canary/vendor/bin/drush @self pm-enable config_split --no-interaction --ansi &&
 /var/www/blt-canary/vendor/bin/drush @self config-import sync --no-interaction --ansi &&
 /var/www/blt-canary/vendor/bin/drush @self config-import sync --no-interaction --ansi &&
 /var/www/blt-canary/vendor/bin/drush @self cache-rebuild --no-interaction --ansi in /var/www/blt-canary/docroot
 [notice] Already enabled: config_split
 [notice] There are no changes to import.
 [notice] There are no changes to import.
 [success] Cache rebuild complete.
[Acquia\Blt\Robo\Tasks\DrushTask] Done in 6.411s
> drupal:toggle:modules
Finished deploying updates to default.
[warning] Drupal is not installed for foo. Skipping updates.

@richardbporter
Copy link
Contributor Author

richardbporter commented Aug 29, 2019

Thanks! I briefly tried to write a test but I had trouble getting BLT tests to run locally. I also didn't see an existing Inspector or DeployCommand test.

Copy link

@stephenthedev stephenthedev left a comment

Choose a reason for hiding this comment

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

Looks good!

@danepowell danepowell added the Bug Something isn't working label Aug 29, 2019
@danepowell danepowell merged commit 54a7101 into acquia:10.x Aug 29, 2019
@richardbporter richardbporter deleted the skip-updates branch November 23, 2021 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DT-595: When provisioning a new multisite, Acquia code hooks will always fail
3 participants