Seb35 has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/299385

Change subject: Changed location of exec-config to improve consistency of the 
schema; strict verification of the JSON schema
......................................................................

Changed location of exec-config to improve consistency of the schema; strict 
verification of the JSON schema
---
M config/farms.json
M config/farms.php
M config/farms.yml
M docs/farms-schema.json
4 files changed, 216 insertions(+), 144 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MediaWikiFarm 
refs/changes/85/299385/1

diff --git a/config/farms.json b/config/farms.json
index 2bb3a5b..f40cfbc 100644
--- a/config/farms.json
+++ b/config/farms.json
@@ -22,9 +22,12 @@
                        {
                                "file": "org/PrivateSettings.php",
                                "key": "*"
+                       },
+                       {
+                               "file": "org/ExecSettings.php",
+                               "exec": true
                        }
-               ],
-               "exec-config": "org/ExecSettings.php"
+               ]
        },
        "(?<client>[a-z]+)-(?<wiki>[a-z]+)\\.example\\.com": {
                "variables": [
@@ -53,9 +56,12 @@
                        {
                                "file": "com/example/PrivateSettings.yml",
                                "key": "*"
+                       },
+                       {
+                               "file": "com/example/ExecSettings.php",
+                               "exec": true
                        }
-               ],
-               "exec-config": "com/example/ExecSettings.php"
+               ]
        },
        "(?<client>[a-z]+)_(?<wiki>[a-z]+)\\.example\\.com": {
                "redirect": "$client-$wiki.example.com"
diff --git a/config/farms.php b/config/farms.php
index 4755d74..dd138a9 100644
--- a/config/farms.php
+++ b/config/farms.php
@@ -25,8 +25,10 @@
                        array( 'file' => 'org/PrivateSettings.php',
                               'key' => '*'
                        ),
+                       array( 'file' => 'org/ExecSettings.php',
+                              'exec' => true
+                       ),
                ),
-               'exec-config' => 'org/ExecSettings.php',
        ),
        
        # Configuration for a small wiki farm
@@ -55,8 +57,10 @@
                        array( 'file' => 'com/example/PrivateSettings.yml',
                               'key' => '*'
                        ),
+                       array( 'file' => 'com/example/ExecSettings.php',
+                              'exec' => true
+                       ),
                ),
-               'exec-config' => 'com/example/ExecSettings.php',
        ),
        
        # Aliases
diff --git a/config/farms.yml b/config/farms.yml
index 82a16cd..78fa067 100644
--- a/config/farms.yml
+++ b/config/farms.yml
@@ -18,7 +18,8 @@
         key: '*'
       - file: 'org/PrivateSettings.php'
         key: '*'
-    exec-config: 'org/ExecSettings.php'
+      - file: 'org/ExecSettings.php'
+        exec: true
 
 # Configuration for a small wiki farm
 '(?<client>[a-z]+)-(?<wiki>[a-z]+)\.example\.com':
@@ -42,7 +43,8 @@
         key: '*'
       - file: 'com/example/PrivateSettings.yml'
         key: '*'
-    exec-config: 'com/example/ExecSettings.php'
+      - file: 'com/example/ExecSettings.php'
+        exec: true
 
 # Aliases
 
diff --git a/docs/farms-schema.json b/docs/farms-schema.json
index b852ac3..926be60 100644
--- a/docs/farms-schema.json
+++ b/docs/farms-schema.json
@@ -2,153 +2,213 @@
        "$schema": "http://json-schema.org/draft-04/schema#";,
        "name": "Configuration of MediaWikiFarm extension to manage MediaWiki 
farms.",
        "type": "object",
-       "additionalProperties": true,
+       "additionalProperties": false,
        "patternProperties": {
-               "^[a-zA-Z0-9\\[\\]\\(\\)\\<>.*?+_-]+$": {
-                       "type": "object",
-                       "properties": {
-                               "variables": {
-                                       "type": "array",
-                                       "description": "List of variables in 
the host.",
-                                       "additionalItems": false,
-                                       "items": [
-                                               {
-                                                       "type": "object",
-                                                       "description": "An host 
variable.",
-                                                       "properties": {
-                                                                       
"variable": {
-                                                                       "type": 
"string",
-                                                                       
"description": "Name of the host variable."
+               "^[a-zA-Z0-9\\[\\]\\(\\)\\\\<>.*?+_-]+$": {
+                       "oneOf": [
+                               {
+                                       "type": "object",
+                                       "additionalProperties": false,
+                                       "properties": {
+                                               "variables": {
+                                                       "type": "array",
+                                                       "description": "List of 
variables in the host.",
+                                                       "additionalItems": 
false,
+                                                       "items": [
+                                                               {
+                                                                       "type": 
"object",
+                                                                       
"description": "An host variable.",
+                                                                       
"additionalProperties": false,
+                                                                       
"properties": {
+                                                                               
        "variable": {
+                                                                               
        "type": "string",
+                                                                               
        "description": "Name of the host variable."
+                                                                               
},
+                                                                               
"file": {
+                                                                               
        "type": "string",
+                                                                               
        "description": "Path of the existing values for this variable."
+                                                                               
}
+                                                                       }
                                                                },
-                                                               "file": {
-                                                                       "type": 
"string",
-                                                                       
"description": "Path of the existing values for this variable."
+                                                               {
+                                                                       "type": 
"object",
+                                                                       
"description": "An host variable.",
+                                                                       
"additionalProperties": false,
+                                                                       
"properties": {
+                                                                               
        "variable": {
+                                                                               
        "type": "string",
+                                                                               
        "description": "Name of the host variable."
+                                                                               
},
+                                                                               
"file": {
+                                                                               
        "type": "string",
+                                                                               
        "description": "Path of the existing values for this variable."
+                                                                               
}
+                                                                       }
+                                                               },
+                                                               {
+                                                                       "type": 
"object",
+                                                                       
"description": "An host variable.",
+                                                                       
"additionalProperties": false,
+                                                                       
"properties": {
+                                                                               
        "variable": {
+                                                                               
        "type": "string",
+                                                                               
        "description": "Name of the host variable."
+                                                                               
},
+                                                                               
"file": {
+                                                                               
        "type": "string",
+                                                                               
        "description": "Path of the existing values for this variable."
+                                                                               
}
+                                                                       }
                                                                }
-                                                       }
+                                                       ]
                                                },
-                                               {
-                                                       "type": "object",
-                                                       "description": "An host 
variable.",
-                                                       "properties": {
-                                                               "variable": {
-                                                                       "type": 
"string",
-                                                                       
"description": "Name of the host variable."
-                                                               },
-                                                               "file": {
-                                                                       "type": 
"string",
-                                                                       
"description": "Path of the existing values for this variable."
-                                                               }
-                                                       }
+                                               "suffix": {
+                                                       "type": "string",
+                                                       "description": "Suffix 
of the wiki.",
+                                                       "pattern": "^[a-z$-]+$"
                                                },
-                                               {
-                                                       "type": "object",
-                                                       "description": "An host 
variable.",
-                                                       "properties": {
-                                                               "variable": {
-                                                                       "type": 
"string",
-                                                                       
"description": "Name of the host variable."
+                                               "wikiID": {
+                                                       "type": "string",
+                                                       "description": "Unique 
identifier of the wiki.",
+                                                       "pattern": "^[a-z$-]+$"
+                                               },
+                                               "versions": {
+                                                       "type": "string",
+                                                       "description": "File 
containing an array where each key is a wikiID and each value is the 
corresponding MediaWiki version."
+                                               },
+                                               "data": {
+                                                       "type": "string",
+                                                       "description": "Data 
directory where files of the wiki are stored."
+                                               },
+                                               "cache": {
+                                                       "type": 
["string","null"],
+                                                       "description": 
"Configuration cache file."
+                                               },
+                                               "config": {
+                                                       "type": "array",
+                                                       "description": "List of 
configuration files.",
+                                                       "additionalItems": 
false,
+                                                       "items": [
+                                                               {
+                                                                       "type": 
"object",
+                                                                       
"description": "A configuration file.",
+                                                                       
"additionalProperties": false,
+                                                                       
"properties": {
+                                                                               
"file": {
+                                                                               
        "type": "string",
+                                                                               
        "description": "Path of the configuration file."
+                                                                               
},
+                                                                               
"key": {
+                                                                               
        "type": "string",
+                                                                               
        "description": "Pattern of the of the key.",
+                                                                               
        "pattern": "^(default|\\*|[a-z$*-]+)$"
+                                                                               
},
+                                                                               
"default": {
+                                                                               
        "type": "string",
+                                                                               
        "description": "Default key.",
+                                                                               
        "pattern": "^[a-z$*-]+$"
+                                                                               
},
+                                                                               
"exec": {
+                                                                               
        "type": "boolean",
+                                                                               
        "description": "This file must be directly.",
+                                                                               
        "enum": [true]
+                                                                               
}
+                                                                       }
                                                                },
-                                                               "file": {
-                                                                       "type": 
"string",
-                                                                       
"description": "Path of the existing values for this variable."
+                                                               {
+                                                                       "type": 
"object",
+                                                                       
"description": "A configuration file.",
+                                                                       
"additionalProperties": false,
+                                                                       
"properties": {
+                                                                               
"file": {
+                                                                               
        "type": "string",
+                                                                               
        "description": "Path of the configuration file."
+                                                                               
},
+                                                                               
"key": {
+                                                                               
        "type": "string",
+                                                                               
        "description": "Pattern of the of the key.",
+                                                                               
        "pattern": "^(default|\\*|[a-z$*-]+)$"
+                                                                               
},
+                                                                               
"default": {
+                                                                               
        "type": "string",
+                                                                               
        "description": "Default key.",
+                                                                               
        "pattern": "^[a-z$*-]+$"
+                                                                               
},
+                                                                               
"exec": {
+                                                                               
        "type": "boolean",
+                                                                               
        "description": "This file must be directly.",
+                                                                               
        "enum": [true]
+                                                                               
}
+                                                                       }
+                                                               },
+                                                               {
+                                                                       "type": 
"object",
+                                                                       
"description": "A configuration file.",
+                                                                       
"additionalProperties": false,
+                                                                       
"properties": {
+                                                                               
"file": {
+                                                                               
        "type": "string",
+                                                                               
        "description": "Path of the configuration file."
+                                                                               
},
+                                                                               
"key": {
+                                                                               
        "type": "string",
+                                                                               
        "description": "Pattern of the of the key.",
+                                                                               
        "pattern": "^(default|\\*|[a-z$*-]+)$"
+                                                                               
},
+                                                                               
"default": {
+                                                                               
        "type": "string",
+                                                                               
        "description": "Default key.",
+                                                                               
        "pattern": "^[a-z$*-]+$"
+                                                                               
},
+                                                                               
"exec": {
+                                                                               
        "type": "boolean",
+                                                                               
        "description": "This file must be directly.",
+                                                                               
        "enum": [true]
+                                                                               
}
+                                                                       }
+                                                               },
+                                                               {
+                                                                       "type": 
"object",
+                                                                       
"description": "A configuration file.",
+                                                                       
"additionalProperties": false,
+                                                                       
"properties": {
+                                                                               
"file": {
+                                                                               
        "type": "string",
+                                                                               
        "description": "Path of the configuration file."
+                                                                               
},
+                                                                               
"key": {
+                                                                               
        "type": "string",
+                                                                               
        "description": "Pattern of the of the key.",
+                                                                               
        "pattern": "^(default|\\*|[a-z$*-]+)$"
+                                                                               
},
+                                                                               
"default": {
+                                                                               
        "type": "string",
+                                                                               
        "description": "Default key.",
+                                                                               
        "pattern": "^[a-z$*-]+$"
+                                                                               
},
+                                                                               
"exec": {
+                                                                               
        "type": "boolean",
+                                                                               
        "description": "This file must be directly.",
+                                                                               
        "enum": [true]
+                                                                               
}
+                                                                       }
                                                                }
-                                                       }
+                                                       ]
                                                }
-                                       ]
+                                       }
                                },
-                               "suffix": {
-                                       "type": "string",
-                                       "description": "Suffix of the wiki.",
-                                       "pattern": "^[a-z$*-]+$"
-                               },
-                               "wikiID": {
-                                       "type": "string",
-                                       "description": "Unique identifier of 
the wiki.",
-                                       "pattern": "^[a-z$*-]+$"
-                               },
-                               "data": {
-                                       "type": "string",
-                                       "description": "Data directory where 
files of the wiki are stored."
-                               },
-                               "cache": {
-                                       "type": ["string","null"],
-                                       "description": "Configuration cache 
file."
-                               },
-                               "config": {
-                                       "type": "array",
-                                       "description": "List of configuration 
files.",
-                                       "additionalItems": false,
-                                       "items": [
-                                               {
-                                                       "type": "object",
-                                                       "description": "A 
configuration file.",
-                                                       "properties": {
-                                                               "file": {
-                                                                       "type": 
"string",
-                                                                       
"description": "Path of the configuration file."
-                                                               },
-                                                               "key": {
-                                                                       "type": 
"string",
-                                                                       
"description": "Pattern of the of the key.",
-                                                                       
"pattern": "^(default|\\*|[a-z$*-]+)$"
-                                                               },
-                                                               "default": {
-                                                                       "type": 
"string",
-                                                                       
"description": "Default key.",
-                                                                       
"pattern": "^[a-z$*-]+$"
-                                                               }
-                                                       }
-                                               },
-                                               {
-                                                       "type": "object",
-                                                       "description": "A 
configuration file.",
-                                                       "properties": {
-                                                               "file": {
-                                                                       "type": 
"string",
-                                                                       
"description": "Path of the configuration file."
-                                                               },
-                                                               "key": {
-                                                                       "type": 
"string",
-                                                                       
"description": "Pattern of the of the key.",
-                                                                       
"pattern": "^(default|\\*|[a-z$*-]+)$"
-                                                               },
-                                                               "default": {
-                                                                       "type": 
"string",
-                                                                       
"description": "Default key.",
-                                                                       
"pattern": "^[a-z$*-]+$"
-                                                               }
-                                                       }
-                                               },{
-                                                       "type": "object",
-                                                       "description": "A 
configuration file.",
-                                                       "properties": {
-                                                               "file": {
-                                                                       "type": 
"string",
-                                                                       
"description": "Path of the configuration file."
-                                                               },
-                                                               "key": {
-                                                                       "type": 
"string",
-                                                                       
"description": "Pattern of the of the key.",
-                                                                       
"pattern": "^(default|\\*|[a-z$*-]+)$"
-                                                               },
-                                                               "default": {
-                                                                       "type": 
"string",
-                                                                       
"description": "Default key.",
-                                                                       
"pattern": "^[a-z$*-]+$"
-                                                               }
-                                                       }
+                               {
+                                       "type": "object",
+                                       "additionalProperties": false,
+                                       "properties": {
+                                               "redirect": {
+                                                       "type": "string",
+                                                       "description": 
"Internal redirect to another farm.",
+                                                       "pattern": 
"^[a-zA-Z0-9.$_-]+$"
                                                }
-                                       ]
-                               },
-                               "exec-config": {
-                                       "type": ["array","string"],
-                                       "description": "Path of the 
configuration-execution files."
-                               },
-                               "redirect": {
-                                       "type": "string",
-                                       "description": "Internal redirect to 
another farm."
+                                       }
                                }
-                       }
+                       ]
                }
        }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/299385
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If9d89a344a57e26872e3173729e1cf5ab0cbd0ea
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MediaWikiFarm
Gerrit-Branch: master
Gerrit-Owner: Seb35 <seb35wikipe...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to