EWS doesn't need to show all the bubbles when a patch fails to apply
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Sep 2014 19:43:58 +0000 (19:43 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Sep 2014 19:43:58 +0000 (19:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=137256

Reviewed by Ryosuke Niwa.

* QueueStatusServer/app.yaml: Updated app version.

* QueueStatusServer/handlers/statusbubble.py:
(StatusBubble._build_bubble):
(StatusBubble._build_bubbles_for_attachment):
(StatusBubble.get):
* QueueStatusServer/templates/statusbubble.html:
When some queues fail to apply, and no queues had meaningful output (meaning that
they will almost certainly fail to apply later), we can show a single bubble
telling the user just that.

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

Tools/ChangeLog
Tools/QueueStatusServer/app.yaml
Tools/QueueStatusServer/handlers/statusbubble.py
Tools/QueueStatusServer/templates/statusbubble.html

index 5e8ed29..e3c5da3 100644 (file)
@@ -1,3 +1,21 @@
+2014-09-30  Alexey Proskuryakov  <ap@apple.com>
+
+        EWS doesn't need to show all the bubbles when a patch fails to apply
+        https://bugs.webkit.org/show_bug.cgi?id=137256
+
+        Reviewed by Ryosuke Niwa.
+
+        * QueueStatusServer/app.yaml: Updated app version.
+
+        * QueueStatusServer/handlers/statusbubble.py:
+        (StatusBubble._build_bubble):
+        (StatusBubble._build_bubbles_for_attachment):
+        (StatusBubble.get):
+        * QueueStatusServer/templates/statusbubble.html:
+        When some queues fail to apply, and no queues had meaningful output (meaning that
+        they will almost certainly fail to apply later), we can show a single bubble
+        telling the user just that.
+
 2014-09-30  Tibor Meszaros  <tmeszaros.u-szeged@partner.samsung.com>
 
         [EFL] Bump EFL version to 1.11.2
index 958ac70..3135e4b 100644 (file)
@@ -1,5 +1,5 @@
 application: webkit-queues
-version: 174192 # Bugzilla bug ID of last major change
+version: 174114 # Bugzilla bug ID of last major change
 runtime: python
 api_version: 1
 
index 884d824..a046324 100644 (file)
@@ -118,11 +118,13 @@ class StatusBubble(webapp.RequestHandler):
             if attachment.id in queue.active_work_items().item_ids:
                 bubble["state"] = "started"
                 bubble["details_message"] = "Started processing, no output yet.\n\n" + self._iso_time(queue.active_work_items().time_for_item(attachment.id))
+                bubble["may_fail_to_apply"] = True
             else:
                 real_queue_position = self._real_queue_position(queue, queue_position)
                 bubble["state"] = "none"
                 bubble["details_message"] = "Waiting in queue, processing has not started yet.\n\nPosition in queue: " + str(real_queue_position)
                 bubble["queue_position"] = real_queue_position
+                bubble["may_fail_to_apply"] = True
         else:
             latest_resultative_status = self._latest_resultative_status(statuses)
             if not latest_resultative_status:
@@ -144,9 +146,11 @@ class StatusBubble(webapp.RequestHandler):
                     else:
                         bubble["details_message"] += " Some messages were logged while the patch was still eligible:\n\n"
                     bubble["details_message"] += "\n".join([status.message for status in statuses[1:]]) + "\n\n" + self._iso_time(statuses[0].date)
+                bubble["may_fail_to_apply"] = True
             elif statuses[0].message == "Error: " + queue.name() + " unable to apply patch.":
                 bubble["state"] = "fail"
                 bubble["details_message"] = statuses[1].message + "\n\n" + self._iso_time(statuses[0].date)
+                bubble["failed_to_apply"] = True
             elif statuses[0].message.startswith("Error: "):
                 bubble["state"] = "error"
                 bubble["details_message"] = "\n".join([status.message for status in statuses]) + "\n\n" + self._iso_time(statuses[0].date)
@@ -157,6 +161,7 @@ class StatusBubble(webapp.RequestHandler):
                 bubble["state"] = "error"
                 bubble["details_message"] = ("Internal error. Latest status implies that the patch should be in queue, but it is not. Recent messages:\n\n"
                     + "\n".join([status.message for status in statuses]) + "\n\n" + self._iso_time(statuses[0].date))
+            bubble["may_fail_to_apply"] = True
 
         if "details_message" in bubble:
             bubble["details_message"] = queue.display_name() + "\n\n" + bubble["details_message"]
@@ -184,16 +189,20 @@ class StatusBubble(webapp.RequestHandler):
             if queue.is_ews():
                 show_submit_to_ews = False
 
-        return (bubbles, show_submit_to_ews)
+        failed_to_apply = any(map(lambda bubble: "failed_to_apply" in bubble, bubbles))
+        had_output = all(map(lambda bubble: not "may_fail_to_apply" in bubble and not "failed_to_apply" in bubble, bubbles))
+
+        return (bubbles, show_submit_to_ews, failed_to_apply and (not had_output) and (not show_submit_to_ews))
 
     def get(self, attachment_id_string):
         attachment_id = int(attachment_id_string)
         attachment = Attachment(attachment_id)
-        bubbles, show_submit_to_ews = self._build_bubbles_for_attachment(attachment)
+        bubbles, show_submit_to_ews, show_failure_to_apply = self._build_bubbles_for_attachment(attachment)
 
         template_values = {
             "bubbles": bubbles,
             "attachment_id": attachment_id,
             "show_submit_to_ews": show_submit_to_ews,
+            "show_failure_to_apply": show_failure_to_apply,
         }
         self.response.out.write(template.render("templates/statusbubble.html", template_values))
index bee5e83..5f5aa57 100644 (file)
@@ -63,6 +63,14 @@ window.addEventListener("message", function(e) {
 </head>
 <body>
 <div id="bubbleContainer">
+  {% if show_failure_to_apply %}
+  <a class="status fail" target="_top"
+      href="/patch/{{ attachment_id }}"
+      title="None of the queues could apply the patch"
+  >
+    patch does not apply to trunk of repository
+  </a>
+  {% else %}
   {% for bubble in bubbles %}
   <a class="status {{ bubble.state }}" target="_top"
       href="/patch/{{ bubble.attachment_id }}"
@@ -76,6 +84,7 @@ window.addEventListener("message", function(e) {
     {% endif %}
   </a>
   {% endfor %}
+  {% endif %}
 
 {% if show_submit_to_ews %}
   <form name="submit_to_ews" method="POST" action="/submit-to-ews">