Add validation constraints to system.diff

Created on 2 April 2024, 5 months ago
Updated 16 April 2024, 5 months ago

Problem/Motivation

system.diff has 2 property path that are not yet validatable:

./vendor/bin/drush config:inspect --filter-keys=system.diff --detail --list-constraints
โžœ  ๐Ÿค– Analyzingโ€ฆ

 Legend for Data: 
  โœ…โ“  โ†’ Correct primitive type, detailed validation impossible.
  โœ…โœ…  โ†’ Correct primitive type, passed all validation constraints.
 ---------------------------------------- --------- ------------- ------ ------------------------------------------ 
  Key                                      Status    Validatable   Data   Validation constraints                    
 ---------------------------------------- --------- ------------- ------ ------------------------------------------ 
  system.diff                              Correct   67%           โœ…โ“   ValidKeys: '<infer>'                      
   system.diff:                            Correct   Validatable   โœ…โœ…   ValidKeys: '<infer>'                      
   system.diff:_core                       Correct   Validatable   โœ…โœ…   ValidKeys:                                
                                                                            - default_config_hash                   
   system.diff:_core.default_config_hash   Correct   Validatable   โœ…โœ…   NotNull: {  }                             
                                                                          Regex: '/^[a-zA-Z0-9\-_]+$/'              
                                                                          Length: 43                                
                                                                          โ†ฃ PrimitiveType: {  }                     
   system.diff:context                     Correct   Validatable   โœ…โœ…   ValidKeys: '<infer>'                      
   system.diff:context.lines_leading       Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here  
   system.diff:context.lines_trailing      Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here  
 ---------------------------------------- --------- ------------- ------ ------------------------------------------ 

Steps to reproduce

  1. Get a local git clone of Drupal core 10.3.x.
  2. composer require drupal/config_inspector โ€” or manually install https://www.drupal.org/project/config_inspector/releases/2.1.5 โ†’ or newer (which supports Drupal 11!)
  3. composer require drush/drush
  4. vendor/bin/drush config:inspect --filter-keys=system.diff --detail --list-constraints

Proposed resolution

Add validation constraints to:

  1. system.diff:context.lines_leading
  2. system.diff:context.lines_trailing

For examples, search *.schema.yml files for the string constraints: ๐Ÿ˜Š

Reach out to @borisson_ or @wimleers in the #distributions-and-recipes.

Remaining tasks

User interface changes

None.

API changes

Data model changes

More validation ๐Ÿš€

Release notes snippet

None.

๐Ÿ“Œ Task
Status

Fixed

Version

10.3 โœจ

Component
Systemย  โ†’

Last updated 1 day ago

No maintainer
Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia narendraR Jaipur, India

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024