Closed (fixed)
Project:
Drupal core
Version:
10.3.x-dev
Component:
recipe system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
14 Jun 2024 at 10:43 UTC
Updated:
31 Jul 2024 at 15:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
thejimbirch commentedThanks for reporting. Added this issue to the Recipes Phase 2 roadmap under "Improve the recipe application process"
https://www.drupal.org/project/distributions_recipes/issues/3446089#reci...
Comment #3
phenaproximaThe word here is "idempotent" :) That's a fancy-pants compsci word for "if you do a thing more than once, the result should be as if you only did it once".
Core recipes should be idempotent. We could adjust CoreRecipesTest to apply all the recipes twice, which would prove that they are. If they're not, then we have some bugs to fix!
Comment #4
phenaproximaMoving this to core's queue.
Comment #6
thejimbirch commentedI checked out
3454603-many-core-recipesInstalled Drupal using
php core/scripts/drupal quick-start minimalI then applied the standard recipe using
php core/scripts/drupal recipe -v standardIt was successful.
I then reapplied the recipe using
php core/scripts/drupal recipe -v standardI got the following error:
Comment #7
phenaproximaYeah, still working on this.
Comment #8
thejimbirch commentedCan be re-applied
==================
administrator_role
audio_media_type
basic_block_type
basic_html_format_editor
basic_shortcuts
comment_base
content_editor_role
content_search
core_recommended_maintanance
core_recommended_performance
document_media_type
editorial_workflow
example
feedback_contact_form
full_html_format_editor
image_media_type
page_content_type
remote_video_content_type
restricted_html_format
standard_responsive_images
tags_taxonomy
Can't be re-applied
==================
standard
The configuration 'core.entity_form_display.node.article.default' exists already and does not match the recipe's configuration
article_comment
(same as above)
article_content_type
(same as above)
article_tags
(same as above)
user_picture
(same as above)
core_recommended_admin_theme
The configuration 'system.theme' exists already and does not match the recipe's configuration
core_recommended_front_end_theme
(same as above)
Comment #9
phenaproximaComment #10
phenaproximaComment #11
alexpottThis looks like really nice work. It is create to see createIfNotExists being used to make recipes re-usable. This is why I added it. Nice one @phenaproxima
The new actions look good too.
Comment #12
thejimbirch commentedAll core recipes can be applied twice! Marking RTBC
Comment #13
prashant.cThanks for the efforts @phenaproxima.
But still not working for me.
Pulled the latest code from
3454603-many-core-recipes, on an already installed site tried to apply the standard recipeGetting the following error:
Comment #14
prashant.cRe-tried by dropping the DB and installing the site first with
minimalprofile as mentioned in theSteps to reproduceof the issue summary.Then applying and reapplying the
standardprofile works fine.Still have a few issues:
minimaland the second when applying thestandardrecipe.Warning: Undefined array key "user_admin_people.page_1" in Drupal\views\Plugin\Derivative\ViewsLocalTask->getDerivativeDefinitions() (line 82 of core/modules/views/src/Plugin/Derivative/ViewsLocalTask.php).Warning: Undefined array key "content.page_1" in Drupal\views\Plugin\Derivative\ViewsLocalTask->getDerivativeDefinitions() (line 82 of core/modules/views/src/Plugin/Derivative/ViewsLocalTask.php).Comment #15
alexpott@Prashant.c I think the task of applying over an standard profile install is an interest one. I wonder if it is possible to apply over a site installed from the standard recipe.
I think what @Prashant.c's testing implies is that we need to add a re-application test to \Drupal\FunctionalTests\Core\Recipe\StandardRecipeTest and maybe to \Drupal\FunctionalTests\Core\Recipe\StandardRecipeInstallTest... it could be in \Drupal\Tests\standard\Traits\StandardTestTrait::testStandard...
Comment #16
thejimbirch commentedApplying the standard recipe over minimal profile, you do get block duplication, which I believe is what we were talking about in https://www.drupal.org/project/drupal/issues/3105597#comment-15601255
I can confirm, trying to install standard recipe over the standard profile errors. I can step through those recipes.
This is the initial error.
[Drupal\Core\Recipe\RecipePreExistingConfigException]
The configuration 'contact.form.feedback' exists already and does not match the recipe's configura
tion
Comment #17
thejimbirch commentedfeedback_contact_formis the only error. All the rest applied successfully on top of the standard profile.Can be applied
==============
administrator_role
article_comment
article_content_type
article_tags
audio_media_type
basic_block_type
basic_html_format_editor
basic_shortcuts
comment_base
content_editor_role
content_search
core_recommended_admin_theme
core_recommended_front_end_theme
core_recommended_maintenance
core_recommended_performance
document_media_type
editorial_workflow
example
full_html_format_editor
image_media_type
local_video_media_type
page_content_type
remote_video_media_type
restricted_html_format
standard_responsive_images
tags_taxonomy
Can't be applied
================
feedback_contact_form
standard
Comment #18
alexpottComment #19
phenaproximaComment #20
phenaproximaI can't reproduce @Prashant.c's result in #13. My steps, with this MR checked out:
Worked fine. What am I missing?
Comment #21
prashant.cThanks @phenaproxima
Now we can reapply the same recipe any number of times without facing any issues. Looks good to me.
I think we can move it to NR or RTBC.
Comment #22
phenaproximaI guess I'll just restore RTBC, then!
To confirm, I was able to reproduce the problem in #17 with this command sequence:
But that is not an idempotency issue, that's because the contact form recipe hard-codes an email address that's different from the one the Standard profile puts into the feedback form. This will be fixed as part of #3303126: Make it possible for recipes to prompt for input values, so it's not in scope here.
Comment #23
alexpottBackported to 10.3.x because recipes are not API and the whole thing is not stable yet anyway!
Committed and pushed 9f3ee1ff55 to 11.x and 3fd22d6b62 to 11.0.x and f734ef114e to 10.4.x and 22972e3764 to 10.3.x. Thanks!