Problem/Motivation

When a recipe fails to apply, it can be difficult to determine where/when the failure happened, especially in a large recipe stack.

If we could output the what is happening during the application process similar to what composer does, it would help the recipe creation/debugging process.

Steps to reproduce

Change a config file name that other configs depend on in a large recipe stack and apply that recipe.

Proposed resolution

From @alexpott:

We can pass the io object into all the methods on \Drupal\Core\Recipe\RecipeRunner and output information from there.

Remaining tasks

Everything.

User interface changes

None

API changes

None

Data model changes

None

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

thejimbirch created an issue. See original summary.

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

srishtiiee’s picture

Status: Active » Needs review
StatusFileSize
new893.55 KB

Added basic logging to the recipe application workflow. The MR needs an initial review for what more can be done here to enhance the debugging process.
Standard recipe application logging looks like this RN:

thejimbirch’s picture

Wow, this is looking really great!

From a functional review, not a code review, you are displaying info for:

  • Applying a recipe's dependent recipes.
  • Installing modules
  • Installing themes
  • Verifying the dependent recipes applied
  • Applying config actions in a recipe
  • Verifying the recipe applied

Some missing things are we don't see the config:import happening, nor when the config folder is imported.

While you state when config:actions are running, it would also be great to see the individual actions being applied.

These last two points are often where most of the issues are when creating recipes and would help give a lot more insight into the process to recipe developers.

Thanks for your work on this! This will be a big help for recipe creators.

phenaproxima’s picture

Status: Needs review » Needs work

Well, I think this is an awesome idea, and I love what the screenshot is showing us!

I think that we do need to change the way this is implemented, though - right now the MR tightly couples the recipe system to the Console component, and that's not a coupling we should do. I think what's really best here is for the recipe system to accept a logger, which will give us a great deal more flexibility.

srishtiiee’s picture

Status: Needs work » Needs review

@phenaproxima, thanks! Changed the implementation to injecting a logger instead. Also, added console logging for each config action and config import. It needs another review.

phenaproxima’s picture

Status: Needs review » Needs work
srishtiiee’s picture

Status: Needs work » Needs review
phenaproxima’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

This is getting better, for sure. I think we need to make it more robust, and we'll need test coverage.

alexpott’s picture

Issue tags: +blocker

This is blocking making the core patch for recipes and should be part of phase 1 recipes.

phenaproxima’s picture

Issue tags: -blocker +core-mvp

Technically this is not a blocker. But it is part our core MVP, so tagging that way.

alexpott’s picture

StatusFileSize
new167.92 KB

Got a slightly different approach based on the install batching from #3439702: Allow CLI install of Drupal using recipes.

See

alexpott’s picture

Status: Needs work » Needs review

Merged 11.x in now that the installer MR has landed...

thejimbirch’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new981.61 KB
new3.37 MB
new149.81 KB

Applying the recipe gives much more information with this merge request applied as it runs through the recipe.

Screen capture of the recipe applying

Adding the verbose flag, -v, adds a very nice summary at the end.

Screen capture of the recipe applying

I edited a recipe that the standard recipe requires to make it error. The error notice appears before the recipe runs and has a very helpful error message, which was the original motivation for this issue.

Screen capture of the error

Marking this as RTBC. It will be very helpful to recipe creators and users! Thanks!

alexpott’s picture

Issue summary: View changes
alexpott’s picture

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

Committed and pushed 300b8e0fb98 to 11.x and 74325fd86e2 to 10.3.x. Thanks!

  • alexpott committed 74325fd8 on 10.3.x
    Issue #3427558 by srishtiiee, alexpott, phenaproxima, thejimbirch:...

  • alexpott committed 300b8e0f on 11.x
    Issue #3427558 by srishtiiee, alexpott, phenaproxima, thejimbirch:...

  • 1d3f0d41 committed on patch
    Update recipe 10.3.x patch 74325fd8 Issue #3427558 by srishtiiee,...

  • b152b673 committed on patch
    Update recipe 11.x patch 300b8e0f Issue #3427558 by srishtiiee, alexpott...
alexpott’s picture

Status: Fixed » Closed (fixed)

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