Changeset 51591 in webkit


Ignore:
Timestamp:
Dec 2, 2009 1:11:54 AM (14 years ago)
Author:
eric@webkit.org
Message:

2009-12-02 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

[bzt] Implement status bubble view
https://bugs.webkit.org/show_bug.cgi?id=32057

The status bubble is a compact representation of the queue status for a
given patch. This will eventually help us reduce the comment spam from
the queues.

  • QueueStatusServer/index.html: Added HTML5 doctype for sanity.
  • QueueStatusServer/queue_status.py:
  • QueueStatusServer/status_bubble.html: Added.
Location:
trunk/WebKitTools
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r51590 r51591  
     12009-12-02  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        [bzt] Implement status bubble view
     6        https://bugs.webkit.org/show_bug.cgi?id=32057
     7
     8        The status bubble is a compact representation of the queue status for a
     9        given patch.  This will eventually help us reduce the comment spam from
     10        the queues.
     11
     12        * QueueStatusServer/index.html: Added HTML5 doctype for sanity.
     13        * QueueStatusServer/queue_status.py:
     14        * QueueStatusServer/status_bubble.html: Added.
     15
    1162009-12-02  Eric Seidel  <eric@webkit.org>
    217
  • trunk/WebKitTools/QueueStatusServer/index.html

    r48730 r51591  
     1<!DOCTYPE html>
    12<html>
    23<head>
  • trunk/WebKitTools/QueueStatusServer/queue_status.py

    r51446 r51591  
    7474
    7575
     76class StatusSummary(object):
     77    def _status_to_code(self, status):
     78        code_names = {
     79            "Pass": "pass",
     80            "Pending": "pending",
     81            "Fail": "fail",
     82            "Error": "error",
     83        }
     84        return code_names.get(status, "none")
     85
     86    def _queue_name_to_code(self, queue_name):
     87        code_names = {
     88            "style-queue": "style",
     89        }
     90        return code_names[queue_name]
     91
     92    queues = [
     93        "style-queue",
     94    ]
     95
     96    def __init__(self):
     97        self._summary = {}
     98
     99    def summarize(self, attachment_id):
     100        if self._summary.get(attachment_id):
     101            return self._summary.get(attachment_id)
     102
     103        for queue in self.queues:
     104            statuses = QueueStatus.all().filter('queue_name =', queue).filter('active_patch_id =', attachment_id).order('-date').fetch(1)
     105            status_code = self._status_to_code(statuses[0].message if statuses else None)
     106            queue_code = self._queue_name_to_code(queue)
     107            attachment_summary[queue_code] = status_code
     108
     109        self._summary[attachment_id] = attachment_summary
     110        return attachment_summary
     111
     112
     113class StatusBubble(webapp.RequestHandler):
     114    def get(self, attachment_id):
     115        status_summary = StatusSummary()
     116        template_values = {
     117            "queue_status" : status_summary.summarize(int(attachment_id)),
     118        }
     119        self.response.out.write(template.render('status_bubble.html', template_values))
     120
     121
    76122class UpdateStatus(webapp.RequestHandler):
    77123    def get(self):
     
    106152    ('/update-status', UpdateStatus),
    107153    (r'/patch-status/(.*)/(.*)', PatchStatus),
     154    (r'/status-bubble/(.*)', StatusBubble),
    108155]
    109156
Note: See TracChangeset for help on using the changeset viewer.