Model core's minimal install profile as recipes

Created on 7 June 2023, over 1 year ago

Once we model the Standard profile. We should be able to assemble a recipe that could replace the minimal profile.

๐Ÿ“Œ Task
Status

Active

Version

10.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States thejimbirch Cape Cod, Massachusetts

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

Merge Requests

Comments & Activities

  • Issue created by @thejimbirch
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

    Do we really need to do this?

    Minimal is such a nothingburger of a profile (intentionally) that I feel like it doesn't actually provide enough value to become a recipe. We've already converted Standard to a recipe suite, and will tackle Umami next, and both of those provide tremendous value for actual sites, especially in a composable, "recipized" form.

    I feel like this should be closed as a wontfix.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States thejimbirch Cape Cod, Massachusetts

    If we are going to be replacing the starter profiles with recipes, then we will most likely need minimal.

    There are small changes to what core does, plus the theme blocks.

    like:

    core module:
    https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/user/...

    minimal:
    https://git.drupalcode.org/project/drupal/-/blob/11.x/core/profiles/mini...

    It would also be a nice simple example of what recipes can do in core. For instance, this change doesn't need to be a full config change, but a small config action.

    config:
      action:
        user.settings.yml
          simple_config_update:
            register: visitors_admin_approval
    
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States thejimbirch Cape Cod, Massachusetts
  • Merge request !140Resolve #3365453 "Model cores minimal" โ†’ (Open) created by thejimbirch
  • Status changed to Needs review 7 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States thejimbirch Cape Cod, Massachusetts

    Merge request created that adds the recipe and copies the two tests. This is my first time making a core test, so please review those with care.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States thejimbirch Cape Cod, Massachusetts

    To test manually:

    On /admin/appearance
    "Stark" should be the default and administration theme.

    On /admin/config/people/accounts
    "Visitors, but administrator approval" is required should be selected for "Who can register accounts?".

    On /admin/appearance/settings
    "User pictures in posts" should be unchecked.

    On /admin/modules
    The following modules should be enabled:

    Block
    Database Logging
    Internal Dynamic Page Cache
    Internal Page Cache

    Among others.

  • Status changed to Needs work 7 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States thejimbirch Cape Cod, Massachusetts

    I could use help with the failing tests.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ
    PHP Fatal error:  An alias (doTestMinimal) was defined for method testMinimal(), but this method does not exist in /builds/project/distributions_recipes/core/tests/Drupal/FunctionalTests/Core/Recipe/MinimalRecipeInstallTest.php on line 18
    

    is happening due to

      use StandardTestTrait {
        testMinimal as doTestMinimal;
      }
    

    ๐Ÿ‘† StandardTestTrait does not contain a testMinimal method at all, only testStandard().

    AFAICT the only choice here is to duplicate much of \Drupal\Tests\minimal\Functional\MinimalTest, or refactor it so that there is a trait.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States thejimbirch Cape Cod, Massachusetts

    Ah, makes sense. A bit over my head to implement though. If some one else wants to take this on, I would appreciate it.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia prashant.c Dharamshala

    Prashant.c โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia prashant.c Dharamshala

    @thejimbirch

    1. I added 2 more files from the core's minimal profile system.theme.global.yml and user.settings.yml
    2. To test I executed the recipe simply on already installed Drupal
    3. Could you please guide me also on how you tested the steps mentioned here https://www.drupal.org/project/distributions_recipes/issues/3365453#comm... โ†’ because currently, recipes need at least minimal Drupal installed to apply any recipe if I am not mistaken.

    Thanks.

  • Pipeline finished with Failed
    6 months ago
    Total: 229s
    #203443
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States thejimbirch Cape Cod, Massachusetts

    Hi Prashant Chauhan,

    Please remove those additional files you added. They are not needed. We don't need to copy and paste the files as they are in the profile. Our goal is to create the same functionality using the new tools.

    The config files in the profile had to replace all of the functionality of the core module. Recipes do not need to recreate the whole thing. We only need to change the bits that need changing. In both files, there is only one small change in each that we can make using config actions in the recipe.yml.

    Lets take a look at the differences in user.settings:

    Here is how we are applying this single change:

    The same applies to the system.theme.global config:

    And again, here we are applying this single change in the recipe.yml using config actions:

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States thejimbirch Cape Cod, Massachusetts

    To test the functionality you could use the Drupal PHP script to install Drupal without the need for an install profile.

    From the Drupal root run:

    php core/scripts/drupal install core/recipes/minimal

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Akhil Babu Chengannur

    Akhil Babu โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Akhil Babu Chengannur

    Added 'MinimalTestTrait' and moved the testMinimal() method to it as mentioned in #9.
    But the tests are still failing. The testMinimal() method uses 'administer content types' permission while creating test user. This permission is provided by the core node module. But the node modue is included in this recipe. Should we add it as well?

  • Pipeline finished with Failed
    5 months ago
    Total: 335s
    #219753
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States thejimbirch Cape Cod, Massachusetts

    Yes, great catch! We should add the node module into the recipe.yml's install section.

  • Status changed to Needs review 4 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States thejimbirch Cape Cod, Massachusetts

    Added it. Lets see if tests pass now.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia prashant.c Dharamshala

    I am assuming the minimal profile should be installable as a first recipe like:

    1. I am on a fresh cloned Drupal instance
    2. Trying to apply the "minimal" recipe

    However, it is not applying because it is looking for a DB connection, which is not yet set as the site has not been installed yet. Mostly the developers will use this recipe to install the site initially after the site is installed in my opinion this "minimal" recipe is not of any use and no one would try to apply it.

    Please correct me if I misunderstood something here.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States thejimbirch Cape Cod, Massachusetts

    To install you can run:

    php core/scripts/drupal install core/recipes/minimal

    If you are running drush 13+, you could also run:

    drush si core/recipes/minimal

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States thejimbirch Cape Cod, Massachusetts

    the build test failed with a timeout last time. Retrying

  • Status changed to Needs work 4 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States thejimbirch Cape Cod, Massachusetts

    Tests run and fail on a couple of things.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Akhil Babu Chengannur

    akhil babu โ†’ changed the visibility of the branch 3365453-cores-minimal-install-profile-as-recipes to hidden.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States thejimbirch Cape Cod, Massachusetts

    PHPstan level 9 and Test are still failing.

Production build 0.71.5 2024