Changeset 52405 in webkit


Ignore:
Timestamp:
Dec 20, 2009 1:47:41 AM (14 years ago)
Author:
abarth@webkit.org
Message:

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

Reviewed by Eric Seidel.

[QueueStatusServer] Add a per-patch details page
https://bugs.webkit.org/show_bug.cgi?id=32784

This is a first cut at a per-patch details page. I'm sure we'll have
to iterate.

  • QueueStatusServer/filters/webkit_extras.py:
  • QueueStatusServer/handlers/patch.py: Added.
  • QueueStatusServer/index.yaml:
  • QueueStatusServer/main.py:
  • QueueStatusServer/model/attachment.py:
  • QueueStatusServer/stylesheets/dashboard.css:
  • QueueStatusServer/templates/dashboard.html:
  • QueueStatusServer/templates/patch.html: Added.
Location:
trunk/WebKitTools
Files:
1 added
7 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r52404 r52405  
     12009-12-20  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        [QueueStatusServer] Add a per-patch details page
     6        https://bugs.webkit.org/show_bug.cgi?id=32784
     7
     8        This is a first cut at a per-patch details page.  I'm sure we'll have
     9        to iterate.
     10
     11        * QueueStatusServer/filters/webkit_extras.py:
     12        * QueueStatusServer/handlers/patch.py: Added.
     13        * QueueStatusServer/index.yaml:
     14        * QueueStatusServer/main.py:
     15        * QueueStatusServer/model/attachment.py:
     16        * QueueStatusServer/stylesheets/dashboard.css:
     17        * QueueStatusServer/templates/dashboard.html:
     18        * QueueStatusServer/templates/patch.html: Added.
     19
    1202009-12-20  Adam Barth  <abarth@webkit.org>
    221
  • trunk/WebKitTools/QueueStatusServer/filters/webkit_extras.py

    r52396 r52405  
    2727# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2828
     29import re
     30
    2931from django.template.defaultfilters import stringfilter
    3032from google.appengine.ext import webapp
    3133
    32 import re
     34register = webapp.template.create_template_register()
    3335
    3436bug_regexp = re.compile(r"bug (?P<bug_id>\d+)")
    3537patch_regexp = re.compile(r"patch (?P<patch_id>\d+)")
    3638
     39@register.filter
    3740@stringfilter
    3841def webkit_linkify(value):
     
    4144    return value
    4245
     46@register.filter
    4347@stringfilter
    4448def webkit_bug_id(value):
    4549    return '<a href="http://webkit.org/b/' + value + '">' + value + '</a>'
    4650
     51@register.filter
    4752@stringfilter
    4853def webkit_attachment_id(value):
    4954    return '<a href="https://bugs.webkit.org/attachment.cgi?id=' + value + '&action=prettypatch">' + value + '</a>'
    5055
    51 register = webapp.template.create_template_register()
    52 register.filter(webkit_linkify)
    53 register.filter(webkit_bug_id)
    54 register.filter(webkit_attachment_id)
    55 
     56@register.filter
     57@stringfilter
     58def results_link(status):
     59    return '<a href="/results/' + status.key().id() + '">results</a>'
  • trunk/WebKitTools/QueueStatusServer/handlers/patch.py

    r52404 r52405  
    2727# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2828
    29 from django.template.defaultfilters import stringfilter
    3029from google.appengine.ext import webapp
     30from google.appengine.ext.webapp import template
    3131
    32 import re
     32from model.queuestatus import QueueStatus
    3333
    34 bug_regexp = re.compile(r"bug (?P<bug_id>\d+)")
    35 patch_regexp = re.compile(r"patch (?P<patch_id>\d+)")
    3634
    37 @stringfilter
    38 def webkit_linkify(value):
    39     value = bug_regexp.sub(r'<a href="http://webkit.org/b/\g<bug_id>">bug \g<bug_id></a>', value)
    40     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)
    41     return value
     35class Patch(webapp.RequestHandler):
     36    def get(self, attachment_id_string):
     37        attachment_id = int(attachment_id_string)
     38        statuses = QueueStatus.all().filter("active_patch_id =", attachment_id).order("-date")
    4239
    43 @stringfilter
    44 def webkit_bug_id(value):
    45     return '<a href="http://webkit.org/b/' + value + '">' + value + '</a>'
     40        bug_id = None
     41        queue_status = {}
     42        for status in statuses:
     43            bug_id = status.active_bug_id # Should be the same for every status.
     44            per_queue_statuses = queue_status.get(status.queue_name, [])
     45            per_queue_statuses.append(status)
     46            queue_status[status.queue_name] = per_queue_statuses
    4647
    47 @stringfilter
    48 def webkit_attachment_id(value):
    49     return '<a href="https://bugs.webkit.org/attachment.cgi?id=' + value + '&action=prettypatch">' + value + '</a>'
    50 
    51 register = webapp.template.create_template_register()
    52 register.filter(webkit_linkify)
    53 register.filter(webkit_bug_id)
    54 register.filter(webkit_attachment_id)
    55 
     48        template_values = {
     49            "attachment_id" : attachment_id,
     50            "bug_id" : bug_id,
     51            "queue_status" : queue_status,
     52        }
     53        self.response.out.write(template.render("templates/patch.html", template_values))
  • trunk/WebKitTools/QueueStatusServer/index.yaml

    r51264 r52405  
    1414  properties:
    1515  - name: active_patch_id
     16  - name: date
     17    direction: desc
     18
     19- kind: QueueStatus
     20  properties:
     21  - name: active_patch_id
    1622  - name: queue_name
    1723  - name: date
  • trunk/WebKitTools/QueueStatusServer/main.py

    r52396 r52405  
    3535
    3636from handlers.dashboard import Dashboard
     37from handlers.patch import Patch
    3738from handlers.patchstatus import PatchStatus
    3839from handlers.recentstatus import RecentStatus
     
    4950    ('/dashboard', Dashboard),
    5051    (r'/patch-status/(.*)/(.*)', PatchStatus),
     52    (r'/patch/(.*)', Patch),
    5153    (r'/status-bubble/(.*)', StatusBubble),
    5254    (r'/results/(.*)', ShowResults)
  • trunk/WebKitTools/QueueStatusServer/model/attachment.py

    r52404 r52405  
    7979            "Pass" : "pass",
    8080            "Fail" : "fail",
     81            "Error" : "error",
    8182        }
    82         return table.get(status.message, "none")
     83        state = table.get(status.message)
     84        if state:
     85            return state
     86        if status:
     87            return "pending"
     88        return None
    8389
    8490    def _fetch_summary(self):
     
    97103            "qt-ews",
    98104            "gtk-ews",
     105            "commit-queue",
    99106        ]
    100107
  • trunk/WebKitTools/QueueStatusServer/stylesheets/dashboard.css

    r52398 r52405  
    11body {
    22  font-family: Verdana, Helvetica, sans-serif;
     3  width: 600px;
     4  padding: 0px;
     5  color: #444;
    36}
    47h1 {
     8  background-color: #EEE;
    59  color: #444;
    610  font-size: 14pt;
    711  font-style: italic;
     12  margin: 0px;
     13  padding: 5px;
     14}
     15h2 {
     16  background-color: #AAA;
     17  color: white;
     18  font-weight: bold;
     19  font-size: 9pt;
     20  margin: 0px;
     21  padding: 5px;
     22}
     23ul {
     24  margin: 0px;
     25  padding: 0px;
     26  list-style: none;
     27}
     28li {
     29  padding: 5px;
    830}
    931table {
    10   color: #444;
    1132  border-spacing: 0px;
    1233}
     
    1637  padding: 5px;
    1738  width: 100px;
    18   font-size: 11px;
     39  font-size: 9pt;
    1940}
    2041td {
    2142  text-align: center;
    2243}
    23 tr:hover {
     44tr:hover, li:hover {
    2445  background-color: #EEE;
     46}
     47.status-date {
     48  color: #AAA;
     49  float: right;
     50  font-size: 8pt;
    2551}
    2652.status {
    2753  margin: 1px;
    2854  padding: 1px 2px;
    29   font-size: 11px;
     55  font-size: 9pt;
    3056  border: 1px solid transparent;
    3157}
     
    3561.pass {
    3662  background-color: #8FDF5F;
     63  cursor: pointer;
    3764  /* border: 1px solid #4F8530; */
    3865}
    3966.fail {
    4067  background-color: #E98080;
     68  cursor: pointer;
    4169  /* border: 1px solid #A77272; */
    4270}
    4371.pending {
    4472  background-color: #FFFC6C;
     73  cursor: pointer;
    4574  /* border: 1px solid #C5C56D; */
    4675}
     76.error {
     77  background-color: #E0B0FF;
     78  cursor: pointer;
     79  /* border: 1px solid #ACA0B3; */
     80}
  • trunk/WebKitTools/QueueStatusServer/templates/dashboard.html

    r52398 r52405  
    22<html>
    33<head>
     4<title>WebKit Bot Status</title>
    45<link type="text/css" rel="stylesheet" href="/stylesheets/dashboard.css" />
     6<script>
     7function statusDetail(patch_id) {
     8  // FIXME: We'd like to use AJAX to show the details on this page.
     9  window.location = "/patch/" + patch_id
     10}
     11</script>
    512</head>
    613<body>
     
    1522      <th>Qt</th>
    1623      <th>Gtk</th>
     24      <th>Commit</th>
    1725    </tr>
    18   </thead>{% for summary in summaries %}
    19   <tbody>
     26  </thead>
     27  <tbody>{% for summary in summaries %}
    2028    <tr>
    2129      <td class="status">
     
    2533        {{ summary.attachment_id|force_escape|webkit_attachment_id|safe }}
    2634      </td>
    27       <td class="status {{ summary.style_queue.state|safe }}"
    28           title="{{ summary.style_queue.status.date|timesince }} ago">
    29         {{ summary.style_queue.status.message|safe }}
     35      <!-- FIXME: Find some way to remove this copy-and-paste code! -->
     36      <td class="status {{ summary.style_queue.state }}"{% if summary.style_queue.status %}
     37          onclick="statusDetail({{ summary.attachment_id }})"
     38          title="{{ summary.style_queue.status.date|timesince }}"{% endif %}>
    3039      </td>
    31       <td class="status {{ summary.chromium_ews.state|safe }}"
    32           title="{{ summary.chromium_ews.status.date|timesince }} ago">
    33         {{ summary.chromium_ews.status.message|safe }}
     40      <td class="status {{ summary.chromium_ews.state }}"{% if summary.chromium_ews.status %}
     41          onclick="statusDetail({{ summary.attachment_id }})"
     42          title="{{ summary.chromium_ews.status.date|timesince }} ago"{% endif %}>
    3443      </td>
    35       <td class="status {{ summary.qt_ews.state|safe }}"
    36           title="{{ summary.qt_ews.status.date|timesince }} ago">
    37         {{ summary.qt_ews.status.message|safe }}
     44      <td class="status {{ summary.qt_ews.state }}"{% if summary.qt_ews.status %}
     45          onclick="statusDetail({{ summary.attachment_id }})"
     46          title="{{ summary.qt_ews.status.date|timesince }} ago"{% endif %}>
    3847      </td>
    39       <td class="status {{ summary.gtk_ews.state|safe }}"
    40           title="{{ summary.gtk_ews.status.date|timesince }} ago"
    41         {{ summary.gtk_ews.status.message|safe }}
     48      <td class="status {{ summary.gtk_ews.state }}"{% if summary.gtk_ews.status %}
     49          onclick="statusDetail({{ summary.attachment_id }})"
     50          title="{{ summary.gtk_ews.status.date|timesince }} ago"{% endif %}>
     51      </td>
     52      <td class="status {{ summary.commit_queue.state }}"{% if summary.commit_queue.status %}
     53          onclick="statusDetail({{ summary.attachment_id }})"
     54          title="{{ summary.commit_queue.status.date|timesince }} ago"{% endif %}>
    4255      </td>
    4356    </tr>{% endfor %}
Note: See TracChangeset for help on using the changeset viewer.