Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294298

[meta] Make config schema checking something that can be ignored when testing against older core branches

$
0
0

Problem/Motivation

This is via a live conversation with @alexpott, hopefully I'm summarising it correctly.

#784672: Allow text field to enforce a specific text format introduced a new key for text fields 'allowed_formats'.

If a module or distribution ships a configuration file with 'allowed_formats', it will restrict the list of formats for the text field from 10.1 onwards.

In 10.0.0 and 9.5.x, this feature doesn't exist. At runtime, the system will just ignore the key it doesn't understand, and the text field will show all the formats. So the older sites don't get the benefit of the new feature, but also nothing breaks. This is fine.

However, if the module or distribution runs tests against 10.0 or 9.5, those tests will fail with SchemaIncompleteException

You can set KernelTestBase::strictConfigSchema to FALSE, but then none of your schema will be checked on any of your branches.

Steps to reproduce

Proposed resolution

  1. #3364109: Configuration schema & required values: add test coverage for `nullable: true` validation support (corresponds roughly to #23 through #25), which blocks:
  2. #3364108: [PP-1] Configuration schema & required keys
  3. One possibility might be something like this:

    Instead of throwing exceptions, trigger_error('....', E_USER_DEPRECATED). The advantage of this would be that tests against 10.1 could be run with deprecation failures enabled, but tests against 10.0 and 9.5 could be run without.

    However, not all config errors are 'deprecations' so it's possibly semantically not the right approach.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 294298

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>