Validate that every config entity listed in the config.actions section of recipe.yml belongs to an extension that is installed, or will be by the recipe or one of its dependencies

Created on 23 February 2024, 10 months ago
Updated 19 April 2024, 8 months ago

Problem/Motivation

This is spun off from #3400672: Robustly validate the structure of recipe.yml .

In https://git.drupalcode.org/project/distributions_recipes/-/merge_request..., Wim noticed that config entities listed in the config.actions section of recipe.yml aren't confirmed to belong to a module that was installed by either the current recipe, or one of the recipes it implicitly or explicitly depends on. This is a little tricky to implement because it would require us to parse every recipe in the "stack" first, to get a complete list of all modules that will be installed.

Rather than try to attack that in the other issue (which is already pretty big), we thought we'd defer it to another issue. That's this one!

To illustrate what we want here, imagine a recipe with this in it:

recipes:
  - some_recipe
  - another_recipe
install:
  - taxonomy
config:
  import:
    paragraphs: '*'
  actions:
    field.field.paragraph.foo.field_bar: {...}
    paragraph.type.baz: {...}
    taxonomy.vocabulary.pastafazoul: {...}

From this, we need to derive a list of extensions that must be installed by this recipe or one of its dependencies:

  • Taxonomy must be installed because a Taxonomy vocabulary is listed in config.actions.
  • Paragraphs must be installed, even though it's not installed by this recipe, because a paragraph type is listed in config.actions and Paragraphs is mentioned in config.import. We'd need to ensure that Paragraphs was either already installed, or one of the dependencies (some_recipe or another_recipe, or one of their dependencies) will be installing it.
  • Field must be installed, since a field is listed in config.actions.

In other words, for any given recipe, we need to know (by looking at config.import, config.actions, install, and recipes) what extensions will be installed by the recipe stack. Even if those extensions are already installed.

Feature request
Status

Fixed

Version

10.3

Component

Code

Created by

🇺🇸United States phenaproxima Massachusetts

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024