Problem/Motivation
Most enforced configs should go into config/install
, as it is then imported during the target module's installation, and CE doesn't have to separately import it. However, sometimes we need to save config in config/optional
, such as Views that depend on the config of certain fields, etc.
If we have config in config/optional
, we might need to run drush cee
after installing the site to ensure that config has been created.
However, this can lead to some issues that are challenging to resolve. For example, sometime config get out-of-sync due only to re-ordering of keys. This can then lead to re-importing configs in config/install
after installation, which makes it challenging to update the config on disk (via drush ceu
) since it has now been squashed.
If we disable the post-install drush cee
, when we run drush ceu
to update the out-of-sync config, then our optional config gets messed-up on disk, since it never got imported.
Proposed resolution
Add an option to drush config-enforce:enforce
to limit enforcement to just config/optional
: --only-optional