Perf dashboard's buildbot sync config JSON duplicates too much information
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 12 Dec 2015 00:11:40 +0000 (00:11 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 12 Dec 2015 00:11:40 +0000 (00:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=152196

Reviewed by Stephanie Lewis.

Added shared, per-builder, and per-test (called type) configurations.

* tools/sync-with-buildbot.py:
(load_config):
(load_config.merge):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@193992 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/tools/sync-with-buildbot.py

index bbf5bef..3192896 100644 (file)
@@ -1,3 +1,16 @@
+2015-12-11  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Perf dashboard's buildbot sync config JSON duplicates too much information
+        https://bugs.webkit.org/show_bug.cgi?id=152196
+
+        Reviewed by Stephanie Lewis.
+
+        Added shared, per-builder, and per-test (called type) configurations.
+
+        * tools/sync-with-buildbot.py:
+        (load_config):
+        (load_config.merge):
+
 2015-12-02  Ryosuke Niwa  <rniwa@webkit.org>
 
         Perf dashboard should avoid overflow during geometric mean computation
index 084c84b..76d14d4 100755 (executable)
@@ -65,9 +65,27 @@ def main():
 
 def load_config(config_json_path, buildbot_url):
     with open(config_json_path) as config_json:
-        configurations = json.load(config_json)
+        options = json.load(config_json)
 
+    shared_config = options['shared']
+    type_config = options['types']
+    builder_config = options['builders']
+
+    def merge(config, config_to_merge):
+        for key, value in config_to_merge.iteritems():
+            if isinstance(value, dict):
+                config.setdefault(key, {})
+                config[key].update(value)
+            else:
+                config[key] = value
+
+    configurations = options['configurations']
     for config in configurations:
+
+        merge(config, shared_config)
+        merge(config, type_config[config.pop('type')])
+        merge(config, builder_config[config.pop('builder')])
+
         escaped_builder_name = urllib.quote(config['builder'])
         config['url'] = '%s/builders/%s/' % (buildbot_url, escaped_builder_name)
         config['jsonURL'] = '%s/json/builders/%s/' % (buildbot_url, escaped_builder_name)