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>'

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

luca_loguercio created an issue. See original summary.

luca_loguercio’s picture

Issue summary: View changes
bircher’s picture

That 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.

nedjo’s picture

Ideally 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.

firewaller’s picture

+1

bircher’s picture

Title: Allowing individual parameters to be overridden » Add shallow split
Version: 8.x-1.3 » 2.0.x-dev

We 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.

bircher’s picture

Issue summary: View changes
Related issues: +#3191356: Create option for config diff

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

anruether’s picture

There is also config_dynamic_split which says it does this already.

bircher’s picture

cool! 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.

bircher’s picture

Title: Add shallow split » Add partial split

The 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.

bircher’s picture

Title: Add partial split » Add partial split for specific keys

partial splits exist now. repurposing this issue for special handling for partially splitting keys.

ie you define which keys to partially split.

maskedjellybean’s picture

I'm very confused whether this functionality exists or not. The current module description indicates that it does:

Key difference: 1.x could only split the whole config files. 2.x can split individual keys by creating a "config patch" file. This is turned on by default and you can switch it back to the 1.x behaviour by configuring your split to "Do not patch dependents".

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.