Use ConfigImporter to create/update recipe-provided configuration

Created on 22 June 2022, over 2 years ago
Updated 21 May 2024, 7 months ago

Problem/Motivation

Applying a recipe includes various configuration-related tasks:

  • For both modules and themes, call a specialized extension installer that installs any simple configuration the extension provides but does not install any configuration entities. (TBD: is optional simple configuration a thing? Does the modified installer need to determine what optional simple configuration to install?)
  • Assemble specific configuration entities provided directly by the recipe and specified from extensions installed by the recipe.
  • For extensions where a configuration wildcard is given, determine all installable config from config/install and config/optional. Since the recipe itself can change the conditions for optional configuration, calculation of installable optional configuration needs to take into account all configuration provided or installed by the recipe.
  • Apply any configuration actions (alters), which may apply to either configuration that the recipe specified for installation or to configuration already available on a site.
  • Install the resulting configuration, which involves both (a) creating new configuration and (b) updating existing configuration. (Deletion is intentionally left out of the spec.)

Proposed resolution

There are two potentially applicable core classes: ConfigInstaller, used for installing extension-provided config, and ConfigImporter), used mainly in staging configuration between environments. Which is the better choice here?

In some ways ConfigInstaller seems like the more obvious choice, since it's already specialized for installing from extensions. For example, it includes logic for determining what optional config is installable.

But it also lacks key functionality. Built to a more comprehensive spec, ConfigImporter has robust support for updating existing config. And for optional config handling, there's already a use case for generalizing it: ConfigInstaller: #2960888: Make config/install and config/optional methods reusable for config update use case β†’ .

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Active

Version

11.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada nedjo

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024