Validate recipes and provide useful feedback when a recipe is invalid

Created on 10 April 2024, 3 months ago
Updated 11 April 2024, 3 months ago

Problem/Motivation

I've been experimenting with some starter recipes for our organization. I have created one that has some kind of issue. I'm currently unsure what the issue is, but when I try to install it, I get the following error:

In Container.php line 157:
                                                                                                                                                                                  
  You have requested a non-existent service "config.storage.checkpoint". Did you mean one of these: "config.storage.export", "config.storage.snapshot", "config.storage.schema"? 

Which doesn't make it at all clear to me what the problem is.

Steps to reproduce

I run the following steps:

# Spin up a fresh site in DDEV
mkdir recipe-test
cd recipe-test
ddev config --project-type=drupal10 --docroot=web
ddev start
ddev composer create drupal/recommended-project
ddev composer require drush/drush
ddev drush si --account-name=admin --account-pass=admin minimal -y
ddev drush cr
cd recipe-test
composer config minimum-stability dev
# Configure Composer Patches.
composer config allow-plugins.cweagans/composer-patches true
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-10.2.x.patch?cachebuster=1"}}'
composer update drupal/core

# Configure the location recipes go when required.
composer config allow-plugins.oomphinc/composer-installers-extender true
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

# Requires Drupal Recipe Unpack.
composer config allow-plugins.ewcomposer/unpack true
composer config repo.recipe-unpack vcs https://gitlab.ewdev.ca/yonas.legesse/drupal-recipe-unpack.git
composer require ewcomposer/unpack:1.x-dev@dev
composer config repo.kalamuna/recipes vcs git@github.com:kalamuna/recipes.git
composer require kalamuna/recipes:dev-main#bba1f5b4b019363008ab7a93ee6725b4c1471d95

and then run ddev ssh to get into an interactive terminal in the app container.

cd web
php core/scripts/drupal recipe recipes/contrib/recipes/kalastarter

To cleanup afterwords you can exit the ddev shell, then

ddev delete --omit-snapshot
cd ..
rm -rf recipe-test
✨ Feature request
Status

Closed: works as designed

Version

10.2

Component

Code

Created by

πŸ‡―πŸ‡΅Japan ultrabob Japan

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

Comments & Activities

  • Issue created by @ultrabob
  • πŸ‡―πŸ‡΅Japan ultrabob Japan
  • πŸ‡―πŸ‡΅Japan ultrabob Japan

    I've tried moving the kalastarter directory directly into the recipes directory with the same result, so it appears not to be a matter of where the recipe gets placed.

  • Status changed to Closed: works as designed 3 months ago
  • πŸ‡―πŸ‡΅Japan ultrabob Japan

    It turned out that a cache clear was needed before trying to install. I'm still not able to install the recipe, but that seems likely to be related to the directory structure causing issues with the composer unpack plugin.

Production build 0.69.0 2024