Output information from the recipe application process

Created on 13 March 2024, 9 months ago
Updated 13 May 2024, 7 months ago

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

Feature request
Status

Fixed

Version

10.3

Component

Code

Created by

🇺🇸United States thejimbirch Cape Cod, Massachusetts

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @thejimbirch
  • First commit to issue fork.
  • Pipeline finished with Failed
    8 months ago
    Total: 165s
    #132450
  • Pipeline finished with Success
    8 months ago
    Total: 380s
    #134131
  • Status changed to Needs review 8 months ago
  • 🇮🇳India srishtiiee

    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:

  • 🇺🇸United States thejimbirch Cape Cod, Massachusetts

    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

    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.

  • Status changed to Needs work 8 months ago
  • 🇺🇸United States phenaproxima Massachusetts

    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.

  • Pipeline finished with Success
    8 months ago
    Total: 389s
    #135493
  • Status changed to Needs review 8 months ago
  • 🇮🇳India srishtiiee

    @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.

  • Status changed to Needs work 8 months ago
  • 🇺🇸United States phenaproxima Massachusetts
  • Pipeline finished with Success
    8 months ago
    Total: 417s
    #136041
  • Status changed to Needs review 8 months ago
  • Status changed to Needs work 8 months ago
  • 🇺🇸United States phenaproxima Massachusetts

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

  • Pipeline finished with Success
    8 months ago
    Total: 389s
    #141334
  • Pipeline finished with Failed
    8 months ago
    Total: 393s
    #141471
  • 🇬🇧United Kingdom alexpott 🇪🇺🌍

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

  • 🇺🇸United States phenaproxima Massachusetts

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

  • Pipeline finished with Success
    8 months ago
    Total: 420s
    #142602
  • Pipeline finished with Success
    8 months ago
    Total: 464s
    #144141
  • Pipeline finished with Failed
    8 months ago
    Total: 456s
    #144186
  • Merge request !128Resolve #3427558 "On top of 3439702" → (Open) created by alexpott
  • 🇬🇧United Kingdom alexpott 🇪🇺🌍

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

    See

  • Status changed to Needs review 7 months ago
  • 🇬🇧United Kingdom alexpott 🇪🇺🌍

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

  • Status changed to RTBC 7 months ago
  • 🇺🇸United States thejimbirch Cape Cod, Massachusetts

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

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

    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.

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

  • 🇬🇧United Kingdom alexpott 🇪🇺🌍
  • 🇬🇧United Kingdom alexpott 🇪🇺🌍

    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:...
  • Status changed to Fixed 7 months ago
    • 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...
  • 🇬🇧United Kingdom alexpott 🇪🇺🌍

    Cherry picked to Add recipes api as experimental API to core Needs review

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

Production build 0.71.5 2024