Adopt ConfigPatch and ConfigPatchMerge from Config Split

Created on 22 August 2021, over 3 years ago
Updated 3 August 2024, 9 months ago

Problem/Motivation

Config Filter was originally part of Config Split. But after it matured a bit it became its own module providing a useful API for quite a big ecosystem of modules dealing with config management. Finally it moved to core in a very different shape as the config storage transformation API.

Now that we have the new API in core Config Split can tackle more complicated problems. One of them necessitates splitting individual config items. #3170204: Add option to remove modules as if they were uninstalled
In order to achieve this we need #3229247: Add service for creating config patches that can be saved and applied to the config again

This functionality is not inherently limited to Config Split, however. So it would make sense to move this to its own module. Config Merge seems to be a good candidate as it is an API-only module and concerns itself with the same problem space.

Proposed resolution

Create a 2.0.x branch and move the service class and the value object class to Config Merge. Replace the 3-way merging with a method on the service.
It needs to be a service rather than static method because we also (optionally) need to inject a normalizer/sorter.

Remaining tasks

Agree to this plan.
Find out what is needed for other modules for this to be useful.
Do it.

User interface changes

none

API changes

Static method becomes a method on the service.
Merging is done with drupals recursive array diff and array merge, so some difference may exist. See #3228934: Possible bug in merge test
Log is not available directly from merging but one can easily get the patch first and manually apply it. The log is mostly the same information as the patch.

Data model changes

none

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇨🇭Switzerland bircher 🇨🇿

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024