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

Comments

nedjo created an issue. See original summary.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

nedjo’s picture

nedjo’s picture

Title: Provide a ConfigDiffer with normalization to support comparing extension-provided to installed configuration » Provide a configuration normalizer to support comparing extension- and recipe-provided to installed configuration
nedjo’s picture

Title: Provide a configuration normalizer to support comparing extension- and recipe-provided to installed configuration » Add a ::normalize() method to config entities to support comparing extension- and recipe-provided to installed configuration
Project: Drupal core » Recipes Initiative
Version: 9.5.x-dev » 10.0.x-dev
Component: configuration system » Code
Issue summary: View changes
Parent issue: #2960999: Support updating extension-provided config via configuration synchronization API and UI » #3283900: Define recipe runtime configuration update requirements
Related issues: +#2960999: Support updating extension-provided config via configuration synchronization API and UI

Moving into the Distributions and Recipes initiative as a child of #3283900: Define recipe runtime configuration update requirements.

nedjo’s picture

Issue summary: View changes

Specific use cases are listed as sub-issues of #3007481: Assess and address changes applied at install time.

thejimbirch’s picture

Version: 10.0.x-dev » 11.x-dev
bsnodgrass’s picture

Project: Recipes Initiative » Drupal core
Component: Code » recipe system
Issue tags: +Recipes initiative

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.