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.

CommentFileSizeAuthor
#15 3439932-nr-bot.txt90 bytesneeds-review-queue-bot

Issue fork drupal-3439932

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.

phenaproxima made their first commit to this issue’s fork.

phenaproxima’s picture

Status: Active » Needs review

This is probably ready to go...

wim leers’s picture

Status: Needs review » Reviewed & tested by the community

No hesitations — this looks perfect 😊

wim leers’s picture

Status: Reviewed & tested by the community » Needs work

… except a single test (ToolkitSetupFormTest) just failed 😅🙈

phenaproxima’s picture

Status: Needs work » Needs review

Ugh, gotta work around the langcode thing.

wim leers’s picture

Status: Needs review » Reviewed & tested by the community
larowlan’s picture

Title: Add validation constraints to system.image » [PP-1] Add validation constraints to system.image
Status: Reviewed & tested by the community » Postponed
Related issues: +#3427564: Require `langcode: …` only for simple config that contains translatable values

#3427564: Require `langcode: …` only for simple config that contains translatable values is RTBC so let's postpone on that so we don't need the todo.

narendrar’s picture

Title: [PP-1] Add validation constraints to system.image » [PP-1] Add validation constraints to system.image and system.image.gd
Issue summary: View changes
wim leers’s picture

Title: [PP-1] Add validation constraints to system.image and system.image.gd » Add validation constraints to system.image and system.image.gd
Issue tags: +Needs reroll
wim leers’s picture

Status: Postponed » Needs work
phenaproxima’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll

Workarounds removed.

phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community

Tests passing and all I did was remove the workarounds for langcode, so restoring the previous RTBC.

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new90 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

phenaproxima’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: +no-needs-review-bot

Get lost, bot!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed 68628ccef2 to 11.x and 18cbe89f06 to 10.3.x. Thanks!

  • alexpott committed 18cbe89f on 10.3.x
    Issue #3439932 by phenaproxima, narendraR, Wim Leers, larowlan: Add...

  • alexpott committed 68628cce on 11.x
    Issue #3439932 by phenaproxima, narendraR, Wim Leers, larowlan: Add...

Status: Fixed » Closed (fixed)

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