Problem/Motivation

Actions module provides configuration action.settings.recursion_limit which is not used by core (except tests and migrations)

Proposed resolution

Remove it and fix tests with some other useful config

Remaining tasks

- Remove config
- Fix tests
- Decide about migrations
- Add update hooks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#47 3022401-actions-config-47.patch17.3 KBandypost
#47 interdiff.txt553 bytesandypost
#46 3022401-46.patch17.33 KBandypost
#46 interdiff.txt3.02 KBandypost
#43 3022401-43.patch14.62 KBandypost
#43 interdiff.txt1.04 KBandypost
#41 Screenshot from 2019-10-29 11-25-39.png95.98 KBthalles
#30 interdiff_28-30.txt274 bytesvacho
#30 3022401-actions-config-30.patch14.37 KBvacho
#28 3022401-actions-config-28.patch14.34 KBandypost
#20 3022401-20.patch14.34 KBandypost
#20 interdiff.txt590 bytesandypost
#17 3022401-17.patch14.42 KBandypost
#17 interdiff.txt1.59 KBandypost
#16 3022401-16.patch15.57 KBandypost
#16 interdiff.txt1.41 KBandypost
#15 3022401-15.patch15.04 KBandypost
#15 interdiff.txt1.57 KBandypost
#13 3022401-13.patch14.96 KBandypost
#13 interdiff.txt771 bytesandypost
#7 3022401-7.patch14.37 KBandypost
#7 interdiff.txt12.86 KBandypost
#5 3022401-5.patch10.42 KBandypost
#5 interdiff.txt5.21 KBandypost
#2 3022401-2.patch5.81 KBandypost
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andypost created an issue. See original summary.

andypost’s picture

Status: Active » Needs review
FileSize
5.81 KB

First attempt

Status: Needs review » Needs work

The last submitted patch, 2: 3022401-2.patch, failed testing. View results

mikelutz’s picture

+++ /dev/null
@@ -1,9 +0,0 @@
diff --git a/core/modules/action/migrations/action_settings.yml b/core/modules/action/migrations/action_settings.yml
deleted file mode 100644
index 4d332f801d..0000000000
--- a/core/modules/action/migrations/action_settings.yml
+++ /dev/null
@@ -1,16 +0,0 @@

We can't just delete migrations. They are technically plugin definitions, so they need to be deprecated.
If the actions_max_stack variable truly has no counterpart in D8 and the migration is useless, then you can to set it to use a null source and destination, remove it from the Drupal 6 and Drupal 7 groups so it isn't run, mark it deprecated and throw a trigger error somewhere, probably the migration constructor.

andypost’s picture

Status: Needs work » Needs review
FileSize
5.21 KB
10.42 KB

Added update hook and trying to fix test

@mikelutz thank for pointer - I will try to dig how to skip migration or point it to null storage

Status: Needs review » Needs work

The last submitted patch, 5: 3022401-5.patch, failed testing. View results

andypost’s picture

Status: Needs work » Needs review
FileSize
12.86 KB
14.37 KB

Here's rework of patch
- #4 set to null plugins and reverted tests, @mikelutz I have no idea why that fails locally
- replaced action with automated cron module in tests

Status: Needs review » Needs work

The last submitted patch, 7: 3022401-7.patch, failed testing. View results

andypost’s picture

Issue tags: +@deprecated, +Needs tests
YurkinPark’s picture

Migrate checks all migrations for source plugins existing. It happens in \Drupal\migrate\Plugin\MigrationPluginManager::getDiscovery . Seems like \Drupal\Tests\action\Kernel\Migrate\d6\MigrateActionConfigsTest can not be passed with such changes.

mikelutz’s picture

I'm going to need to dig into this a bit more and see what they best thing to do it. We've never deprecated a whole migration without a replacement before that I'm aware of, so we need a way to render it inert while still allowing it to be instantiated and ran. I thought we could do it with th enull plugins, but since they aren't stub migrations, the requirements system is rejecting them. We may have to do something hacky like using an embedded data source with no rows (which might not even work)

andypost’s picture

Maybe we can keep migrations in-place just point destination to some no-op (null does not work for some reason)

But what it really need is anounce that this migration does nothing and change record

andypost’s picture

Status: Needs work » Needs review
FileSize
771 bytes
14.96 KB

Fixed source and used to add nowhere plugin for destination because null has requirements_met = false in its annotation

Status: Needs review » Needs work

The last submitted patch, 13: 3022401-13.patch, failed testing. View results

andypost’s picture

Status: Needs work » Needs review
FileSize
1.57 KB
15.04 KB

Another attempt - fix config destination to skip import if name is null
Probably it needs test to expect that behavior

andypost’s picture

Fix test

andypost’s picture

@mikelutz skip on empty works with empty source!

The last submitted patch, 15: 3022401-15.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 17: 3022401-17.patch, failed testing. View results

andypost’s picture

quietone’s picture

Issue tags: +migrate-d6-d8, +migrate-d7-d8

Since this is deprecating a migration adding some migrate tags.

andypost’s picture

Issue tags: -Needs tests

I bet no tests needed

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mikelutz’s picture

The migration handling here looks to be correct for now, and has my sign-off as a migration sub-system maintainer. Migrations are plugins, they cannot simply be removed or it is considered a BC break because someone might be relying on their plugin id. The plugin implementation can change without a bc break provided the id and signature remain. This migration serves no purpose as the config it imports is never used. Removing its functionality is not a BC break because the plugin implementation still exists with all methods.

This patch renders the migration useless without removing it. A normal plugin would be deprecated and marked for removal, but we have recently realised that we do not currently have a mechanism to deprecate a migration yml and mark it for removal. A follow up to this will be in #3039240: Create a way to declare a plugin as deprecated. When we decide on and implement a process for deprecation of migration ymls, we will include this migration as the first one to be deprecated.

The remainder of the patch and test changes look correct to me, but I will leave for someone with more domain knowledge around this particular config to RTBC.

naveenvalecha’s picture

Looks pretty neat. We need the Update test to verify that the configuration deleted after the update hook.

+++ b/core/modules/config/tests/config_import_test/src/EventSubscriber.php
@@ -87,10 +87,10 @@ public function onConfigImporterMissingContentTwo(MissingContentEvent $event) {
+    if ($config->getName() == 'automated_cron.settings') {

How this is related to the scope of this issue? Shouldn't this be a separate issue?

andypost’s picture

@naveenvalecha that change is required to fix test that using subject

andypost’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
andypost’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
14.34 KB

still needs upgrade tests and probably other fixes for migrations

Status: Needs review » Needs work

The last submitted patch, 28: 3022401-actions-config-28.patch, failed testing. View results

vacho’s picture

andypost’s picture

Status: Needs work » Needs review
andypost’s picture

+++ b/core/modules/action/tests/src/Kernel/Migrate/d6/MigrateActionConfigsTest.php
@@ -28,12 +28,11 @@ protected function setUp() {
+    $this->assertTrue($config->isNew());

+++ b/core/modules/action/tests/src/Kernel/Migrate/d7/MigrateActionConfigsTest.php
@@ -28,12 +28,11 @@ protected function setUp() {
+    $this->assertTrue($config->isNew());

I guess it does not need upgrade tests because this config is unused and migrations has coverage

The last submitted patch, 28: 3022401-actions-config-28.patch, failed testing. View results

The last submitted patch, 28: 3022401-actions-config-28.patch, failed testing. View results

alexpott’s picture

This config was made obsolete by #1846172: Replace the actions API

Then, another thing the current action system does is tracking the number of recursive calls and caring about recursion. I don't think that's something the action system should take care of. It should provide me with an action that I can execute - whether this creates a recursive loop is up to the calling code; usually (think VBO) it won't. Recursions may occur in the regular trigger/rules use-case, but then it's caused by the triggering logic so the check should be there.

I'm not sure we've removed a whole config file before. I wonder about the BC implications of this and whether a module's configuration forms part of its API. Other modules could be doing something like \Drupal::config('action.settings')->get('recursion_limit') for what its worth. https://www.drupal.org/core/d8-bc-policy does not mention config.

The last submitted patch, 28: 3022401-actions-config-28.patch, failed testing. View results

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -Needs release manager review +Needs change record

Discussed with @catch. This issue needs a change record - https://www.drupal.org/node/add/changenotice?field_project=3060&field_is...

@catch felt that config is along the lines of schema or data structure. Meaning he think's we can remove it with a change record. There's bound to be cases where that's harder because people actually check the value directly, but as a general rule.

andypost’s picture

andypost’s picture

Status: Needs work » Needs review

Patch still applies cleanly

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

thalles’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
95.98 KB

The tests run to me!

catch’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/action/action.install
@@ -0,0 +1,13 @@
+
+/**
+ * Removes the action.settings configuration.
+ */
+function action_update_8001() {
+  \Drupal::configFactory()->getEditable('action.settings')->delete();
+}

This should be a hook_post_update_NAME() since it's just removing configuration not changing schema at all.

andypost’s picture

catch’s picture

Status: Needs review » Needs work

One more thing - we should probably have a test to ensure the hook_post_update_NAME() works, there is very similar test coverage in #2893795: Remove serialization.module BC layers for one example.

Assuming this comes back green it looks ready to go for me otherwise.

andypost’s picture

Assigned: Unassigned » andypost
Issue tags: +Needs upgrade path tests

yes, totally missed it

+++ b/core/modules/action/tests/src/Kernel/Migrate/d6/MigrateActionConfigsTest.php
@@ -28,12 +28,11 @@ protected function setUp() {
+    $this->assertTrue($config->isNew());

+++ b/core/modules/action/tests/src/Kernel/Migrate/d7/MigrateActionConfigsTest.php
@@ -28,12 +28,11 @@ protected function setUp() {
+    $this->assertTrue($config->isNew());

that's not enough because cobers only migrations

andypost’s picture

Assigned: andypost » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs upgrade path tests
FileSize
3.02 KB
17.33 KB

Here's a test

andypost’s picture

FileSize
553 bytes
17.3 KB

Fix CS

longwave’s picture

Status: Needs review » Reviewed & tested by the community

Updated the change record a little bit. Patch looks good to me, so RTBC.

  • catch committed 54e0602 on 9.0.x
    Issue #3022401 by andypost, vacho, thalles, mikelutz, alexpott, catch,...

  • catch committed 99133c0 on 8.9.x
    Issue #3022401 by andypost, vacho, thalles, mikelutz, alexpott, catch,...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 54e0602 and pushed to 9.0.x. Backported to 8.9.x. Thanks!

Status: Fixed » Closed (fixed)

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