Allow enforcement of only optional config

Created on 15 March 2024, about 1 year ago
Updated 22 August 2024, 9 months ago

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

Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

🇨🇦Canada ergonlogic Montréal, Québec 🇨🇦

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024