Closed gaelg closed 7 years ago
Confirmed. :(
drush config-import also affected.
still a problem in 8.0.2, for now one could add the dependent config files to a .gitignore until solved
This issue is independent from git.
yes of course. I was merely pointing out that, in the meantime, you could add the created dependent configuration .yml files (for example devel.settings.yml) to a .gitignore until this issue is resolved.
I tried to work on this, but it's harder than I expected. The storage filters are called with source config objects only, so that there is no way to filter out a destination config object using storage filters. I'll try to find another way.
Here's what I did today: https://github.com/gaelg/drush/commit/44887b11bada471f0fe90a6591abbe7d54c47053 Any help would be very appreciated, specially to improve dependency detection and to make tests.
I improved dependency detection and fixed a bug. system.menu.devel is still not ignored, but this is because Devel should enforce the dependency for this config (https://www.drupal.org/node/2404447). It seems to work well. Should I make a pull request, or should this still be improved before any pull?
Thanks for working on this. I haven't had a chance to review the referenced branch yet, but it is always okay to make a work-in-progress PR.
It would be nice if someone in this issue queue could write up tests for this. I'll do it when I get time otherwise. The tests could be: For export :
For import :
I said Devel but it might be better to test with a module which has chained dependencies (which one ?).
NB: It make me think that dependent modules should also be ignored, but that might be another issue for later? (it's easy to just add them in the command)
I made an issue about the devel problem: https://www.drupal.org/node/2663558
gaelg: not work :(
Is this issue related to #1964
Yes, I'm not very used to GitHub. I first made an "issue", and then a related pull request.
Meanwhile, you may use this tool from here https://github.com/previousnext/drush_cmi_tools It works like charm for me.
While watching this really good presentation on config management from DrupalCon Dublin (https://www.youtube.com/watch?v=57t_CS2wbHI) I learned about Config Split which handles the same use case: https://www.drupal.org/project/config_split
@stevector Config Split does resolve this issue on a broader level. I'm currently using it on several projects successfully. I'm using it to split config based on environment (prod, test/staging, dev) and import based on environment with a script.
Perhaps the larger question then is: Does this need to be part of Drush?
Sure it does. Drush allows you to skip modules like when you have the following in your drushrc.php for example:
// Ignore development modules when exporting/importing configuration.
$development_modules = ['devel', 'webprofiler'];
$command_specific['config-export']['skip-modules'] = $development_modules;
$command_specific['config-import']['skip-modules'] = $development_modules;
This prevents that these module will get added to core.extensions.yml
. So why not skip the other *.yml
files related to these modules, too? (Which in this example at least are devel.settings.yml
and webprofiler.config.yml
.)
The "skip-modules" option was removed on drush 8.1.11 https://github.com/drush-ops/drush/releases/tag/8.1.11
This issue should be closed
It was removed in favour of Config Split so yes, we can close this.
Wow, good to know. Thanks for the clarification.
If one skips some module (let's say Devel) when exporting configuration, the dependent config entities won't be skipped (you'll still get a devel.settings.yml file in the export). And this can break the import in another instance of the same site, because of dependency validation. The error will come from https://api.drupal.org/api/drupal/core!lib!Drupal!Core!EventSubscriber!ConfigImportSubscriber.php/function/ConfigImportSubscriber%3A%3AvalidateDependencies/8