Do less extension scanning in the installer

Created on 11 September 2024, 7 months ago
Updated 12 September 2024, 7 months ago

Problem/Motivation

Spin off from #3473431: Improve the performance of the installer in the trial β†’ .

drupal_install_system() installs the install profile, so once that is installed, we don't need to manually scan for all install profiles and similar.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Needs work

Version

11.0 πŸ”₯

Component
InstallΒ  β†’

Last updated 3 days ago

No maintainer
Created by

πŸ‡¬πŸ‡§United Kingdom catch

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

Merge Requests

Comments & Activities

  • Issue created by @catch
  • Merge request !9472Do less extension scanning in the installer. β†’ (Open) created by catch
  • Pipeline finished with Failed
    7 months ago
    Total: 97s
    #280327
  • Pipeline finished with Failed
    7 months ago
    Total: 566s
    #280334
  • Status changed to Needs work 7 months ago
  • πŸ‡¬πŸ‡§United Kingdom catch
  • πŸ‡«πŸ‡·France andypost
    core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php:56:      $container->get('user.name_validator'),
    

    So the form using service from user module?!

  • πŸ‡ΊπŸ‡ΈUnited States mglaman WI, USA

    So the form using service from user module?!

    It makes sense, the form is creating a user.

  • πŸ‡ΊπŸ‡ΈUnited States mglaman WI, USA

    I tried this with the drupal_cms trial install tests

    1. The profile's hooks run, but $install_state['profiles'][$profile])] is not an extension object
    2. It doesn't seem the like profile's tasks executed (no recipes installed)

  • πŸ‡¬πŸ‡§United Kingdom catch

    The installer used to install user module along with system module right at the beginning, we removed that step, but it looks like we left this implicit dependency. Probably should duplicate the logic to the installer, or factor the validator out to system module or under /core somewhere.

  • πŸ‡ΊπŸ‡ΈUnited States mglaman WI, USA

    I think I see a problem: install_base_system calls drupal_install_system which sets the profile in core.extension. We need to setup the profile from this. Something like:

      // base system has been installed
      else {
        $module_handler = \Drupal::moduleHandler();
        $config = \Drupal::configFactory()->get('core.extension');
        $profile = $config->get('profile');
        throw new \RuntimeException("profile name: $profile");
        if ($profile !== NULL) {
          $install_state['parameters']['profile'] = $profile;
          install_load_profile($install_state);
          if (isset($install_state['profile_info']['distribution']['install']['theme'])) {
            $install_state['theme'] = $install_state['profile_info']['distribution']['install']['theme'];
          }
          if ($profile && !$module_handler->moduleExists($profile)) {
            $module_handler->addProfile($profile, $install_state['profiles'][$profile]->getPath());
          }
        }
      }
    

    Or in install_bootstrap_full task, which just sets the request session

  • πŸ‡«πŸ‡·France andypost

    Moreover to constraint the form using UserInterface::USERNAME_MAX_LENGTH, which can't be moved so user module should be loaded nearby system one

  • πŸ‡«πŸ‡·France andypost

    @mglaman btw profile is loaded via

        if (!$install_state['base_system_verified']) {
          $loaded = $install_state['profiles'][$profile]->load();
        }
    
  • Pipeline finished with Failed
    7 months ago
    Total: 293s
    #281006
  • πŸ‡¬πŸ‡§United Kingdom catch

    Managed to get an existing config install to work via install.php with some help from @alexpott (I originally couldn't get it to work with HEAD, but once that worked it was easy to find a bug). However that doesn't seem to have fixed the test coverage yet.

  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ
  • πŸ‡¬πŸ‡§United Kingdom catch
  • Pipeline finished with Failed
    7 months ago
    Total: 79s
    #281019
  • Pipeline finished with Failed
    7 months ago
    #281024
  • Pipeline finished with Failed
    7 months ago
    Total: 435s
    #281099
  • Pipeline finished with Failed
    7 months ago
    Total: 636s
    #299366
Production build 0.71.5 2024