computerminds / cm_config_tools

DEPRECATED: Mirror of http://cgit.drupalcode.org/cm_config_tools
1 stars 0 forks source link

Implement cd-md in cm_config_tools #25

Closed amoebanath closed 7 years ago

amoebanath commented 7 years ago

We've advanced a bit ahead of config_devel, and now config_devel's cd-md command won't pick up config listed under cm_config_tools in the .info.yml file. We need to write our own implementation of that command that works for config under the cm_config_tools section.

anotherjames commented 7 years ago

This relates to #3 too btw. The key really is to have a way of suggesting things to export, i.e. dependants, as we already export implied/explicit dependencies.

anotherjames commented 7 years ago

Documentation in projects needs updating too, as cd-md just ain't going to work with the latest cm_config_tools, as config has moved out of the config_devel key in info files.

anotherjames commented 7 years ago

@amoebanath if you were interested, for a first quick win on this, you could provide a simple patch for cm_config_tools that brings the cd-md drush command from the config_devel patch over into cm_config_tools.drush.inc , just renaming things from config_devel->cm_config_tools?

I won't have much time to work on getting the 'proper' way of doing this, but would gladly commit that for now if we can get it working. Could even do it on a d.o issue if you like - issues on this github repo are more like 'ideas' / meta-issues. I don't mind.

Maybe rename the command 'cm-config-tools-suggest', with alias 'cmcs'?

I'd be very happy to discuss :-)

amoebanath commented 7 years ago

@anotherjames is it worth copying over all the related functions that are called? Or just the ones we need to tweak?

amoebanath commented 7 years ago

Ooh, we could remove config_devel as a dependency if we copied the whole lot :)

anotherjames commented 7 years ago

@amoebanath good point. OK, I've had a look at the code, and actually our own version of what's needed is actually closer than I thought.

\Drupal::service('cm_config_tools')->getExtensionConfigSuggestions() would basically do the trick already. So just set up the drush command to call that, passing through the module/extension argument. After that, we should just look at resolving the todo (in the doxygen, i.e. about $all) for that method.

I don't mind keeping the config_devel dependency for now -- it's not actually necessary at the moment either, but we're not going to have a site using cm_config_tools but not config_devel, at least not yet.

anotherjames commented 7 years ago

A quick explanation btw: cm_config_tools brings in dependencies on export already, so the direction parameter that is passed to drush cd-md is already more than needed -- we only need one direction (things that are dependant on the current config) -- which that getExtensionConfigSuggestions() method returns.

anotherjames commented 7 years ago

@amoebanath Please can you open a PR here with https://www.drupal.org/files/issues/drush_command_for-2850106-4.patch applied to it? Then we can review the code easier here :-)

anotherjames commented 7 years ago

Done :-)