-
Notifications
You must be signed in to change notification settings - Fork 14
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
Drupal update task misses post_update hooks if modules are installed from config with weight different than 0 #189
Comments
I agree that we should gravitate towards |
@justafish @deviantintegral if you want more context on the problem that originated this, there is more (including screenshots that demonstrate the bug) in this internal slack thread: https://lullabot.slack.com/archives/C0EFBKKK6/p1680079433850549 |
@mrdavidburns When we last spoke about this ticket, we agreed that a good next step was for you to revisit the deploy drush command and add more context here. We may need to split this into multiple tickets. |
https://www.drush.org/latest/deploycommand/ It looks like it still runs both
|
I don't think we can literally use the drush command unless it has a workaround or flag for config imports failing on limited memory environments like Pantheon such as:
|
@mrdavidburns @deviantintegral I may be missing part of the context for your concerns here, would you mind elaborating a bit more? Drush has incorporated several commands in the The suggestion to avoid the bug described here is to move to the
The most important impact this would have in sites using Drainpipe is a shift in the mental model for developers, because now "the code I want to run after importing config" will need to be placed in a Actually it feels to me that this gets developers closer to what these hooks were intended for...
|
What would be the downside to align ourselves with upstream and adopt |
They import config only once, and experience has demonstrated it's worth having it twice for several reasons. |
Are there other reasons beyond Config Split? If I remember correctly, we have an ADR that recommends avoiding Config Split. Perhaps we cannot avoid it when we inherit a codebase though. 🤔 EDIT: https://architecture.lullabot.com/adr/20211026-use-settings-not-splits/ |
We've seen config import fail in environments where memory limit may be an issue (or when there is an unreasonably large number of config changes). In those cases a subsequent import resumes the import without significant downsides. I also discovered recently that some hosting solutions (such as Acquia Site Factory) require Config Split when managing configuration across sites, so even if it's not our preferred option, we can't rule it out. |
Our docs in Drainpipe also mention the possibility of a dependency mis-declared, although I haven't experienced this one myself:
|
Thanks for the clarifications! I understand now. We might make an argument in Drush's issue queue to this effect, but I agree that the solution proposed above is more practical. 👍 |
This has been merged and will be in the next major release. Thanks all! |
Would someone who's participated in this issue be willing to volunteer to write an update in the ADR repo to deprecate https://architecture.lullabot.com/adr/20210924-drupal-build-steps/ and replace it with a new one matching what we've decided on here? |
With this change, the only thing preventing us from completely switching to a single |
I commented there as well. Let's give a few days for a response, and then ping in Slack? That issue is closed so the maintainers may not read the comments. |
Our
drupal:update
task relies on the following order of steps when building the site:However, there is a scenario where this set of steps fails:
hook_post_update_NAME()
implementation on a module that is already installedcore.extension.yml
with a weight higher than 0 (for example addban: 200
to the bottom of the list)task drupal:update
Expected: Your update hook is executed
Actual: your update hook is not executed
In my testing,
\Drupal\Core\Update\UpdateRegistry::onConfigSave()
enters the if condition on line 348 :core.extension
Synchronized extensions: [name-of-the-module]
core.extension
config objectSyncronized configuration: update core.extension
As a result, it's impossible to deploy a release that includes:
This may be a bug in core, but by the discussions in:
I have the feeling that the consensus in the community may be gravitating towards using Drush's
deploy
command to build the site, and always have post_update_NAME() immediately follow update_N() hooks, such as:So I am not confident it would be realistic to try to chase and fix this issue in core. Maybe the easiest could perhaps be to switch to the
deploy:hook
command that is already in Drush by now? Any other ideas?The text was updated successfully, but these errors were encountered: