Commit 59b29506 authored by eric@webkit.org's avatar eric@webkit.org
Browse files

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.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51591 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 804478e1
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.
2009-12-02 Eric Seidel <eric@webkit.org>
Reviewed by Adam Barth.
......
<!DOCTYPE html>
<html>
<head>
<title>WebKit Commit Queue Status</title>
......
......@@ -73,6 +73,52 @@ class PatchStatus(webapp.RequestHandler):
self.response.out.write(statuses[0].message)
class StatusSummary(object):
def _status_to_code(self, status):
code_names = {
"Pass": "pass",
"Pending": "pending",
"Fail": "fail",
"Error": "error",
}
return code_names.get(status, "none")
def _queue_name_to_code(self, queue_name):
code_names = {
"style-queue": "style",
}
return code_names[queue_name]
queues = [
"style-queue",
]
def __init__(self):
self._summary = {}
def summarize(self, attachment_id):
if self._summary.get(attachment_id):
return self._summary.get(attachment_id)
for queue in self.queues:
statuses = QueueStatus.all().filter('queue_name =', queue).filter('active_patch_id =', attachment_id).order('-date').fetch(1)
status_code = self._status_to_code(statuses[0].message if statuses else None)
queue_code = self._queue_name_to_code(queue)
attachment_summary[queue_code] = status_code
self._summary[attachment_id] = attachment_summary
return attachment_summary
class StatusBubble(webapp.RequestHandler):
def get(self, attachment_id):
status_summary = StatusSummary()
template_values = {
"queue_status" : status_summary.summarize(int(attachment_id)),
}
self.response.out.write(template.render('status_bubble.html', template_values))
class UpdateStatus(webapp.RequestHandler):
def get(self):
self.response.out.write(template.render('update_status.html', None))
......@@ -105,6 +151,7 @@ routes = [
('/', MainPage),
('/update-status', UpdateStatus),
(r'/patch-status/(.*)/(.*)', PatchStatus),
(r'/status-bubble/(.*)', StatusBubble),
]
application = webapp.WSGIApplication(routes, debug=True)
......
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: Verdana, sans-serif;
margin: 0px;
padding: 0px;
}
.status {
display: block;
float: left;
margin: 1px;
padding: 1px 2px;
border-radius: 5px;
border: 1px solid #AAA;
font-size: 11px;
}
.pass {
background-color: #8FDF5F;
border: 1px solid #4F8530;
}
.fail {
background-color: #E98080;
border: 1px solid #A77272;
}
.pending {
background-color: #FFFC6C;
border: 1px solid #C5C56D;
}
</style>
</head>
<body>{% for key, value in queue_status.items %}
<div class="status {{value}}" title="{{key}}: {{value}}">{{key}}</div>{% endfor %}
</body>
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment