Changeset 85383 in webkit


Ignore:
Timestamp:
Apr 29, 2011 7:50:58 PM (13 years ago)
Author:
eric@webkit.org
Message:

2011-04-29 Eric Seidel <eric@webkit.org>

Reviewed by Adam Barth.

land-safely patches should show show their place in the commit-queue
https://bugs.webkit.org/show_bug.cgi?id=59853

This complicated the "should we show the bubbles or the submit-to-ews button"
logic substantially. :( But now we'll show both the commit-queue position
as well as the submit-to-ews button for land-safely (cq+ only) patches.
Previously we would only show the submit-to-ews button.

  • QueueStatusServer/handlers/statusbubble.py:
  • QueueStatusServer/templates/statusbubble.html:
Location:
trunk/Tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r85380 r85383  
     12011-04-29  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        land-safely patches should show show their place in the commit-queue
     6        https://bugs.webkit.org/show_bug.cgi?id=59853
     7
     8        This complicated the "should we show the bubbles or the submit-to-ews button"
     9        logic substantially. :(  But now we'll show both the commit-queue position
     10        as well as the submit-to-ews button for land-safely (cq+ only) patches.
     11        Previously we would only show the submit-to-ews button.
     12
     13        * QueueStatusServer/handlers/statusbubble.py:
     14        * QueueStatusServer/templates/statusbubble.html:
     15
    1162011-04-29  Naoki Takano  <takano.naoki@gmail.com>
    217
  • trunk/Tools/QueueStatusServer/handlers/statusbubble.py

    r85251 r85383  
    4949        return bubble
    5050
    51     def _have_ews_status_for(self, attachment, queue):
    52         return bool(queue.is_ews() and (attachment.position_in_queue(queue) or attachment.status_for_queue(queue)))
     51    def _have_status_for(self, attachment, queue):
     52        # Any pending queue is shown.
     53        if attachment.position_in_queue(queue):
     54            return True
     55        # Complete ewses are also shown.
     56        return bool(queue.is_ews() and attachment.status_for_queue(queue))
     57
     58    def _build_bubbles_for_attachment(self, attachment):
     59        show_submit_to_ews = True
     60        bubbles = []
     61        for queue in Queue.all():
     62            if not self._have_status_for(attachment, queue):
     63                continue
     64            bubbles.append(self._build_bubble(queue, attachment))
     65            # If even one ews has status, we don't show the submit-to-ews button.
     66            if queue.is_ews():
     67                show_submit_to_ews = False
     68
     69        return (bubbles, show_submit_to_ews)
    5370
    5471    def get(self, attachment_id_string):
    5572        attachment_id = int(attachment_id_string)
    5673        attachment = Attachment(attachment_id)
    57         # Show all queue positions, even the commit-queue.
    58         bubbles = [self._build_bubble(queue, attachment) for queue in Queue.all() if queue.is_ews() or attachment.position_in_queue(queue)]
    59         # If all EWS queues have no position and no status we show a "submit to ews" button.
    60         have_ews_status_or_position = reduce(operator.or_, map(lambda queue: self._have_ews_status_for(attachment, queue), Queue.all()))
     74        bubbles, show_submit_to_ews = self._build_bubbles_for_attachment(attachment)
     75
    6176        template_values = {
    6277            "bubbles": bubbles,
    6378            "attachment_id": attachment_id,
    64             "show_submit_to_ews": not have_ews_status_or_position,
     79            "show_submit_to_ews": show_submit_to_ews,
    6580        }
    6681        self.response.out.write(template.render("templates/statusbubble.html", template_values))
  • trunk/Tools/QueueStatusServer/templates/statusbubble.html

    r85255 r85383  
    5555    font-size: 9px;
    5656}
     57form {
     58    display: inline-block;
     59}
    5760</style>
    5861<script>
     
    6871<body>
    6972<div id="bubbleContainer">
    70 {% if show_submit_to_ews %}
    71   <form name="submit_to_ews" enctype="multipart/form-data" method="post" action="/submit-to-ews">
    72     <input type="hidden" name="attachment_id" value="{{ attachment_id }}">
    73     <input type="hidden" name="next_action" value="return_to_bubbles">
    74     <input class="status" type="submit" value="Submit for EWS analysis">
    75   </form>
    76 {% else %}
    7773  {% for bubble in bubbles %}
    7874  <a class="status {{ bubble.state }}" target="_top"
     
    8884  </a>
    8985  {% endfor %}
     86
     87{% if show_submit_to_ews %}
     88  <form name="submit_to_ews" method="POST" action="/submit-to-ews">
     89    <input type="hidden" name="attachment_id" value="{{ attachment_id }}">
     90    <input type="hidden" name="next_action" value="return_to_bubbles">
     91    <input class="status" type="submit" value="Submit for EWS analysis">
     92  </form>
    9093{% endif %}
    9194</div>
  • trunk/Tools/QueueStatusServer/templates/submittoews.html

    r85251 r85383  
    1 <form name="submit_to_ews" enctype="multipart/form-data" method="post">
     1<form name="submit_to_ews" method="POST">
    22Attachment id of patch to submit: <input name="attachment_id"><input type="submit" value="Submit for EWS Processing">
    33</form>
Note: See TracChangeset for help on using the changeset viewer.