Open ndouglas opened 2 years ago
This also causes PR errors like this, since the database is not up-to-date:
+--------------------------------+----------+----------------------------------+
| Title | Severity | Summary |
+--------------------------------+----------+----------------------------------+
| Database updates | Error | Out of date |
| | | |
| Module and theme update status | Error | Unsupported release [1] |
| | | |
| | | [1] |
| | | http://default/admin/reports/upd |
| | | ates |
| | | |
+--------------------------------+----------+----------------------------------+
I've only seen this message since the Drupal 9.4 update, though, so I don't know whether dirty updates have been making their way to prod (and fixed transparently) or if something else changed.
Description
In the course of my work on this PR, I encountered an issue that I believe indicates a problem with
drush deploy
. This problem can lead to PRs being merged that are not internally consistent and might cause problems with subsequent deploys to production.drush deploy
performs the following steps:drush updatedb --no-cache-clear
drush cache:rebuild
drush config:import
drush cache:rebuild
drush deploy:hook
And note:
One problem comes with modules that 1) are installed by config and 2) include
post_update
hooks.In practice,
post_update
hooks will get triggered, then the module will be installed, but itspost_update
hook will not be executed. It will be executed on the next run. However, the module itself may be coded based on the assumption that thispost_update
hook has been executed.An example of this is the above PR.
When the Tugboat preview is built, we see the following:
The configuration is imported, but the
post_update
hooks have not been run.Why is this a problem?
If you manually run
drush deploy
, ordrush updb
, you might encounter an error:The root cause of this particular problem is not particularly important. What's important is that there is a problem.
drush deploy
will be run on production on the next deploy, and it can trigger code that was not invoked as part of the PR's deploy. The code's not tested by the deployment mechanism, not generally visible in the PR interface (since it doesn't exist within files kept in version control), etc.This can probably be fixed by something as simple as running
drush updb
a second time, afterdrush deploy
, but this issue may have further implications given thatdrush deploy
is supposed to standardize the deployment process.Acceptance Criteria