Generated with the help of an LLM.
Problem/Motivation
DrupalApplication::bootstrap() always creates a \Drupal\Core\DrupalKernel. A database update command needs \Drupal\Core\Update\UpdateKernel. That kernel forces a container rebuild, adds UpdateServiceProvider and does not cache the container. A command cannot swap the kernel, because the kernel boots before commands are discovered.
Proposed resolution
Read a kernel.class value from the runtime context in DrupalApplication::bootstrap(). Default to DrupalKernel. Throw an InvalidArgumentException when the value is not a class that extends DrupalKernel. Document the context keys on the constructor.
Remaining tasks
Review.
User interface changes
None.
API changes
New optional context key kernel.class for DrupalApplication. No change to existing behavior when the key is absent.
Data model changes
None.
Issue fork drupal-3638095
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
moshe weitzman commentedComment #4
smustgrave commentedThink as an API change, and pretty sure this has command has shipped in a release, we will need a CR please.
Comment #5
moshe weitzman commentedWhich API does it break? Anyone extending DrupalApplication will be unaffected. Its an API addition.
Comment #6
smustgrave commentedYes but even API additions usually need a change record so that others are aware if they want to use it or build on top of it.