EWS is too eager to say that a patch does not apply to trunk of repository
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Oct 2014 17:18:10 +0000 (17:18 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Oct 2014 17:18:10 +0000 (17:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=137290

Reviewed by Ryosuke Niwa.

* QueueStatusServer/app.yaml: Updated app version.

* QueueStatusServer/handlers/statusbubble.py:
(StatusBubble._build_bubble):
(StatusBubble._build_bubbles_for_attachment):
Rewrote to make more sense.

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

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

index c859449..0f14c16 100644 (file)
@@ -1,3 +1,17 @@
+2014-10-01  Alexey Proskuryakov  <ap@apple.com>
+
+        EWS is too eager to say that a patch does not apply to trunk of repository
+        https://bugs.webkit.org/show_bug.cgi?id=137290
+
+        Reviewed by Ryosuke Niwa.
+
+        * QueueStatusServer/app.yaml: Updated app version.
+
+        * QueueStatusServer/handlers/statusbubble.py:
+        (StatusBubble._build_bubble):
+        (StatusBubble._build_bubbles_for_attachment):
+        Rewrote to make more sense.
+
 2014-09-30  Eva Balazsfalvi  <evab.u-szeged@partner.samsung.com>
 
         Remove thirdparty/unittest2 from webkitpy
 2014-09-30  Eva Balazsfalvi  <evab.u-szeged@partner.samsung.com>
 
         Remove thirdparty/unittest2 from webkitpy
index 9a37934..3771af5 100644 (file)
@@ -1,5 +1,5 @@
 application: webkit-queues
 application: webkit-queues
-version: 174124 # Bugzilla bug ID of last major change
+version: 174158 # Bugzilla bug ID of last major change
 runtime: python
 api_version: 1
 
 runtime: python
 api_version: 1
 
index ce7f098..6551f92 100644 (file)
@@ -115,18 +115,20 @@ class StatusBubble(webapp.RequestHandler):
         # 10 recent statuses is enough to always include a resultative one, if there were any at all.
         statuses = QueueStatus.all().filter('queue_name =', queue.name()).filter('active_patch_id =', attachment.id).order('-date').fetch(limit=10)
         if not statuses:
         # 10 recent statuses is enough to always include a resultative one, if there were any at all.
         statuses = QueueStatus.all().filter('queue_name =', queue.name()).filter('active_patch_id =', attachment.id).order('-date').fetch(limit=10)
         if not statuses:
+            bubble["had_resultative_status_other_than_failure_to_apply"] = False
             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))
             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
             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)
         else:
             latest_resultative_status = self._latest_resultative_status(statuses)
+            bubble["had_resultative_status_other_than_failure_to_apply"] = any(map(lambda status:
+                latest_resultative_status and latest_resultative_status.message != "Error: " + queue.name() + " unable to apply patch.",
+                statuses))
             if not latest_resultative_status:
                 bubble["state"] = "started"
                 bubble["details_message"] = ("Started processing.\n\nRecent messages:\n\n"
             if not latest_resultative_status:
                 bubble["state"] = "started"
                 bubble["details_message"] = ("Started processing.\n\nRecent messages:\n\n"
@@ -146,7 +148,6 @@ 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)
                     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)
             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)
@@ -189,9 +190,9 @@ class StatusBubble(webapp.RequestHandler):
                 show_submit_to_ews = False
 
         failed_to_apply = any(map(lambda bubble: "failed_to_apply" in bubble, bubbles))
                 show_submit_to_ews = False
 
         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))
+        had_resultative_status_other_than_failure_to_apply = any(map(lambda bubble: bubble["had_resultative_status_other_than_failure_to_apply"], bubbles))
 
 
-        return (bubbles, show_submit_to_ews, failed_to_apply and (not had_output) and (not show_submit_to_ews))
+        return (bubbles, show_submit_to_ews, failed_to_apply and not had_resultative_status_other_than_failure_to_apply)
 
     def get(self, attachment_id_string):
         attachment_id = int(attachment_id_string)
 
     def get(self, attachment_id_string):
         attachment_id = int(attachment_id_string)