Updated: Comment #15
Problem/Motivation
While core no longer casts configuration to strings, HEAD has a lot of incorrect YAML files.
Proposed resolution
Write a script that uses the config schema to cast.
Remaining tasks
#13 committed the passing patch in #7
Review the attached no_schema.txt and do them manually. (See #15)
This task covered most of them except:
1) config that doesn't have a schema
2) config of test modules.
To deal with the remaining:
Approach 1: We can use those sub-tasks to validate and make sure all the type-castings are removed. If nothing else to do, we can close them.
Approach 2:
The no-schema list that chx attached in this issue (https://drupal.org/files/no_schema.txt) can be fixed, if we can add schema (also adding schema helps other places as well). So I thought below steps would be good to take in order
1. Provide missing schemas and get them into core.
2. Run @chx script and issue one more patch as Core config has everything as string - part 2
3. Then move to sub-tasks and do validation, etc (all the old story above).
This way we can make most of them done before move to sub-task.
For Approach 2 #1910624: [META] Introduce and complete configuration schemas in all of core tracks adding schemas. Go there to help. :)
User interface changes
None.
API changes
None.
Related Issues
#1653026: [META] Use properly typed values in module configuration
Comment | File | Size | Author |
---|---|---|---|
#10 | interdiff.txt | 6.72 KB | chx |
#10 | 2106459_10.patch | 182.25 KB | chx |
#9 | numbers.txt | 44.4 KB | chx |
#9 | files.txt | 6.4 KB | chx |
#7 | script.php_.txt | 2.27 KB | chx |
Comments
Comment #1
chx CreditAttribution: chx commentedImproved the discovery of config files so that we find them in the subdirectories. Up to 1464.
I have all modules enabled and now most configs get rewritten if it has a schema. The only exceptions are generated field.field.* , field.instance.* and taxonomy.vocabulary.forums . I think this is as complete as scripting can get.
Comment #2
chx CreditAttribution: chx commentedSmall opsie: I lost the comments from core/modules/filter/config/filter.format.plain_text.yml ; restored.
Comment #2.0
chx CreditAttribution: chx commentedUpdated issue summary.
Comment #3
andypostRelated issues about forum
#2090139: Warning: Illegal string offset 'callable' in rdf_rdfa_attributes() (line 181 of core/modules/rdf/rdf.module).
#2077435: Use a yml file to create the forum vocabulary
Comment #5
chx CreditAttribution: chx commentedHere, this avoids adding NULLs which caused the fails (we added permissions: null to the anonymous role because the system was descending and thus creating every key that had a schema even if it didn't actually exist in config) and avoids rewriting files not needing rewriting. 1442 conversions done.
Comment #6
tim.plunkettOnly noticed two problems.
I think this should have had a
status: true
in here, but the script it filling in the defaults.Losing a comment here.
Comment #7
chx CreditAttribution: chx commentedMoved the NULL protection up.
Comment #8
tim.plunkettThank you! This is awesome.
Comment #9
chx CreditAttribution: chx commentedThis gets us 3/4 there: ag "'\d" core/**/config/*yml reports 520 occurences across 102 files :(
Comment #10
chx CreditAttribution: chx commentedAnything that is at least two digits must be a number. The lack of schema coverage stands in #9, this is done by shell scripting:
while read line; do sed -i -r -f pattern $line; done < "files.txt"
where the file pattern containss/: '([0-9]{2,})'/: \1/
. This adds 24 more. Not a lot but every bit helps. We can also use this technique to pick up practically anything that looks like numbers or booleans and do them in batches instead of manually. (Promote etc is the next one)Comment #12
chx CreditAttribution: chx commentedJust commit #7 we will deal with #10 later (it's permissions probably being parsed into 755 instead of 0755. Lots of fun!)
Comment #13
webchickAWESOME work. Thanks so much for this.
Committed and pushed to 8.x. YEAH! :D
I'll try and do another CMI test this week to ensure this fixes the issue I ran into.
Comment #14
jhodgdonSo if this has been committed, do we still need all the sub-tasks on #1653026: [META] Use properly typed values in module configuration? As maintainer of one of the components that got assigned a sub-task, I kind of need to know.
Comment #15
vijaycs85@jhodgdon This task covered most of them except:
1) config that doesn't have a schema
2) config of test modules.
Approach 1: So we can use those sub-tasks to validate and make sure all the type-castings are removed. If nothing else to do, we can close them.
Approach 2:
The no-schema list that chx attached in this issue (https://drupal.org/files/no_schema.txt) can be fixed, if we can add schema (also adding schema helps other places as well). So I thought below steps would be good to take in order
1. Provide missing schemas and get them into core.
2. Run @chx script and issue one more patch as Core config has everything as string - part 2
3. Then move to sub-tasks and do validation, etc (all the old story above).
This way we can make most of them done before move to sub-task.
I'm on Approach 2(#1910624: [META] Introduce and complete configuration schemas in all of core has sub-tasks for schema and you are most welcome to help there) :).
Comment #15.0
vijaycs85Updated issue summary.
Comment #15.1
YesCT CreditAttribution: YesCT commentedto be clear about what was done/committed and what to do next (schemas and checking other sub issues)
Comment #16
YesCT CreditAttribution: YesCT commentedupdated the summary. :)
Comment #16.0
YesCT CreditAttribution: YesCT commentedcorrected updated comment number