- Issue created by @phenaproxima
- 🇮🇳India Prashant.c Dharamshala
Yes, some dry-run before actually applying a recipe and show whether it can be applied or not and why it can't be applied.
Right now, recipes have no way to tell in advance if they will apply successfully. They just sally forth and throw an exception if something goes wrong. That's limiting, and potentially frustrating, and the resulting exceptions can be pretty opaque and unclear on what went wrong.
Recipes need some way to define preconditions. I propose we take advantage of core's condition plugin API for this, and add a section to recipe.yml
called preconditions
, which is an associative array where the keys are condition plugin IDs, and the values are indexed arrays, where each item of the array is a set of configuration for that plugin. All conditions must check out in order for the recipe to be applied.
For example:
preconditions:
matchingEntityExists:
- entity_type_id: field_config
criteria:
# Properties to pass to an entity query.
type: image
entity_type_id: node
bundle: blog_post
- entity_type_id: node_type
criteria:
name: Blog
Translated to English, this means the recipe requires two things:
Conditions have human-readable summaries, so this would open the door to much clearer error messages about why a recipe cannot be applied.
Active
11.0 🔥
Yes, some dry-run before actually applying a recipe and show whether it can be applied or not and why it can't be applied.