This is a sub-issue of #1910624: [META] Introduce and complete configuration schemas in all of core.

Problem/motivation

#1866610: Introduce Kwalify-inspired schema format for configuration introduced the idea of config schema. The changelog leads to (hopefully extensive) documentation on the format at http://drupal.org/node/1905070. While there are little cleanups planned for the format overall, the current format is a result of months of back and forths, so it should be perfectly fine to apply it more widely to core.

Proposed solution

Create a configuration schema for syslog module.

Schema in place

Schema not yet in place
syslog.settings.yml

Files: 
CommentFileSizeAuthor
#13 1919206-syslog-schema-11.patch565 bytesvijaycs85
PASSED: [[SimpleTest]]: [MySQL] 52,390 pass(es). View
#13 1919206-diff-9-11.txt431 bytesvijaycs85
#9 1919206-syslog-schema-9.patch558 bytesvijaycs85
PASSED: [[SimpleTest]]: [MySQL] 52,231 pass(es). View
#9 1919206-diff-4-9.txt423 bytesvijaycs85
#6 2013-02-21_231646.png12.65 KBvijaycs85
#4 1919206-syslog-schema-4.patch557 bytesvijaycs85
PASSED: [[SimpleTest]]: [MySQL] 52,214 pass(es). View
#1 1919206-syslog-schema-1.patch422 bytesvijaycs85
PASSED: [[SimpleTest]]: [MySQL] 50,865 pass(es). View

Comments

vijaycs85’s picture

Status: Active » Needs review
FileSize
422 bytes
PASSED: [[SimpleTest]]: [MySQL] 50,865 pass(es). View

Adding schema file...

Status: Needs review » Needs work

The last submitted patch, 1919206-syslog-schema-1.patch, failed testing.

vijaycs85’s picture

Status: Needs work » Needs review
vijaycs85’s picture

FileSize
557 bytes
PASSED: [[SimpleTest]]: [MySQL] 52,214 pass(es). View

Updating patch with code style fix and labels...

YesCT’s picture

I'm going to review this for http://drupal.org/node/1905070#codestyle

vijaycs85’s picture

FileSize
12.65 KB

Adding screenshot...
2013-02-21_231646.png

itarato’s picture

Hi,
I've applied the patch, then I re-installed my D8 site, enabled syslog module, generated couple of log messages and it worked fine.

YesCT’s picture

+++ b/core/modules/syslog/config/schema/syslog.schema.ymlundefined
@@ -0,0 +1,15 @@
+# Schema for configuration files of syslog module.

this is following the pattern in http://drupal.org/node/1905070#codestyle
but I think the example there might be missing an article:
# Schema for configuration files of contact module.

How about:
# Schema configuration files for the contact module.

vijaycs85’s picture

FileSize
423 bytes
558 bytes
PASSED: [[SimpleTest]]: [MySQL] 52,231 pass(es). View

Sure, why not :)

YesCT’s picture

I wonder if there is an issue for config standards. until I find it. I'm going to note here (since this is one of the first being reviewed) that http://drupal.org/node/1354#files uses the article "the" in http://drupal.org/node/1354#files " * Install, update, and uninstall functions for the XXX module."

And a file really does not contain files...

so:

+++ b/core/modules/syslog/config/schema/syslog.schema.ymlundefined
@@ -1,4 +1,4 @@
-# Schema for configuration files of syslog module.
+# Schema configuration files for the syslog module.

should maybe be:
Schema configuration file for the syslog module.

or just:
Schema configuration for the syslog module.

or maybe:
Configuration for the schema for the syslog module.

or maybe:
Configuration file for the schema for the syslog module.

Let me ponder a minute. and get someone else to read it.

YesCT’s picture

vijay is helping me in irc understand.
this was helpful for me:
Schema (system.schema.yml) for configuration files(system.site.yml, system.theme.yml, etc) of system module.

So:
# Schema for the configuration files of the system module.

is probably accurate (similar to what was originally there, but with some "the" articles).

YesCT’s picture

Only use quotes when needed. Data .yml files suggest you only use quotes when more than one word is used (or a numeric value is used) because the .yml serialization will do that as a standard practice and makes diffing simpler. For schema files follow this rule: never use quotes for children key definitions (in Drupal, key names are strings by definition and should not have spaces); use a quote for label values even if they are one word for consistency. You can find plenty of examples of that above.

sounds contradictory.

never use quotes, then use a quote even if they are one word...

I need to read that again.

vijaycs85’s picture

FileSize
431 bytes
565 bytes
PASSED: [[SimpleTest]]: [MySQL] 52,390 pass(es). View

# Schema for the configuration files of the system module.

is probably accurate (similar to what was originally there, but with some "the" articles).

Updating accordingly...

YesCT’s picture

Status: Needs review » Reviewed & tested by the community

I did a standards review. and this looks rtbc to me, with the above functional review.

we should do a few more to see if the standards are working out.

still a nagging wonder if the comment should be:

any one actually know english grammar?
[09:45am] YesCT: should it have a "the" in:
[09:45am] YesCT: Schema for the configuration files of the syslog module.
[09:45am] YesCT: or not:
[09:45am] YesCT: Schema for configuration files of the syslog module.

lets leave it as is in the patch.

----

the indenting looks right.

in the standard it says:

"Watch your indentation levels. This is not a code style requirement per say, since it is important to use proper indentation in YAML so you get the desired schema structure."

I'll think about that. the wording in the standard might be tweaked/improved.

I think it's trying to say that the spacing is important because it controls the *meaning* not just making it look nice and be consistant.

YesCT’s picture

I updated http://drupal.org/node/1905070#codestyle with the one line comment that matches what this patch is doing, with the the.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

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