Problem/Motivation
The Conditional split splits the entire config when it is not exactly the same.
It would be great if a split could split only parts of the config.
Either by defining keys like config_ignore does or by automatically splitting what is different to the sync directory.
Proposed resolution
When exporting a special config_split.partial.CONFIG_NAME is created which contains enough information to merge the partial config back when importing the config. When importing this special config is not imported but its content is merged to where it should be.
Remaining tasks
We need to have a service that can reliably create a "diff" of two configs such that it can be "applied" and produce the original config again.
User interface changes
new option on conditional split form to shallow split all.
allow CONFIG_NAME:key.name in conditional split text area
API changes
Data model changes
Original report:
Would it be possible to add the ability to override an individual parameter in a yml file?
Ex, I have my global simple_sitemap.settings.yml file at /config/default/simple_sitemap.settings.yml , and at /config/sites/site1/default/simple_sitemap.settings.yml i have just base_url: '<site1_base_url>' (and no other code) and at /config/sites/site2/default/simple_sitemap.settings.yml i have just base_url: '<site2_base_url>'
Issue fork config_split-2934170
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
Comment #2
luca_loguercio commentedComment #3
bircherThat is a great idea.
This would then become a partial split which we can do once we did: #2917831: Split the complete and conditional split in separate entities.
The reason for that is because now when reading from the split folder we can not know if the config is partial or complete, so we would have to do something similar as domain_config or alternatively use a different split folder.
Comment #4
nedjoIdeally we'd do this via adding support for one (or more) of the modules that support config alters, such as Config Actions, Configuration Rewrite, or Update Helper.
Or rather: ideally, we'd have such a solution in core, and build on that.
Comment #5
firewaller commented+1
Comment #6
bircherWe can do this in 2.x because we know more what is happening.
Also I closed #2917831: Split the complete and conditional split in separate entities.
Comment #7
bircherComment #9
anruetherThere is also config_dynamic_split which says it does this already.
Comment #10
birchercool! I quickly checked it from my phone.
It doesn't have any tests and it doesn't look like it does the sorting so that there won't be any unnecessary diffs. But otherwise it looks quite nice and we might draw some inspiration from it.
We need this feature in config_split ghough because it is also the base for other features, such as changing config as if modules that are split would be uninstalled.
Comment #11
bircherThe more I am tinkering with this the more I think this should just out right replace the functionality of the conditional split.
See also #3215319: Request for feedback: replace conditional split with partial split.
There is just some proof of concept code for now but it requires changing how the logic works to make #3170204: Add option to remove modules as if they were uninstalled work.
Comment #12
bircherpartial splits exist now. repurposing this issue for special handling for partially splitting keys.
ie you define which keys to partially split.
Comment #13
maskedjellybeanI'm very confused whether this functionality exists or not. The current module description indicates that it does:
But in practice I haven't been able to get it to work.
For example say I have a Search API index config file in the default config directory called search_api.example_index.yml.
Then I modify the currently active config split and add a specific key from search_api.example_index.yml to the Partial split Additional configuration field:
search_api.index.example_index.third_party_settings.search_api_solr.advanced.index_prefix
Then I export config. I would expect a patch file to be created within the directory for the currently active config split which contains only what's necessary to set that specific key.
Instead, search_api.example_index.yml is updated in the default config directory and no patch is created anywhere.