Problem/Motivation

  1. Numerous bugs are caused by code expecting config to contain certain key-value pairs and expect those values to be a certain shape, but they aren't
  2. 👆 This often leads to broken update paths!
  3. Very often working on core is slowed down by invalid configuration in an existing test or new tests.
  4. Sites using configuration management often have to deal with hard-to-understand config diffs, and worse, when using modules like https://www.drupal.org/project/config_split, chances are that the resulting config is invalid.
  5. Recipes will install modules/themes, apply other recipes, but will primarily be installing and updating configuration. Combining many recipes == combining lots of config. This results in a Cambrian explosion of config, and will make it very probable that a combination of recipes results in a broken ("misconfigured") site. UNLESS we make config validatable, and validate config after applying a recipe: #3405328: [meta] Make recipes safer to use in the real world by supporting config validation and rolling back a broken recipe
  6. We'd like to be able to enable new use cases for Drupal, such as decoupled admin UIs, but that requires the ability to safely modify configuration via APIs, and hence needs thoroughly validatable config. That would unblock #2300677: JSON:API POST/PATCH support for fully validatable config entities.

All of these can be solved by getting Drupal core to 100% validatability! And after core, contrib.

Steps to reproduce

See above.

Proposed resolution

  1. Add missing infrastructure.
  2. Add validation constraints to all config.

Remaining tasks

🙏 Use the tags Configuration schema, validation on all issues.

Core-wide patterns
  1. ❌ 100% of simple config should become validatable: #2952037: [meta] Add constraints to all simple configuration
  2. ❌ 100% of config entity types should become validatable: #2869792: [meta] Add constraints to all config entity types
  3. ❌ 100% of simple config with admin UIs/forms in core should support validation constraints: #3384790: Update all remaining ConfigFormBase subclasses in Drupal core to use #config_target
  4. ❌ Make Drupal updates more reliable: #3415061: Make update paths for config more reliable: check validation constraints in update path tests
Missing infrastructure

User interface changes

TBD

API changes

TBD

Data model changes

TBD

Release notes snippet

All config in Drupal core is now fully validatable.

Comments

Wim Leers created an issue. See original summary.

wim leers’s picture

Issue summary: View changes
wim leers’s picture

Issue summary: View changes
wim leers’s picture

Issue summary: View changes
thejimbirch’s picture

Well done.

wim leers’s picture

Issue summary: View changes

Made the summary more complete. And marked #2164373 fixed with an explanation for why: #2164373-48: [META] Untie config validation from form validation — enables validatable Recipes, decoupled admin UIs … — tl;dr: it has fulfilled its purpose 😊

narendrar’s picture

Issue summary: View changes

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.