Title: [249483] trunk
Revision
249483
Author
aakash_j...@apple.com
Date
2019-09-04 10:27:17 -0700 (Wed, 04 Sep 2019)

Log Message

EWS bubbles should indicate builder vs tester
https://bugs.webkit.org/show_bug.cgi?id=201253

Reviewed by Jonathan Bedard.

Tools:

* BuildSlaveSupport/ews-app/ews/views/statusbubble.py:
(StatusBubble._build_bubble): Add icons to the bubbles appropriately.
(StatusBubble._is_tester_queue): Method to determine if the queue is tester queue.
(StatusBubble._is_builder_queue): Method to determine if the queue is builder queue.
(StatusBubble.get):
* BuildSlaveSupport/ews-app/ews/common/buildbot.py:
(Buildbot.fetch_config): Method to fetch the config from Buildbot server.
(Buildbot.update_icons_for_queues_mapping): Method to update the icons for queues mapping.
* BuildSlaveSupport/ews-app/ews/fetcher.py:
(FetchLoop.run): Update the icons for queues mapping.
* BuildSlaveSupport/ews-build/config.json: Add icon information for the queues.
* BuildSlaveSupport/ews-build/loadConfig.py: Remove 'icon' key from builder before passing it to Buildbot.
* BuildSlaveSupport/ews-build/loadConfig_unittest.py: .
(test_builder_keys): Update unit-test accordingly. Also minor drive-by fix to improve failure string formatting.

Websites/bugs.webkit.org:

* code-review.js: Do not display the icons in status-bubbles on this page.
* template/en/default/attachment/edit.html.tmpl: Ditto.
* template/en/default/attachment/reviewform.html.tmpl: Ditto.

Modified Paths

Diff

Modified: trunk/Tools/BuildSlaveSupport/ews-app/ews/common/buildbot.py (249482 => 249483)


--- trunk/Tools/BuildSlaveSupport/ews-app/ews/common/buildbot.py	2019-09-04 17:05:44 UTC (rev 249482)
+++ trunk/Tools/BuildSlaveSupport/ews-app/ews/common/buildbot.py	2019-09-04 17:27:17 UTC (rev 249483)
@@ -1,4 +1,4 @@
-# Copyright (C) 2018 Apple Inc. All rights reserved.
+# Copyright (C) 2018-2019 Apple Inc. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -37,6 +37,7 @@
     # Buildbot status codes referenced from https://github.com/buildbot/buildbot/blob/master/master/buildbot/process/results.py
     ALL_RESULTS = lrange(7)
     SUCCESS, WARNINGS, FAILURE, SKIPPED, EXCEPTION, RETRY, CANCELLED = ALL_RESULTS
+    icons_for_queues_mapping = {}
 
     @classmethod
     def send_patch_to_buildbot(cls, patch_path, properties=[]):
@@ -80,3 +81,20 @@
         if not words:
             return builder_name
         return words[0].lower()
+
+    @classmethod
+    def fetch_config(cls):
+        config_url = 'https://{}/config.json'.format(config.BUILDBOT_SERVER_HOST)
+        config_data = util.fetch_data_from_url(config_url)
+        if not config_data:
+            return {}
+        return config_data.json()
+
+    @classmethod
+    def update_icons_for_queues_mapping(cls):
+        config = cls.fetch_config()
+        for builder in config.get('builders', []):
+            shortname = builder.get('shortname')
+            Buildbot.icons_for_queues_mapping[shortname] = builder.get('icon')
+
+        return Buildbot.icons_for_queues_mapping

Modified: trunk/Tools/BuildSlaveSupport/ews-app/ews/fetcher.py (249482 => 249483)


--- trunk/Tools/BuildSlaveSupport/ews-app/ews/fetcher.py	2019-09-04 17:05:44 UTC (rev 249482)
+++ trunk/Tools/BuildSlaveSupport/ews-app/ews/fetcher.py	2019-09-04 17:27:17 UTC (rev 249483)
@@ -1,4 +1,4 @@
-# Copyright (C) 2018 Apple Inc. All rights reserved.
+# Copyright (C) 2018-2019 Apple Inc. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -40,6 +40,7 @@
 
     def run(self):
         while True:
+            Buildbot.update_icons_for_queues_mapping()
             try:
                 BugzillaPatchFetcher().fetch()
             except Exception as e:

Modified: trunk/Tools/BuildSlaveSupport/ews-app/ews/views/statusbubble.py (249482 => 249483)


--- trunk/Tools/BuildSlaveSupport/ews-app/ews/views/statusbubble.py	2019-09-04 17:05:44 UTC (rev 249482)
+++ trunk/Tools/BuildSlaveSupport/ews-app/ews/views/statusbubble.py	2019-09-04 17:27:17 UTC (rev 249483)
@@ -59,11 +59,19 @@
                      '^Cleaned and updated working directory$', '^Checked out required revision$',
                      '^Validated patch$', '^Killed old processes$', '^Configured build$', '^OS:.*Xcode:', '(skipped)']
     DAYS_TO_CHECK = 3
+    BUILDER_ICON = u'\U0001f6e0'
+    TESTER_ICON = u'\U0001f9ea'
 
-    def _build_bubble(self, patch, queue):
+    def _build_bubble(self, patch, queue, hide_icons=False):
         bubble = {
             'name': queue,
         }
+        if hide_icons == False:
+            if self._is_tester_queue(queue):
+                bubble['name'] = StatusBubble.TESTER_ICON + '  ' + bubble['name']
+            if self._is_builder_queue(queue):
+                bubble['name'] = StatusBubble.BUILDER_ICON + '  ' + bubble['name']
+
         build, is_parent_build = self.get_latest_build_for_queue(patch, queue, self._get_parent_queue(queue))
         if not self._should_show_bubble_for_build(build):
             return None
@@ -140,6 +148,14 @@
 
         return bubble
 
+    def _is_tester_queue(self, queue):
+        icon = Buildbot.icons_for_queues_mapping.get(queue)
+        return icon in ['testOnly', 'buildAndTest']
+
+    def _is_builder_queue(self, queue):
+        icon = Buildbot.icons_for_queues_mapping.get(queue)
+        return icon in ['buildOnly', 'buildAndTest']
+
     def _get_parent_queue(self, queue):
         return StatusBubble.QUEUE_TRIGGERS.get(queue)
 
@@ -230,7 +246,7 @@
         processed_patches = set([build.patch for build in recent_builds])
         return len(previously_sent_patches - processed_patches) + 1
 
-    def _build_bubbles_for_patch(self, patch):
+    def _build_bubbles_for_patch(self, patch, hide_icons=False):
         show_submit_to_ews = True
         failed_to_apply = False  # TODO: https://bugs.webkit.org/show_bug.cgi?id=194598
         bubbles = []
@@ -242,7 +258,7 @@
             if not self._should_show_bubble_for_queue(queue):
                 continue
 
-            bubble = self._build_bubble(patch, queue)
+            bubble = self._build_bubble(patch, queue, hide_icons)
             if bubble:
                 show_submit_to_ews = False
                 bubbles.append(bubble)
@@ -251,9 +267,10 @@
 
     @xframe_options_exempt
     def get(self, request, patch_id):
+        hide_icons = request.GET.get('hide_icons', False)
         patch_id = int(patch_id)
         patch = Patch.get_patch(patch_id)
-        bubbles, show_submit_to_ews, show_failure_to_apply = self._build_bubbles_for_patch(patch)
+        bubbles, show_submit_to_ews, show_failure_to_apply = self._build_bubbles_for_patch(patch, hide_icons)
 
         template_values = {
             'bubbles': bubbles,

Modified: trunk/Tools/BuildSlaveSupport/ews-build/config.json (249482 => 249483)


--- trunk/Tools/BuildSlaveSupport/ews-build/config.json	2019-09-04 17:05:44 UTC (rev 249482)
+++ trunk/Tools/BuildSlaveSupport/ews-build/config.json	2019-09-04 17:27:17 UTC (rev 249483)
@@ -282,6 +282,7 @@
     {
       "name": "Style-EWS",
       "shortname": "style",
+      "icon": "testOnly",
       "factory": "StyleFactory",
       "platform": "*",
       "workernames": ["ews151"]
@@ -296,6 +297,7 @@
     {
       "name": "GTK-Webkit2-EWS",
       "shortname": "gtk",
+      "icon": "buildOnly",
       "factory": "GTKFactory",
       "platform": "gtk",
       "configuration": "release",
@@ -305,6 +307,7 @@
     {
       "name": "iOS-12-Build-EWS",
       "shortname": "ios",
+      "icon": "buildOnly",
       "factory": "iOSBuildFactory",
       "platform": "ios-12",
       "configuration": "release",
@@ -314,6 +317,7 @@
     {
       "name": "iOS-12-Simulator-Build-EWS",
       "shortname": "ios-sim",
+      "icon": "buildOnly",
       "factory": "iOSBuildFactory",
       "platform": "ios-simulator-12",
       "configuration": "release",
@@ -324,6 +328,7 @@
     {
       "name": "iOS-12-Simulator-WK2-Tests-EWS",
       "shortname": "ios-wk2",
+      "icon": "testOnly",
       "factory": "iOSTestsFactory",
       "platform": "ios-simulator-12",
       "configuration": "release",
@@ -333,6 +338,7 @@
     {
       "name": "macOS-High-Sierra-Release-Build-EWS",
       "shortname": "mac",
+      "icon": "buildOnly",
       "factory": "macOSBuildFactory",
       "platform": "mac-highsierra",
       "configuration": "release",
@@ -343,6 +349,7 @@
     {
       "name": "macOS-High-Sierra-Release-WK1-Tests-EWS",
       "shortname": "mac-wk1",
+      "icon": "testOnly",
       "factory": "macOSWK1Factory",
       "platform": "mac-highsierra",
       "configuration": "release",
@@ -352,6 +359,7 @@
     {
       "name": "macOS-High-Sierra-Release-WK2-Tests-EWS",
       "shortname": "mac-wk2",
+      "icon": "testOnly",
       "factory": "macOSWK2Factory",
       "platform": "mac-highsierra",
       "configuration": "release",
@@ -361,6 +369,7 @@
     {
       "name": "macOS-High-Sierra-Debug-Build-EWS",
       "shortname": "mac-debug",
+      "icon": "buildOnly",
       "factory": "macOSBuildFactory",
       "platform": "mac-highsierra",
       "configuration": "debug",
@@ -371,6 +380,7 @@
     {
       "name": "macOS-High-Sierra-Debug-WK1-Tests-EWS",
       "shortname": "mac-debug-wk1",
+      "icon": "testOnly",
       "factory": "macOSWK1Factory",
       "platform": "mac-highsierra",
       "configuration": "debug",
@@ -380,6 +390,7 @@
     {
       "name": "Windows-EWS",
       "shortname": "win",
+      "icon": "buildAndTest",
       "factory": "WindowsFactory",
       "configuration": "release",
       "architectures": ["x86_64"],
@@ -389,6 +400,7 @@
     {
       "name": "WinCairo-EWS",
       "shortname": "wincairo",
+      "icon": "buildOnly",
       "factory": "WinCairoFactory",
       "configuration": "release",
       "architectures": ["x86_64"],
@@ -398,6 +410,7 @@
     {
       "name": "WPE-EWS",
       "shortname": "wpe",
+      "icon": "buildOnly",
       "factory": "WPEFactory",
       "platform": "wpe",
       "configuration": "release",
@@ -407,6 +420,7 @@
     {
       "name": "JSC-Tests-EWS",
       "shortname": "jsc",
+      "icon": "buildAndTest",
       "factory": "JSCTestsFactory",
       "platform": "jsc-only",
       "configuration": "release",
@@ -415,6 +429,7 @@
     {
       "name": "Bindings-Tests-EWS",
       "shortname": "bindings",
+      "icon": "testOnly",
       "factory": "BindingsFactory",
       "platform": "*",
       "workernames": ["ews151"]
@@ -422,6 +437,7 @@
     {
       "name": "WebKitPy-Tests-EWS",
       "shortname": "webkitpy",
+      "icon": "testOnly",
       "factory": "WebKitPyFactory",
       "platform": "*",
       "workernames": ["ews151"]
@@ -429,6 +445,7 @@
     {
       "name": "WebKitPerl-Tests-EWS",
       "shortname": "webkitperl",
+      "icon": "testOnly",
       "factory": "WebKitPerlFactory",
       "platform": "*",
       "workernames": ["ews151"]
@@ -436,6 +453,7 @@
     {
       "name": "API-Tests-iOS-Simulator-EWS",
       "shortname": "api-ios",
+      "icon": "testOnly",
       "factory": "APITestsFactory",
       "platform": "*",
       "workernames": ["ews156", "ews157", "ews158", "ews159"]
@@ -443,6 +461,7 @@
     {
       "name": "API-Tests-macOS-EWS",
       "shortname": "api-mac",
+      "icon": "testOnly",
       "factory": "APITestsFactory",
       "platform": "*",
       "workernames": ["ews119", "ews150", "ews153", "ews155"]
@@ -450,6 +469,7 @@
     {
       "name": "Services-EWS",
       "shortname": "services",
+      "icon": "testOnly",
       "factory": "ServicesFactory",
       "platform": "*",
       "workernames": ["ews151"]

Modified: trunk/Tools/BuildSlaveSupport/ews-build/loadConfig.py (249482 => 249483)


--- trunk/Tools/BuildSlaveSupport/ews-build/loadConfig.py	2019-09-04 17:05:44 UTC (rev 249482)
+++ trunk/Tools/BuildSlaveSupport/ews-build/loadConfig.py	2019-09-04 17:27:17 UTC (rev 249483)
@@ -59,6 +59,8 @@
         builder['tags'] = getTagsForBuilder(builder)
         factory = globals()[builder['factory']]
         builder['description'] = builder.pop('shortname')
+        if 'icon' in builder:
+            del builder['icon']
         factorykwargs = {}
         for key in ['platform', 'configuration', 'architectures', 'triggers', 'additionalArguments']:
             value = builder.pop(key, None)

Modified: trunk/Tools/BuildSlaveSupport/ews-build/loadConfig_unittest.py (249482 => 249483)


--- trunk/Tools/BuildSlaveSupport/ews-build/loadConfig_unittest.py	2019-09-04 17:05:44 UTC (rev 249482)
+++ trunk/Tools/BuildSlaveSupport/ews-build/loadConfig_unittest.py	2019-09-04 17:27:17 UTC (rev 249483)
@@ -39,11 +39,11 @@
         cwd = os.path.dirname(os.path.abspath(__file__))
         config = json.load(open(os.path.join(cwd, 'config.json')))
         valid_builder_keys = ['additionalArguments', 'architectures', 'builddir', 'configuration', 'description',
-                              'defaultProperties', 'env', 'factory', 'locks', 'name', 'platform', 'properties', 'shortname', 'tags',
+                              'defaultProperties', 'env', 'factory', 'icon', 'locks', 'name', 'platform', 'properties', 'shortname', 'tags',
                               'triggers', 'workernames', 'workerbuilddir']
         for builder in config.get('builders', []):
             for key in builder:
-                self.assertTrue(key in valid_builder_keys, 'Unexpected key {} for builder {}'.format(key, builder.get('name')))
+                self.assertTrue(key in valid_builder_keys, 'Unexpected key "{}" for builder {}'.format(key, builder.get('name')))
 
 
 class TagsForBuilderTeest(unittest.TestCase):

Modified: trunk/Tools/ChangeLog (249482 => 249483)


--- trunk/Tools/ChangeLog	2019-09-04 17:05:44 UTC (rev 249482)
+++ trunk/Tools/ChangeLog	2019-09-04 17:27:17 UTC (rev 249483)
@@ -1,3 +1,25 @@
+2019-09-04  Aakash Jain  <aakash_j...@apple.com>
+
+        EWS bubbles should indicate builder vs tester
+        https://bugs.webkit.org/show_bug.cgi?id=201253
+
+        Reviewed by Jonathan Bedard.
+
+        * BuildSlaveSupport/ews-app/ews/views/statusbubble.py:
+        (StatusBubble._build_bubble): Add icons to the bubbles appropriately.
+        (StatusBubble._is_tester_queue): Method to determine if the queue is tester queue.
+        (StatusBubble._is_builder_queue): Method to determine if the queue is builder queue.
+        (StatusBubble.get):
+        * BuildSlaveSupport/ews-app/ews/common/buildbot.py:
+        (Buildbot.fetch_config): Method to fetch the config from Buildbot server.
+        (Buildbot.update_icons_for_queues_mapping): Method to update the icons for queues mapping.
+        * BuildSlaveSupport/ews-app/ews/fetcher.py:
+        (FetchLoop.run): Update the icons for queues mapping.
+        * BuildSlaveSupport/ews-build/config.json: Add icon information for the queues.
+        * BuildSlaveSupport/ews-build/loadConfig.py: Remove 'icon' key from builder before passing it to Buildbot.
+        * BuildSlaveSupport/ews-build/loadConfig_unittest.py: .
+        (test_builder_keys): Update unit-test accordingly. Also minor drive-by fix to improve failure string formatting.
+
 2019-09-03  Yusuke Suzuki  <ysuz...@apple.com>
 
         [bmalloc] IsoTLSLayout and AllIsoHeaps registration is racy with derived class initialization with virtual functions

Modified: trunk/Websites/bugs.webkit.org/ChangeLog (249482 => 249483)


--- trunk/Websites/bugs.webkit.org/ChangeLog	2019-09-04 17:05:44 UTC (rev 249482)
+++ trunk/Websites/bugs.webkit.org/ChangeLog	2019-09-04 17:27:17 UTC (rev 249483)
@@ -1,3 +1,14 @@
+2019-09-04  Aakash Jain  <aakash_j...@apple.com>
+
+        EWS bubbles should indicate builder vs tester
+        https://bugs.webkit.org/show_bug.cgi?id=201253
+
+        Reviewed by Jonathan Bedard.
+
+        * code-review.js: Do not display the icons in status-bubbles on this page.
+        * template/en/default/attachment/edit.html.tmpl: Ditto.
+        * template/en/default/attachment/reviewform.html.tmpl: Ditto.
+
 2019-08-29  Aakash Jain  <aakash_j...@apple.com>
 
         [EWS] Increase status-bubble iframe width on bugzilla comment review page

Modified: trunk/Websites/bugs.webkit.org/code-review.js (249482 => 249483)


--- trunk/Websites/bugs.webkit.org/code-review.js	2019-09-04 17:05:44 UTC (rev 249482)
+++ trunk/Websites/bugs.webkit.org/code-review.js	2019-09-04 17:27:17 UTC (rev 249483)
@@ -575,7 +575,7 @@
       $('.statusBubble').append(statusBubble);
 
       var statusBubbleNewEWS = document.createElement('iframe');
-      statusBubbleNewEWS.src  = '' + attachment_id + '/';
+      statusBubbleNewEWS.src  = '' + attachment_id + '?hide_icons=True';
       // Can't append the HTML because we need to set the onload handler before appending the iframe to the DOM.
       statusBubbleNewEWS.scrolling = "no";
       statusBubbleNewEWS._onload_ = function () { handleStatusBubbleLoadNewEWS(this); };

Modified: trunk/Websites/bugs.webkit.org/template/en/default/attachment/edit.html.tmpl (249482 => 249483)


--- trunk/Websites/bugs.webkit.org/template/en/default/attachment/edit.html.tmpl	2019-09-04 17:05:44 UTC (rev 249482)
+++ trunk/Websites/bugs.webkit.org/template/en/default/attachment/edit.html.tmpl	2019-09-04 17:27:17 UTC (rev 249483)
@@ -267,7 +267,7 @@
           <iframe src="" attachment.id %]"
                   style="width: 0px; height: 20px; border: none;" scrolling="no" _onload_="handleStatusBubbleLoad(this)">
           </iframe>
-          <iframe src="" attachment.id %]/"
+          <iframe src="" attachment.id %]?hide_icons=True"
                   style="width: 0px; height: 20px; border: none;" scrolling="no" _onload_="handleStatusBubbleLoadNewEWS(this)">
           </iframe>
         </div>

Modified: trunk/Websites/bugs.webkit.org/template/en/default/attachment/reviewform.html.tmpl (249482 => 249483)


--- trunk/Websites/bugs.webkit.org/template/en/default/attachment/reviewform.html.tmpl	2019-09-04 17:05:44 UTC (rev 249482)
+++ trunk/Websites/bugs.webkit.org/template/en/default/attachment/reviewform.html.tmpl	2019-09-04 17:27:17 UTC (rev 249483)
@@ -106,7 +106,7 @@
         <iframe src="" attachment.id %]"
                 style="width: 400px; height: 20px; border: none;" scrolling="no">
         </iframe>
-        <iframe src="" attachment.id %]/"
+        <iframe src="" attachment.id %]?hide_icons=True"
                 style="width: 700px; height: 20px; border: none;" scrolling="no">
         </iframe>
       </div>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to