Work out how to handle service injection and re-injection in \Drupal\Core\Recipe\RecipeRunner

Created on 9 April 2024, 12 months ago

Problem/Motivation

Currently the \Drupal\Core\Recipe\RecipeRunner uses \Drupal::service() to get services because it skirts the issue of how to get around container rebuilds during module install and configuration save events.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Active

Version

11.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

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

Comments & Activities

  • Issue created by @alexpott
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    Automatic Updates has a similar problem; it handles it by having the auto-update console command re-invoke itself, so that Drupal is booted again.

    What if the recipe runner did something similar? If you ran the command drupal recipe path/to/recipe, it could actually do something like this under the hood:

    drupal recipe:prerequisites path/to/recipe
    drupal recipe:extensions path/to/recipe
    drupal recipe:configuration path/to/recipe
    drupal recipe:content path/to/recipe
    

    Each invocation would boot Drupal anew.

  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

    @phenaproxima it's not that simple though - changing config can rebuild the container... let alone each module install inside the recipe.

  • πŸ‡ΊπŸ‡ΈUnited States bsnodgrass

    moved to Drupal Core

Production build 0.71.5 2024