Related to #2316909: Revisit all built-in test/default views configuration in core & #1938580: [META] Make active config save format match the default yml file (order and quotes)

Problem/Motivation

We have 140+ default/test views in core with configurations created by UI/hand and #2316909: Revisit all built-in test/default views configuration in core trying to regenerate them to update with new configuration structure changes. However this process is going to be a day-to-day task for the module maintainers/module that provides any configuration. The core configuration sync is more of focus on "updating one site's configuration to various environments". This process doesn't help individual module maintainer.

@alexpott created a script which refreshes the configurations. Because there is no order saving configuration, the configuration getting saved in random order on every refresh.

Proposed resolution

Fix the configuration order on save, so that it will follow some order.

Remaining tasks

Discuss
Patch
Test with @alexpott script.

User interface changes

N/A

API changes

N/A

Comments

YesCT’s picture

Issue tags: +Configuration system
vijaycs85’s picture

It looks like we have another proposal to achieve this very same goal using configuration schema at #2361539: Config export key order is not predictable for sequences, add orderby property to config schema . However I'm not very sure why this order need to be controlled by configuration schema or any other component for this matter. All we need is a common ordering. It doesn't really need to have option to manage/controlled.

Once we decide the solution we can close either this issue or #2361539: Config export key order is not predictable for sequences, add orderby property to config schema

Gábor Hojtsy’s picture

@vijaycs85: we need some way to order the elements, because otherwise they may randomly change order and produce diffs that look like changes but they are still the same file. If you randomly swap the order of the top level keys of a config file, it is still the same configuration data for a machine, nothing changed in the meaning of the file. But for a human to review the deployment diff it will be extremely hard. What other control would you use other than configuration schema?

Berdir’s picture

AFAIK we already do this for top-level config entity keys, as they are added to the array in the order they are defined in the schema by default.

tkoleary’s picture

xjm’s picture

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.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.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.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.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

alexpott’s picture