How to reproduce:

- install config_distro module (I tried it with confic_sync suite)
- do some edits on configuration items in a custom module's /config/install folder
- run drush config-distro-update

Expected: the changes would be detected and offered to update
Actual: no changes to import

A workaround to fix is to rebuild caches using "drush cr" command before. Then, running "drush config-distro-update" again detects the change correctly.

Also, running the same from UI (/admin/config/development/configuration/distro) works properly. So I would guess there is some cache invalidation problem in drush version only.

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

mirsoft created an issue. See original summary.

nedjo’s picture

Project: Config Distro » Configuration Synchronizer

Config Distro doesn't itself add any updates but only provides the means for other modules to do so. Therefore moving this bug to Configuration Synchronizer.

a.dmitriiev’s picture

Maybe drush command misses the change https://git.drupalcode.org/project/config_sync/-/commit/1bed6aeae98c1ac7... that was added to ConfigSyncForm for clearing the filters cache?

// Ensure the filters reflect the current state of the file system.
    $this->configFilterManager->clearCachedDefinitions();

So if the same change is added to config distro (cd-update command) it will show the changes during the run without clearing the caches (drush cr) before?

a.dmitriiev’s picture

Status: Active » Needs work
a.dmitriiev’s picture

Project: Configuration Synchronizer » Config Distro
Status: Needs work » Needs review
StatusFileSize
new2.88 KB

Moving back to config distro with patch that fixes the problem.

a.dmitriiev’s picture

Version: 8.x-1.0-alpha3 » 8.x-1.x-dev
Priority: Major » Normal
nedjo’s picture

Thanks for tracking this bug down. The fix indeed looks correct.

But we're about to remove the config_filter dependency in #3080778: New API for config_distro modelled after the new CMI2 config transformation API . We could consider moving this to the config_distro_filter submodule proposed in that issue, but my feeling is it's best to expect modules still using config_filter to take responsibility. In the config_sync case, this would mean altering the Drush command provided by config_distro. As it happens, that's something we should be doing anyway, per #2997360: Add Drush command for the "reset" update mode. So I think this belongs back in config_sync via a Drush command alter.

nedjo’s picture

Project: Config Distro » Configuration Synchronizer

Moving to Configuration Syncrhonizer per #7.

a.dmitriiev’s picture

Maybe it is better to use Event dispatch approach here? Config Distro dispatches now the event on successful import, let's add one more event before import, and in config sync event subscriber will clean the config filter caches? This way we will not mess up with dependencies?

nedjo’s picture

@a.dmitriiev agreed, that sounds like a solid approach.

a.dmitriiev’s picture

Project: Configuration Synchronizer » Config Distro
a.dmitriiev’s picture

StatusFileSize
new6.05 KB

I move the issue back to config distro, because it belongs here, as config_distro_filter module can also react on the new event.

I will create a follow up issue in config_sync module to react on PRE_IMPORT event, in case config_distro_filter module is not enabled (for the future cases when config_filter module will not be used anymore).

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

trackleft2’s picture

Version: 8.x-1.x-dev » 2.0.x-dev
trackleft2’s picture

I've updated the issue to add a merge request that attempts to update the patch with the 2.x version of config_distro in case this helps anyone.

I've also fixed some code style issues.

trackleft2’s picture

Version: 2.0.x-dev » 2.1.x-dev

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