Merge in config updates when (re)applying a recipe

Created on 2 September 2022, almost 2 years ago
Updated 10 June 2024, 18 days ago

Problem/Motivation

Currently when a recipe is reapplied, config as provided is compared against existing config in the active config storage and an exception raised if there's a difference.

As determined in #3283900: Define recipe runtime configuration update requirements β†’ , when the recipe has been previously run, this comparison will fail when any of three commonly occurring situations apply:

  1. The config has been altered by a config action. Example: Recipe A provided a user role and Recipe B added a permission to the user role.
  2. The config has been customized by a site administrator. Example: Recipe A provided a user role and a site administrator added a permission to the role.
  3. The config as provided has changed. Example: Recipe A provided a view when it was last installed and now provides the same view in a slightly different form, such as a field added to a display.

The first of these issues may be mitigated through #3304910: Compare against a config snapshot when (re)applying a recipe β†’ . Still, taken together, it's expected these common sources of differences will frequently prevent reapplication of recipes, significantly weakening the applicability and benefits of recipes.

Proposed resolution

When there are differences between config as provided and config in the active storage, determine what changes are available and merge them in.

As well as solving the problem of ensuring recipes can be reapplied, this will essentially make recipes and extension-provided config updatable, achieving a longstanding aim currently met in contrib by workarounds like Configuration Synchronizer and Update Helper.

Doing so will require:

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
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.

  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts
  • πŸ‡¨πŸ‡¦Canada deviantintegral

    One of our team members recently created a proof of concept to test out recipes as they exist today, and we pretty quickly ran into this. There's three scenarios I can think of where functionality like this would be useful:

    1. As a developer today working on recipes, you might want to change and re-apply them on your local without having to do a reinstall.
    2. As a future Drupal user, where you are iteratively adding different recipes to your site over time. With the current model, it seems like all it takes is one overlapping config object for a recipe to become un-importable. In many cases, I think updating existing config would be normal and expected, such as a new recipe wanting to change the default home page path.
    3. As a Drupal expert, where you want to apply a recipe to an existing site you've inherited. At Lullabot, this would mean us creating recipes to match our ADRs so we could more quickly get a site up to what we consider standard.

    As is, I don't see Recipes solving #3 for us - for it to be worth our time creating and maintaining, it's got to work for all of our projects, both greenfield and inherited. Otherwise, it's more effective for us to treat these things as documentation and not code, even if that means annoying point and click (and copy-paste) setup.

    Given it's been a year and a half since the last substantial comment, it'd be great to know if this feature is still in scope with the current state of the initiative and where it currently ranks in comparison to other work.

  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts

    Hi,

    This issue is in my phase 2 roadmap under the Improve the recipe application process epic. See #3446089: [Meta] Recipes Phase 2 Roadmap β†’ .

    I love the idea of your #3, and already have some "snack" sized recipes like a 90 Day Password Policy and YouTube Lite Embed.

    We just landed recipes and default content into core a few weeks ago as experimental. Our goal for phase 2 is to iterate and improve, and work to ensure recipes as a foundation can support the Starshot initiative.

    Most of the work in this initiative has been done by a very small group. If anyone is interested in helping move this issue forward, we would gladly accept the help.

    We have an asynchronous meeting every two weeks.
    #3269687: [Meta] Distributions and Recipes Initiative meetings - Next: June 4th, 2024 β†’

    We monitor the #recipes channel of the Drupal slack.

    We have a Recipes and Starshot Webinar scheduled β†’ for June 11, 2024 - 15:00 - 16:00 GMT

  • πŸ‡¨πŸ‡¦Canada deviantintegral

    Excellent, thanks for the update! I'll be sure to point members of our team here if they're looking for contribution opportunities.

  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts

    Thank you!

Production build 0.69.0 2024