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

Add validation constraints to system.performance

$
0
0

Problem/Motivation

system.performance has 4 property path that are not yet validatable:

./vendor/bin/drush config:inspect --filter-keys=system.performance --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.performance                              Correct   76%           ✅❓   ValidKeys: '<infer>'                      
   system.performance:                            Correct   Validatable   ✅✅   ValidKeys: '<infer>'                      
   system.performance:_core                       Correct   Validatable   ✅✅   ValidKeys:                                
                                                                                   - default_config_hash                   
   system.performance:_core.default_config_hash   Correct   Validatable   ✅✅   NotNull: {  }                             
                                                                                 Regex: '/^[a-zA-Z0-9\-_]+$/'              
                                                                                 Length: 43                                
                                                                                 ↣ PrimitiveType: {  }                     
   system.performance:cache                       Correct   Validatable   ✅✅   ValidKeys: '<infer>'                      
   system.performance:cache.page                  Correct   Validatable   ✅✅   ValidKeys: '<infer>'                      
   system.performance:cache.page.max_age          Correct   NOT           ✅❓   ⚠️  @todo Add validation constraints here  
   system.performance:css                         Correct   Validatable   ✅✅   ValidKeys: '<infer>'                      
   system.performance:css.gzip                    Correct   Validatable   ✅✅   ↣ PrimitiveType: {  }                     
   system.performance:css.preprocess              Correct   Validatable   ✅✅   ↣ PrimitiveType: {  }                     
   system.performance:fast_404                    Correct   Validatable   ✅✅   ValidKeys: '<infer>'                      
   system.performance:fast_404.enabled            Correct   Validatable   ✅✅   ↣ PrimitiveType: {  }                     
   system.performance:fast_404.exclude_paths      Correct   NOT           ✅❓   ⚠️  @todo Add validation constraints here  
   system.performance:fast_404.html               Correct   NOT           ✅❓   ⚠️  @todo Add validation constraints here  
   system.performance:fast_404.paths              Correct   NOT           ✅❓   ⚠️  @todo Add validation constraints here  
   system.performance:js                          Correct   Validatable   ✅✅   ValidKeys: '<infer>'                      
   system.performance:js.gzip                     Correct   Validatable   ✅✅   ↣ PrimitiveType: {  }                     
   system.performance:js.preprocess               Correct   Validatable   ✅✅   ↣ PrimitiveType: {  }                     
 ----------------------------------------------- --------- ------------- ------ ------------------------------------------

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.performance --detail --list-constraints

Proposed resolution

Add validation constraints to:

  1. system.performance:cache.page.max_age
  2. system.performance:fast_404.exclude_paths
  3. system.performance:fast_404.html
  4. system.performance:fast_404.paths

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.


Viewing all articles
Browse latest Browse all 293910

Trending Articles



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