Problem/Motivation
When running the Drupal recipe command php core/scripts/drupal recipe core/recipes/example -v, a RecipeFileException error is thrown indicating that the name field is missing in the recipe.yml file. This error prevents the recipe from being executed successfully.
Steps to reproduce
- Attempt to execute the example recipe with the command:
php core/scripts/drupal recipe core/recipes/example -v. - Observe that the execution fails with a validation error highlighting the absence of the
namefield in the recipe.yml file.
Proposed resolution
Add the name field to the example recipe.yml file to meet the required schema validation and allow successful execution of the recipe. The adjusted section should read:
type: 'Content type' name: 'Example'
This ensures that the validation passes and the recipe can be processed as intended.
Remaining tasks
- Review the updated recipe.yml file to ensure compliance with other schema requirements.
- Test the execution of the recipe post-update to confirm no further issues.
- Review documentation to ensure it clearly states all required fields in the recipe.yml schema.
User interface changes
No user interface changes are proposed with this update.
API changes
No API changes are proposed with this update.
Data model changes
No data model changes are proposed with this update.
Release notes snippet
Fixed an issue with the example Drupal recipe where the absence of the name field in the recipe.yml file prevented the recipe from executing. Users should now find that running the example recipe via the command line operates as expected.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | Screenshot 2024-05-09 at 10.16.04 PM.png | 81.57 KB | jnicola |
Issue fork drupal-3446403
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 #2
edutrul commentedComment #4
edutrul commentedThis works and is ready to review.
Comment #5
mradcliffeI think this should go into 11.x not 11.0.x. Can you re-adjust the merge request, @edutrul?
Comment #6
jnicola commentedTested with early version of Recipe UI, is detectable now without throwing an exception and applies cleanly without error!
I also reviewed the build error, looks like it failed in Cspell for a spelling error but this only adds:
name: 'Example'
So I feel confident the build failure is invalid and possibly from some upstream unrelated change. Couldn't see specific error in Cspell output however!
Good work @edutrul and nice to meet you at Drupalcon, I hope you enjoy your time in Portland!
Comment #8
longwaveRebased onto 11.x.
Comment #9
longwaveDebating whether we should have a test that validates all recipes in core before we even commit them, but perhaps that is a good followup.
Comment #14
longwaveCommitted and pushed 94dde8810e to 11.x and e5099ea862 to 11.0.x and 38a06b5e62 to 10.4.x and 9f0f63eafc to 10.3.x. Thanks!