Add validation constraints to system.image and system.image.gd

Created on 10 April 2024, 8 months ago
Updated 28 April 2024, 7 months ago

Problem/Motivation

system.image and system.image.gd each has 1 property path that are not yet validatable:

./vendor/bin/drush config:inspect --filter-keys=system.image,system.image.gd --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.image                                 Correct   75%           โœ…โ“   ValidKeys: '<infer>'                      
   system.image:                               Correct   Validatable   โœ…โœ…   ValidKeys: '<infer>'                      
   system.image:_core                          Correct   Validatable   โœ…โœ…   ValidKeys:                                
                                                                                - default_config_hash                   
   system.image:_core.default_config_hash      Correct   Validatable   โœ…โœ…   NotNull: {  }                             
                                                                              Regex: '/^[a-zA-Z0-9\-_]+$/'              
                                                                              Length: 43                                
                                                                              โ†ฃ PrimitiveType: {  }                     
   system.image:toolkit                        Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here  
  system.image.gd                              Correct   75%           โœ…โ“   ValidKeys: '<infer>'                      
   system.image.gd:                            Correct   Validatable   โœ…โœ…   ValidKeys: '<infer>'                      
   system.image.gd:_core                       Correct   Validatable   โœ…โœ…   ValidKeys:                                
                                                                                - default_config_hash                   
   system.image.gd:_core.default_config_hash   Correct   Validatable   โœ…โœ…   NotNull: {  }                             
                                                                              Regex: '/^[a-zA-Z0-9\-_]+$/'              
                                                                              Length: 43                                
                                                                              โ†ฃ PrimitiveType: {  }                     
   system.image.gd:jpeg_quality                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.image,system.image.gd --detail --list-constraints

Proposed resolution

Add validation constraints to:

  1. system.image:toolkit
  2. system.image.gd:jpeg_quality

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 2 days 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