Add a ::normalize() method to config entities to support comparing extension- and recipe-provided to installed configuration

Created on 14 April 2018, over 6 years ago
Updated 21 May 2024, 7 months ago

Problem/Motivation

When comparing extension-provided configuration to the installed version to determine if there are changes, certain forms of normalization are necessary. Certain properties, such as a top-level uuid and _core property, are set on install and therefore are not present in the configuration as provided. Various programmatic changes are made to extension-provided config at install time or post-install that will show up as changes when comparing against the active configuration storage. Specific cases are listed as sub-issues of #3007481: Assess and address changes applied at install time . Also, there may be insignificant differences in sorting.

Normalization is needed to avoid spurious diffs when answering questions such as:

  • Is the provided configuration the same as that saved to the active configuration storage?
  • What configuration updates are available?

A current use case in core is in the Distributions and Recipes initiative, see #3283900-6: Define recipe runtime configuration update requirements .

The ConfigDiffer class in Configuration Update Manager partially addresses this need.

A more comprehensive contrib approach (though still incomplete, see open issues on the module) is in th 8.x-1.x branch of Configuration Normalizer .

However, both of these approaches are workarounds. Config Normalizer, in particular, needs to special-case specific config entity types by writing plugins to address their particular quirks.

Proposed resolution

Add a ::normalize() method to config entities. When called, it makes changes that prepare config for comparison.

Implement the method in config entity types as needed.

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

11.0

Component

Code

Created by

🇨🇦Canada nedjo

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