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.

Issue fork drupal-3437587

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

narendraR created an issue. See original summary.

narendrar’s picture

Status: Active » Needs review
wim leers’s picture

Status: Needs review » Reviewed & tested by the community

Looks perfect! 🤩

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed 61ac8eb21c to 11.x and f376c17681 to 10.3.x. Thanks!

  • alexpott committed f376c176 on 10.3.x
    Issue #3437587 by narendraR, Wim Leers: Add validation constraints to...

  • alexpott committed 61ac8eb2 on 11.x
    Issue #3437587 by narendraR, Wim Leers: Add validation constraints to...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.