-
Notifications
You must be signed in to change notification settings - Fork 6
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
Improve Configuration Validation [ spike ] #151
Comments
If a new config item is added to Drupal core or contrib, and we run a
Checking before |
@markdorison I just remembered one example.
|
@goranmiric Thanks for that example! That makes sense. |
Good point. 🙈 🤔 So we need to detect issues like the one @goranmiric described above, but not fail the more common scenario of us simply changing configuration files. I need to ponder this. |
So what we really need to do is:
That does not match the order used for a production deployment or what That significantly adds to the overhead unless we can think of something clever. 😭 We almost need two databases to handle the two different states. 😬
|
@adamzimmermann and I talked about this issue this morning and he has updated the issue description with links to some relevant Drupal core issues. I would also specifically note a comment I just made on this issue: If an update hook modifies configuration, then old configuration is imported, the changes made by the update hook are forever lost.
|
This possibility should almost always/always line up with a change to at least mymodule/config/mymodule.schema.yml and possibly the config/install/mymodule.settings.yml. So if there were a change in those files between versions, we could anticipate that there is an update hook that modifies config. I've always hated that drupal's update hooks are so powerful (you can do anything you want in there) and that they therefore can easily cause these circular dependencies on deployment. It really breaks the config files as the source of truth. To my mind, changes to the config/schema of a module should introduce a different major version number, and the update to the module should therefore include some extra steps and not have an automated update path. But, back to reality.... I think the best we can do here is try to predict that there will be an issue and alert the end user that they should probably resolve config changes manually before deploying, and interrupt the deployment. |
Description
During
drush deploy
update hooks are ran and then configuration is imported.This is great for deploying to production, but it makes it very hard to assert that the configuration in code matches the most up to date state of the database.
A module update done via one of our automated tools may have an update hook that changes configuration. The subsequent configuration import will likely blow those changes away, and then our configuration checking tool in Usher will not find an issue.
Questions / Areas of Uncertainty
drush deploy
command or create or own version that extends it for CI usage?Outcome
We can confidently validate that the configuration in code has the latest values, even if an automated dependency update includes changes to configuration via an update hook.
Additional Context
We will need a fully functioning/bootstrapped version of Drupal in a CI environment to validate this.
Existing Config Validation Code:
This might be worth exploring:
@goranmiric and I had a good discussion about this recently somewhere, but I can't remember where. 🤔
Drupal Issues
Related Blog Posts
The text was updated successfully, but these errors were encountered: