computerminds / cm_config_tools

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

Unmanaged config is listed as managed too. Weird! #22

Closed anotherjames closed 7 years ago

anotherjames commented 7 years ago

(This is because 'managed' is our list of config-to-export, previously just under 'config_devel'.)

anotherjames commented 7 years ago

This turns out to be due to where we've come from (config_devel + drush_cmi_tools), and a misunderstanding around the create_only use case / implementation.

So, plan:

1) The normal use case, and the implicit dependencies, will continue as they are, using the 'managed' key. Deletes will continue as they are too, under their own key. 2) Imports (cmci) should only import what is listed under 'managed' (rather than just whatever exists in the /config/install directory), but they should also create any inexistent items listed under 'unmanaged'. 3) Files in /config/install that are not listed anywhere under the cm_config_tools section of the info file would be installed on module install (as per core behaviour), but would not otherwise be part of any of the cm_config_tools usage. 4) Exports (cmce) should export anything listed as managed, but for anything listed as 'unmanaged', they should only create files, but never overwrite/update them. 5) It should be possible to list something as both 'managed' and 'unmanaged'. This is weird, but has the behaviour of allowing updates on export, but not on import. This is left as a weird edge case because it's not expected to be a common use case anyway, but as it can be handled anyway, we may as well leave it that way (and therefore there is no need to throw exceptions about it).

So, in priority order (i.e. rules nearer the top will be respected ahead of those nearer the bottom):

(Other external conditions may still apply to interfere ahead of those rules.)

anotherjames commented 7 years ago

Hang on, that's not going to work, because implicit dependencies aren't listed under in the info file's cm_config_tools section. HMM. How do we tell the difference then between an implicit dependency that has changed and therefore does want to be imported, and a config item that has changed but is only for module installation, not importing?

anotherjames commented 7 years ago

...conclusion made after talks with @stevetweeddale : we add a new 'implicit' key to the cm_config_tools section, as that will also enable #6.

anotherjames commented 7 years ago

Resolved in latest commit(s) f308428adc0487fea0e61071f86aa62c1685daf9.