Add validation constraints to system.cron

Created on 28 March 2024, 5 months ago
Updated 16 April 2024, 5 months ago

Problem/Motivation

system.cron has 3 property path that are not yet validatable:

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

Steps to reproduce

  1. Get a local git clone of Drupal core 11.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.cron --detail --list-constraints

Proposed resolution

Add validation constraints to:

  1. system.cron:logging
  2. system.cron:threshold.requirements_error
  3. system.cron:threshold.requirements_warning

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

11.0 ๐Ÿ”ฅ

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