Create a Getting_started.md in the docs

Created on 8 June 2023, over 1 year ago
Updated 24 February 2024, 9 months ago

Problem/Motivation

While the project description has basic steps to some of the things needed to get started with the initiative a getting started doc would be appropriate at this point to onboard new people working with the project in it's pre-experimental form.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Fixed

Version

1.0

Component

Documentation

Created by

πŸ‡ΊπŸ‡ΈUnited States bsnodgrass

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

Merge Requests

Comments & Activities

  • Issue created by @bsnodgrass
  • πŸ‡ΊπŸ‡ΈUnited States bsnodgrass
  • Assigned to bsnodgrass
  • πŸ‡ΊπŸ‡ΈUnited States bsnodgrass
  • πŸ‡ΊπŸ‡ΈUnited States bsnodgrass

    I have started a basic outline and rough draft.

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

    Per @andypost

    Suggestion to add - "documentation could start use help topics as they been merged to help and its standard helpful for task-oriented recipes" refer to the following guide:
    /docs/develop/managing-a-drupalorg-theme-module-or-distribution-project/documenting-your-project/help-topic-standards

  • First commit to issue fork.
  • Status changed to Needs review about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts

    Added Configuring Drupal to Apply Recipes.md to the repo about how to set up your site project for recipes.

  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts

    Uploading it as a file also. Never sure I am doing Gitlab right.

  • Status changed to Needs work about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    I ran through this document and was able to set up a Drupal project with recipe support.

    One helpful thing I discovered is that you don't have to edit composer.json manually at all. You can do it all with commands. Admittedly, some of those commands are more complicated than others...but you can still just script them. (Or, indeed, we could provide a script to do that -- and we should!)

    Here's the sequence:

    composer config allow-plugins.cweagans/composer-patches true
    composer require cweagans/composer-patches
    composer config extra.patches --merge --json '{"drupal/core": {"Allow recipes to be applied": "https://git.drupalcode.org/project/distributions_recipes/-/raw/patch/recipe.patch"}}'
    composer update drupal/core
    composer config allow-plugins.oomphinc/composer-installers-extender
    composer config extra.installer-types --merge --json '["drupal-recipe"]'
    composer config extra.installer-paths --merge --json '{"web/recipes/contrib/{$name}": ["type:drupal-recipe"]}'
    composer require oomphinc/composer-installers-extender
    
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    Thanks for #15! That was simpler/faster than going through the entire .md file (which I did first).

    I tried this on 10.1.x (HEAD is currently 6a68463ce9a5a540ef25e1c6f5a26420a75483f0) and after a fresh install:

    $ vendor/bin/drush si --account-name=root --account-pass=root --site-name=LiveDemoWhatCouldGoWrong --yes
     You are about to:
     * DROP all tables in your 'core' database.
    
     // Do you want to continue?: yes.                                                                                    
    
     [notice] Starting Drupal installation. This takes a while.
     [notice] Performed install task: install_select_language
     [notice] Performed install task: install_select_profile
     [notice] Performed install task: install_load_profile
     [notice] Performed install task: install_verify_requirements
     [notice] Performed install task: install_verify_database_ready
     [notice] Performed install task: install_base_system
     [notice] Performed install task: install_bootstrap_full
     [notice] Performed install task: install_profile_modules
     [notice] Performed install task: install_profile_themes
     [notice] Performed install task: install_install_profile
     [notice] Performed install task: install_configure_form
     [notice] Performed install task: install_finished
     [success] Installation complete.

    I did

    composer require kanopi/gin-admin-experience
    

    (per the .md file πŸ‘)

    It failed like this:

    $ php core/scripts/drupal recipe web/recipes/contrib/gin-admin-experience
    
    In SimpleConfigUpdate.php line 47:
                                                                         
      Config block.block.gin_admin does not exist so can not be updated  
                                                                         
    
    recipe <path>
    

    Is this expected? Is this 10.1.x-specific? For now, assuming it's harmless, so just logging in to my fresh site and:

    Drupal\Component\Plugin\Exception\PluginException: Plugin (admin_toolbar_tools.extra_links:node.add.article) instance class "Drupal\admin_toolbar_tools\Plugin\Menu\MenuLinkEntity" does not exist. in Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass() (line 97 of core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php).
    

    A quick drush cr later and it seems to have worked πŸ‘

    It seems like on of the most obvious low-hanging fruits of the current state of this project is to automatically do a cache rebuild? πŸ˜…πŸ€“

    (Also why does kanopi/gin-admin-experience not change the default admin theme?! πŸ₯Έ That seems to be the whole point of this recipe? πŸ˜… After I changed that manually at /admin/appearance, it did what I expected it to! πŸ‘)

  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts

    Made a Docksal script that does the above. Will have to convert it to a regular bash script.

    #!/usr/bin/env bash
    
    ## One time Composer configuration for Drupal recipes.
    ##
    ## Usage: fin recipe-configure
    
    # Abort if anything fails
    set -e
    
    #-------------------------- Helper functions ------------------------------
    
    green='\033[0;32m'
    yellow='\033[1;33m'
    NC='\033[0m'
    
    divider='===================================================\n'
    party='\xF0\x9F\x8E\x88 \xF0\x9F\x8E\x89 \xF0\x9F\x8E\x8A'
    reverseparty='\xF0\x9F\x8E\x8A \xF0\x9F\x8E\x89 \xF0\x9F\x8E\x88'
    require_command='fin composer require org/recipe-name'
    apply_command='fin recipe-apply recipe-name'
    unpack_command='fin recipe-unpack org/recipe-name'
    
    #-------------------------- Execution ------------------------------
    
    # Configure Composer Patches.
    fin composer config allow-plugins.cweagans/composer-patches true
    fin composer require cweagans/composer-patches
    
    # Add Drupal core patch for recipes to composer.json and update core.
    composer config extra.patches --merge --json '{"drupal/core": {"Allow recipes to be applied": "https://git.drupalcode.org/project/distributions_recipes/-/raw/patch/recipe.patch"}}'
    fin composer update drupal/core
    
    # Configure the location recipes go when required.
    fin composer config allow-plugins.oomphinc/composer-installers-extender
    fin composer config extra.installer-types --merge --json '["drupal-recipe"]'
    fin composer config extra.installer-paths --merge --json '{"web/recipes/contrib/{$name}": ["type:drupal-recipe"]}'
    fin composer require oomphinc/composer-installers-extender
    
    # Requires Drupal Recipe Unpack.
    fin composer config allow-plugins.ewcomposer/unpack true
    fin composer config repo.recipe-unpack vcs https://gitlab.ewdev.ca/yonas.legesse/drupal-recipe-unpack.git
    fin composer require ewcomposer/unpack:1.x-dev@dev
    
    # Complete
    echo -e "\n${yellow} ${party} Your project is now ready to apply recipes! ${reverseparty}${NC}"
    echo -e "Run ${yellow}${require_command}${NC} to require a recipe."
    echo -e "Run ${yellow}${apply_command}${NC} to apply a recipe."
    echo -e "Run ${yellow}${unpack_command}${NC} to unpack the recipe's dependencies to the project's composer.json"
    echo -e "Be sure to export configuration after recipe application to capture its config in your site."
    echo -e "${green}${divider}${NC}"
    
  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts

    @Wim Leers. It appears that your recipe application failed at the block, and it never got to the config:actions section to set the admin theme.

    Drush si defaults to the standard profile, which has more opinions. Could you try the following to start from minimal?

    $ vendor/bin/drush si minimal --account-name=root --account-pass=root --site-name=LiveDemoWhatCouldGoWrong --yes

  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    Reinstalled on 10.2 using #3399825: Create patch for 10.2.x β†’ .

    First

    composer require kanopi/gin-admin-experience
    

    then

    1. vendor/bin/drush si --account-name=root --account-pass=root --site-name=LiveDemoWhatCouldGoWrong --yes
      php core/scripts/drupal recipe web/recipes/contrib/gin-admin-experience
      

      Same error as in #16:

      $ php core/scripts/drupal recipe web/recipes/contrib/gin-admin-experience
      
      In SimpleConfigUpdate.php line 47:
                                                                           
        Config block.block.gin_admin does not exist so can not be updated  
                                                                           
      
      recipe <path>
      
    2. Then, following the advice of #18:
      $ vendor/bin/drush si minimal --account-name=root --account-pass=root --site-name=LiveDemoWhatCouldGoWrong --yes
      $ php core/scripts/drupal recipe web/recipes/contrib/gin-admin-experience
      
                                                                                                                              
       [OK] Gin Admin Experience applied successfully                                                                         
      

    πŸ‘ Thank you!

    However … this means that Recipes are failing to live up to their promise? 🫣 I want to start from Standard so that I get Olivero, not Stark. Then I want Gin. Isn't that a reasonable expectation? πŸ€”

    I think something in the installation of themes/modules is not working when starting from Standard, because vendor/bin/drush cget block.block.gin_admin tells me the block does not exist in either case (Standard/Minimal). Only on Minimal does applying the recipe work.

  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    Debugged this.

    1. When installing gin, hook_themes_installed() is invoked.
    2. block_theme_initialize() makes a new theme get the same blocks as the current default theme (system.theme:default).
    3. The current default theme in Minimal is stark.
    4. stark has a stark_admin block, defined by core/profiles/minimal/config/install/block.block.stark_admin.yml
    5. πŸ‘† that block is defined in the Minimal install profile, not in Stark itself!

    Gin Admin Experience can only ever work successfully if and only if Minimal was installed! It will fail on every other theme, because it's tightly coupled to the exact set of blocks that is created for Stark in Minimal πŸ˜… β€” at least in its current incarnation at https://github.com/kanopi/gin-admin-experience/blob/f5129ea3596b3ebbc5c4....

  • πŸ‡«πŸ‡·France andypost

    Just a reminder, as of 10.2 core instead of .md files it is more handy to ship help topics, ref https://www.drupal.org/node/3382015 β†’

    Guide is https://www.drupal.org/docs/develop/managing-a-drupalorg-theme-module-or... β†’

  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts

    We discussed in slack and found that there is a good defined precedent created by the User Guide project.

    If we build out our docs the same as https://git.drupalcode.org/project/user_guide/-/tree/10.0.x, then we can use a manual technique to publish to Drupal.org, and then when we’re in core it’ll be easy to add the docs to the user guide.

    Help Topics can be built out in a future phase.

  • Issue was unassigned.
  • πŸ‡ΊπŸ‡ΈUnited States bsnodgrass

    Taking myself off as assigned so someone else can hop in.

  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts

    Adding follow up:

    Update our documentation to use AsciiDoc markdown format
    https://www.drupal.org/project/distributions_recipes/issues/3409318 β†’

  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts

    To address the comment in #20, I have reworked the kanopi/gin-admin-experience recipe with heavy use of ensure_exists to allow the recipe to be installed on Minimal and Standard Profiles, and Stark, Olivero, and Claro themes.

    This was the last blocker to getting this merged. I will work on merging the getting started doc into the code base now.

  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts

    Adding credits.

  • Status changed to Fixed 11 months ago
  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts

    Merged in 1.0.x.

  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    Nice, great work, @thejimbirch! πŸ‘πŸ™

  • Status changed to Fixed 11 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024