Support synchronizing config from recipes

Created on 16 April 2025, about 1 month ago

Problem/Motivation

See discussion in 💬 Is this compatible with Recipes? Active .

Drupal recipes provide configuration. Currently, they can be reapplied but don't support a primary use case of Configuration Synchronizer.

As described in recipe developer documentation, if a recipe being applied provides configuration that already exists on a given site, "By default it requires that
they be identical in every detail, or it throws an error." A recipe developer can instead set a strict option to FALSE "to have the recipe runner skip the config import if it finds anything different." Two additional options provided by Configuration Synchronizer for extension-provided configuration are not supported:

  • Merge configuration updates into the active configuration storage while respecting any existing customizations.
  • Revert to the configuration as provided.

There is a set of issues open on Drupal core that together would provide a solution in core modelled on some of the approaches in Configuration Synchronizer. These issues include:

Unless and until solutions to those issues are developed and applied, there remains a use potential case for Configuration Synchronizer in recipes.

For extensions, we currently support an all-at-once, site-wide configuration update which applies by default to all installed extensions (though see Support running configuration synchronization on extension code update Active for a possible approach to per-extension configuration updates). There is no use case for running a configuration synchronization when an extension is first installed, since either (a) its configuration will be installed as provided or (b) the extension installer will raise a PreExistingConfigException.

With recipes, however, there are scenarios where synchronization would ideally occur at the time a recipe is applied, regardless of whether this is the first application or a subsequent one:

  • If a recipe is set to strict: true and existing configuration differs from that provided by the recipe, Configuration Synchronizer could potentially intervene to prevent the recipe exception, gracefully merge provided config into the active configuration storage, and allow recipe application to proceed.
  • If a recipe is set to strict: false and existing configuration differs from that provided by the recipe, Configuration Synchronizer could potentially intervene to gracefully merge provided config into the active configuration storage so that potential changes in the recipe-provided config are not lost.

Steps to reproduce

Proposed resolution

See child issues of this issue.

Remaining tasks

User interface changes

API changes

Data model changes

🌱 Plan
Status

Active

Version

3.0

Component

Code

Created by

🇨🇦Canada nedjo

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

Comments & Activities

Production build 0.71.5 2024