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

  1. Attempt to execute the example recipe with the command: php core/scripts/drupal recipe core/recipes/example -v.
  2. Observe that the execution fails with a validation error highlighting the absence of the name field 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.

Issue fork drupal-3446403

Command icon 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

edutrul created an issue. See original summary.

edutrul’s picture

Project: Recipe » Drupal core
Version: master » 11.0.x-dev
Component: Code » configuration system
Issue tags: +Recipes initiative

edutrul’s picture

Status: Needs work » Needs review

This works and is ready to review.

mradcliffe’s picture

Version: 11.0.x-dev » 11.x-dev
Status: Needs review » Needs work

I think this should go into 11.x not 11.0.x. Can you re-adjust the merge request, @edutrul?

jnicola’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new81.57 KB

Tested 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!

longwave made their first commit to this issue’s fork.

longwave’s picture

Rebased onto 11.x.

longwave’s picture

Debating whether we should have a test that validates all recipes in core before we even commit them, but perhaps that is a good followup.

  • longwave committed 9f0f63ea on 10.3.x
    Issue #3446403 by edutrul, jnicola, mradcliffe: [name]: This field is...

  • longwave committed 38a06b5e on 10.4.x
    Issue #3446403 by edutrul, jnicola, mradcliffe: [name]: This field is...

  • longwave committed e5099ea8 on 11.0.x
    Issue #3446403 by edutrul, jnicola, mradcliffe: [name]: This field is...

  • longwave committed 94dde881 on 11.x
    Issue #3446403 by edutrul, jnicola, mradcliffe: [name]: This field is...
longwave’s picture

Version: 11.x-dev » 10.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed 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!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.