[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.17-1283-gcf603cf
abarth at webkit.org
abarth at webkit.org
Tue Jan 5 23:55:50 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 02737645e7b93c9fb4462380a52c5b40915b1f9e
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sun Dec 20 01:37:13 2009 +0000
2009-12-19 Adam Barth <abarth at webkit.org>
Reviewed by Eric Seidel.
QueueStatusServer needs a human readable dashboard
https://bugs.webkit.org/show_bug.cgi?id=32769
Here is a first cut at the dashboard. There's a lot left to do.
* QueueStatusServer/filters/webkit_extras.py:
* QueueStatusServer/handlers/dashboard.py: Added.
* QueueStatusServer/handlers/patchstatus.py:
* QueueStatusServer/handlers/recentstatus.py:
* QueueStatusServer/handlers/showresults.py:
* QueueStatusServer/handlers/statusbubble.py:
* QueueStatusServer/handlers/updatestatus.py:
* QueueStatusServer/main.py:
* QueueStatusServer/model/__init__.py: Copied from WebKitTools/QueueStatusServer/filters/__init__.py.
* QueueStatusServer/model/queuestatus.py: Renamed from WebKitTools/QueueStatusServer/model.py.
* QueueStatusServer/stylesheets/dashboard.css: Added.
* QueueStatusServer/templates/dashboard.html: Added.
* QueueStatusServer/templates/statusbubble.html: Renamed from WebKitTools/QueueStatusServer/status_bubble.html.
* QueueStatusServer/templates/updatestatus.html: Renamed from WebKitTools/QueueStatusServer/update_status.html.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52396 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 95e8ce6..af5920c 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,27 @@
+2009-12-19 Adam Barth <abarth at webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ QueueStatusServer needs a human readable dashboard
+ https://bugs.webkit.org/show_bug.cgi?id=32769
+
+ Here is a first cut at the dashboard. There's a lot left to do.
+
+ * QueueStatusServer/filters/webkit_extras.py:
+ * QueueStatusServer/handlers/dashboard.py: Added.
+ * QueueStatusServer/handlers/patchstatus.py:
+ * QueueStatusServer/handlers/recentstatus.py:
+ * QueueStatusServer/handlers/showresults.py:
+ * QueueStatusServer/handlers/statusbubble.py:
+ * QueueStatusServer/handlers/updatestatus.py:
+ * QueueStatusServer/main.py:
+ * QueueStatusServer/model/__init__.py: Copied from WebKitTools/QueueStatusServer/filters/__init__.py.
+ * QueueStatusServer/model/queuestatus.py: Renamed from WebKitTools/QueueStatusServer/model.py.
+ * QueueStatusServer/stylesheets/dashboard.css: Added.
+ * QueueStatusServer/templates/dashboard.html: Added.
+ * QueueStatusServer/templates/statusbubble.html: Renamed from WebKitTools/QueueStatusServer/status_bubble.html.
+ * QueueStatusServer/templates/updatestatus.html: Renamed from WebKitTools/QueueStatusServer/update_status.html.
+
2009-12-19 Daniel Bates <dbates at webkit.org>
Reviewed by Timothy Hatcher.
diff --git a/WebKitTools/QueueStatusServer/filters/webkit_extras.py b/WebKitTools/QueueStatusServer/filters/webkit_extras.py
index 6a08727..6a855cc 100644
--- a/WebKitTools/QueueStatusServer/filters/webkit_extras.py
+++ b/WebKitTools/QueueStatusServer/filters/webkit_extras.py
@@ -40,5 +40,16 @@ def webkit_linkify(value):
value = patch_regexp.sub(r'<a href="https://bugs.webkit.org/attachment.cgi?id=\g<patch_id>&action=prettypatch">patch \g<patch_id></a>', value)
return value
+ at stringfilter
+def webkit_bug_id(value):
+ return '<a href="http://webkit.org/b/' + value + '">' + value + '</a>'
+
+ at stringfilter
+def webkit_attachment_id(value):
+ return '<a href="https://bugs.webkit.org/attachment.cgi?id=' + value + '&action=prettypatch">' + value + '</a>'
+
register = webapp.template.create_template_register()
register.filter(webkit_linkify)
+register.filter(webkit_bug_id)
+register.filter(webkit_attachment_id)
+
diff --git a/WebKitTools/QueueStatusServer/handlers/dashboard.py b/WebKitTools/QueueStatusServer/handlers/dashboard.py
new file mode 100644
index 0000000..fd811b5
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/handlers/dashboard.py
@@ -0,0 +1,91 @@
+# Copyright (C) 2009 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import re
+
+from google.appengine.ext import webapp
+from google.appengine.ext.webapp import template
+
+from model.queuestatus import QueueStatus
+from handlers.statusbubble import StatusSummary
+
+queues = [
+ "style-queue",
+ "chromium-ews",
+ "qt-ews",
+ "gtk-ews",
+]
+
+def dash_to_underscore(dashed_name):
+ regexp = re.compile("-")
+ return regexp.sub("_", dashed_name)
+
+def state_from_status(status):
+ table = {
+ "Pass" : "pass",
+ "Fail" : "fail",
+ }
+ return table.get(status.message, "none")
+
+def summarize(attachment_id):
+ summary = { "attachment_id" : attachment_id }
+
+ # FIXME: We shouldn't have to make another query to figure this out.
+ # We'll fix this with memcache. Notice that we can't grab it
+ # below because the patch might not have been processed by one
+ # these queues yet.
+ summary["bug_id"] = QueueStatus.all().filter('active_patch_id =', attachment_id).fetch(1)[0].active_bug_id
+
+ for queue in queues:
+ summary[queue] = None
+ status = QueueStatus.all().filter('queue_name =', queue).filter('active_patch_id =', attachment_id).order('-date').get()
+ if status:
+ summary[dash_to_underscore(queue)] = {
+ "state" : state_from_status(status),
+ "status" : status,
+ }
+ return summary
+
+
+class Dashboard(webapp.RequestHandler):
+ def get(self):
+ status_summary = StatusSummary()
+ statuses = QueueStatus.all().order("-date")
+
+ attachment_ids = set()
+ for status in statuses:
+ if not status.active_patch_id:
+ continue
+ attachment_ids.add(status.active_patch_id)
+ if len(attachment_ids) >= 25:
+ break
+
+ template_values = {
+ "summaries" : map(summarize, sorted(attachment_ids)),
+ }
+ self.response.out.write(template.render("templates/dashboard.html", template_values))
diff --git a/WebKitTools/QueueStatusServer/handlers/patchstatus.py b/WebKitTools/QueueStatusServer/handlers/patchstatus.py
index 73ae53a..1a5422e 100644
--- a/WebKitTools/QueueStatusServer/handlers/patchstatus.py
+++ b/WebKitTools/QueueStatusServer/handlers/patchstatus.py
@@ -28,7 +28,7 @@
from google.appengine.ext import webapp
-from model import QueueStatus
+from model.queuestatus import QueueStatus
class PatchStatus(webapp.RequestHandler):
diff --git a/WebKitTools/QueueStatusServer/handlers/recentstatus.py b/WebKitTools/QueueStatusServer/handlers/recentstatus.py
index 09648bf..fb9ad2e 100644
--- a/WebKitTools/QueueStatusServer/handlers/recentstatus.py
+++ b/WebKitTools/QueueStatusServer/handlers/recentstatus.py
@@ -29,7 +29,7 @@
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
-from model import QueueStatus
+from model.queuestatus import QueueStatus
class RecentStatus(webapp.RequestHandler):
def _title_case(self, string):
diff --git a/WebKitTools/QueueStatusServer/handlers/showresults.py b/WebKitTools/QueueStatusServer/handlers/showresults.py
index cb14a9a..e4cb71b 100644
--- a/WebKitTools/QueueStatusServer/handlers/showresults.py
+++ b/WebKitTools/QueueStatusServer/handlers/showresults.py
@@ -28,7 +28,7 @@
from google.appengine.ext import webapp
-from model import QueueStatus
+from model.queuestatus import QueueStatus
class ShowResults(webapp.RequestHandler):
diff --git a/WebKitTools/QueueStatusServer/handlers/statusbubble.py b/WebKitTools/QueueStatusServer/handlers/statusbubble.py
index c3f547b..c33b3cc 100644
--- a/WebKitTools/QueueStatusServer/handlers/statusbubble.py
+++ b/WebKitTools/QueueStatusServer/handlers/statusbubble.py
@@ -29,9 +29,11 @@
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
-from model import QueueStatus
+from model.queuestatus import QueueStatus
+# FIXME: This class is wrong. I'm going to rebuid the functionality correctly
+# for the dashboard and then kill this class.
class StatusSummary(object):
def _status_to_code(self, status):
code_names = {
@@ -76,4 +78,4 @@ class StatusBubble(webapp.RequestHandler):
template_values = {
"queue_status" : status_summary.summarize(int(attachment_id)),
}
- self.response.out.write(template.render('status_bubble.html', template_values))
+ self.response.out.write(template.render("templates/statusbubble.html", template_values))
diff --git a/WebKitTools/QueueStatusServer/handlers/updatestatus.py b/WebKitTools/QueueStatusServer/handlers/updatestatus.py
index 493b816..b81041a 100644
--- a/WebKitTools/QueueStatusServer/handlers/updatestatus.py
+++ b/WebKitTools/QueueStatusServer/handlers/updatestatus.py
@@ -30,12 +30,12 @@ from google.appengine.api import users
from google.appengine.ext import webapp, db
from google.appengine.ext.webapp import template
-from model import QueueStatus
+from model.queuestatus import QueueStatus
class UpdateStatus(webapp.RequestHandler):
def get(self):
- self.response.out.write(template.render('update_status.html', None))
+ self.response.out.write(template.render("templates/updatestatus.html", None))
def _int_from_request(self, name):
string_value = self.request.get(name)
diff --git a/WebKitTools/QueueStatusServer/main.py b/WebKitTools/QueueStatusServer/main.py
index da2f4c4..c565be8 100644
--- a/WebKitTools/QueueStatusServer/main.py
+++ b/WebKitTools/QueueStatusServer/main.py
@@ -33,6 +33,7 @@ use_library('django', '1.1')
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
+from handlers.dashboard import Dashboard
from handlers.patchstatus import PatchStatus
from handlers.recentstatus import RecentStatus
from handlers.showresults import ShowResults
@@ -45,6 +46,7 @@ routes = [
('/', RecentStatus),
('/queue-status/(.*)', RecentStatus),
('/update-status', UpdateStatus),
+ ('/dashboard', Dashboard),
(r'/patch-status/(.*)/(.*)', PatchStatus),
(r'/status-bubble/(.*)', StatusBubble),
(r'/results/(.*)', ShowResults)
diff --git a/WebKitTools/QueueStatusServer/filters/__init__.py b/WebKitTools/QueueStatusServer/model/__init__.py
similarity index 100%
copy from WebKitTools/QueueStatusServer/filters/__init__.py
copy to WebKitTools/QueueStatusServer/model/__init__.py
diff --git a/WebKitTools/QueueStatusServer/model.py b/WebKitTools/QueueStatusServer/model/queuestatus.py
similarity index 100%
rename from WebKitTools/QueueStatusServer/model.py
rename to WebKitTools/QueueStatusServer/model/queuestatus.py
diff --git a/WebKitTools/QueueStatusServer/stylesheets/dashboard.css b/WebKitTools/QueueStatusServer/stylesheets/dashboard.css
new file mode 100644
index 0000000..d1b2d5e
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/stylesheets/dashboard.css
@@ -0,0 +1,40 @@
+body {
+ font-family: Verdana, Helvetica, sans-serif;
+}
+table {
+ color: #444;
+}
+th {
+ font-weight: normal;
+ background-color: #AAA;
+ color: white;
+ padding: 5px;
+ width: 100px;
+ border-radius: 5px;
+}
+td {
+ text-align: center;
+}
+.status {
+ margin: 1px;
+ padding: 1px 2px;
+ border-radius: 5px;
+ border: 1px solid #AAA;
+ font-size: 11px;
+}
+.status:hover {
+ border: 1px solid #000;
+ -webkit-transition: border 0.5s linear;
+}
+.pass {
+ background-color: #8FDF5F;
+ border: 1px solid #4F8530;
+}
+.fail {
+ background-color: #E98080;
+ border: 1px solid #A77272;
+}
+.pending {
+ background-color: #FFFC6C;
+ border: 1px solid #C5C56D;
+}
diff --git a/WebKitTools/QueueStatusServer/templates/dashboard.html b/WebKitTools/QueueStatusServer/templates/dashboard.html
new file mode 100644
index 0000000..9a128f6
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/templates/dashboard.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link type="text/css" rel="stylesheet" href="/stylesheets/dashboard.css" />
+</head>
+<body>
+<h1>Review Queue Status</h1>
+<table>
+ <theader>
+ <tr>
+ <th>Attachment</th>
+ <th>Bug</th>
+ <th>Style</th>
+ <th>Chromium</th>
+ <th>Qt</th>
+ <th>Gtk</th>
+ </tr>
+ </thead>{% for summary in summaries %}
+ <tbody>
+ <tr>
+ <td>
+ {{ summary.attachment_id|force_escape|webkit_attachment_id|safe }}
+ </td>
+ <td>
+ {{ summary.bug_id|force_escape|webkit_bug_id|safe }}
+ </td>
+ <td class="status {{ summary.style_queue.state|safe }}"
+ title="{{ summary.style_queue.status.date|timesince }} ago">
+ {{ summary.style_queue.status.message|safe }}
+ </td>
+ <td class="status {{ summary.chromium_ews.state|safe }}"
+ title="{{ summary.chromium_ews.status.date|timesince }} ago">
+ {{ summary.chromium_ews.status.message|safe }}
+ </td>
+ <td class="status {{ summary.qt_ews.state|safe }}"
+ title="{{ summary.qt_ews.status.date|timesince }} ago">
+ {{ summary.qt_ews.status.message|safe }}
+ </td>
+ <td class="status {{ summary.gtk_ews.state|safe }}"
+ title="{{ summary.gtk_ews.status.date|timesince }} ago"
+ {{ summary.gtk_ews.status.message|safe }}
+ </td>
+ </tr>{% endfor %}
+ </tbody>
+</table>
+</html>
diff --git a/WebKitTools/QueueStatusServer/status_bubble.html b/WebKitTools/QueueStatusServer/templates/statusbubble.html
similarity index 100%
rename from WebKitTools/QueueStatusServer/status_bubble.html
rename to WebKitTools/QueueStatusServer/templates/statusbubble.html
diff --git a/WebKitTools/QueueStatusServer/update_status.html b/WebKitTools/QueueStatusServer/templates/updatestatus.html
similarity index 100%
rename from WebKitTools/QueueStatusServer/update_status.html
rename to WebKitTools/QueueStatusServer/templates/updatestatus.html
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list