Changeset 70028 in webkit


Ignore:
Timestamp:
Oct 18, 2010 10:35:14 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-10-18 Eric Seidel <eric@webkit.org>

Reviewed by Adam Barth.

queues.webkit.org/next_patch is always 404
https://bugs.webkit.org/show_bug.cgi?id=47881

With the addition of the Queue class, I changed most of the
code to lookup WorkItems using get_or_insert with a key_name
instead of WorkItems.all().filter(queue_name=).
Because the new get_or_insert code uses an explicit key_name
(which is obviously different from the previously autogenerated
ones), there were new WorkItem records created for each queue.
However, some parts of the code still use WorkItems.all().filter,
thus some parts were getting the new record and some parts the old record.

The same basic bug was occurring with ActiveWorkItems, because I
changed the key_name for that class as well.

To fix this I've moved more of the code over to using Queue.*work_items.
I've also enabled the datastore_admin (new in GAE 1.3.8) so that
we can go delete the old WorkItems records.
I also changed remote_api to use the new builtin: syntax (also added in GAE 1.3.8).

  • QueueStatusServer/app.yaml:
  • QueueStatusServer/handlers/queuestatus.py:
  • QueueStatusServer/handlers/recentstatus.py:
  • QueueStatusServer/handlers/updatestatus.py:
  • QueueStatusServer/handlers/updateworkitems.py:
Location:
trunk/WebKitTools
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r70025 r70028  
     12010-10-18  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        queues.webkit.org/next_patch is always 404
     6        https://bugs.webkit.org/show_bug.cgi?id=47881
     7
     8        With the addition of the Queue class, I changed most of the
     9        code to lookup WorkItems using get_or_insert with a key_name
     10        instead of WorkItems.all().filter(queue_name=).
     11        Because the new get_or_insert code uses an explicit key_name
     12        (which is obviously different from the previously autogenerated
     13        ones), there were new WorkItem records created for each queue.
     14        However, some parts of the code still use WorkItems.all().filter,
     15        thus some parts were getting the new record and some parts the old record.
     16
     17        The same basic bug was occurring with ActiveWorkItems, because I
     18        changed the key_name for that class as well.
     19
     20        To fix this I've moved more of the code over to using Queue.*work_items.
     21        I've also enabled the datastore_admin (new in GAE 1.3.8) so that
     22        we can go delete the old WorkItems records.
     23        I also changed remote_api to use the new builtin: syntax (also added in GAE 1.3.8).
     24
     25        * QueueStatusServer/app.yaml:
     26        * QueueStatusServer/handlers/queuestatus.py:
     27        * QueueStatusServer/handlers/recentstatus.py:
     28        * QueueStatusServer/handlers/updatestatus.py:
     29        * QueueStatusServer/handlers/updateworkitems.py:
     30
    1312010-10-18  Eric Seidel  <eric@webkit.org>
    232
  • trunk/WebKitTools/QueueStatusServer/app.yaml

    r67290 r70028  
    44api_version: 1
    55
     6builtins:
     7- datastore_admin: on
     8- remote_api: on
     9
    610handlers:
    711- url: /stylesheets
    812  static_dir: stylesheets
    913
    10 - url: /remote_api
    11   script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py
    12   login: admin
    13 
    1414- url: /.*
    1515  script: main.py
  • trunk/WebKitTools/QueueStatusServer/handlers/queuestatus.py

    r70019 r70028  
    3838
    3939class QueueStatus(webapp.RequestHandler):
    40     def _rows_for_work_items(self, queued_items, active_items):
     40    def _rows_for_work_items(self, queue):
     41        queued_items = queue.work_items()
     42        active_items = queue.active_work_items()
    4143        if not queued_items:
    4244            return []
     
    5759            return
    5860
    59         queued_items = WorkItems.all().filter("queue_name =", queue.name()).get()
    60         active_items = ActiveWorkItems.all().filter("queue_name =", queue.name()).get()
    61         statuses = queuestatus.QueueStatus.all().filter("queue_name =", queue.name()).order("-date").fetch(15)
    62 
    6361        status_groups = []
    6462        last_patch_id = None
    6563        synthetic_patch_id_counter = 0
    6664
     65        statuses = queuestatus.QueueStatus.all().filter("queue_name =", queue.name()).order("-date").fetch(15)
    6766        for status in statuses:
    6867            patch_id = status.active_patch_id
     
    7776        template_values = {
    7877            "display_queue_name": queue.display_name(),
    79             "work_item_rows": self._rows_for_work_items(queued_items, active_items),
     78            "work_item_rows": self._rows_for_work_items(queue),
    8079            "status_groups": status_groups,
    8180        }
  • trunk/WebKitTools/QueueStatusServer/handlers/recentstatus.py

    r70006 r70028  
    4141    def __init__(self, queue):
    4242        self._queue = queue
    43         self._work_items = WorkItems.all().filter("queue_name =", queue.name()).get()
     43        self._work_items = queue.work_items()
    4444        self._last_status = QueueStatus.all().filter("queue_name =", queue.name()).order("-date").get()
    4545
  • trunk/WebKitTools/QueueStatusServer/handlers/updatestatus.py

    r70019 r70028  
    7070        if not queue_status.is_retry_request():
    7171            return
    72         active_items = ActiveWorkItems.all().filter("queue_name =", queue_status.queue_name).get()
    73         if not active_items:
    74             return
     72        active_items = queue_status.queue.active_work_items()
     73        # FIXME: This should move onto the ActiveWorkItems class.
    7574        return db.run_in_transaction(self._expire_item, active_items.key(), queue_status.active_patch_id)
    7675
  • trunk/WebKitTools/QueueStatusServer/handlers/updateworkitems.py

    r70025 r70028  
    4141        self.response.out.write(template.render("templates/updateworkitems.html", None))
    4242
    43     def _work_items_for_queue(self, queue):
    44         work_items = WorkItems.all().filter("queue_name =", queue.name()).get()
    45         if not work_items:
    46             work_items = WorkItems()
    47             work_items.queue = queue
    48         return work_items
    49 
    5043    def _parse_work_items_string(self, items_string):
    5144        # Our parsing could be much more robust.
     
    6053            return None
    6154
    62         work_items = self._work_items_for_queue(queue)
    63         if not work_items:
    64             return None
    6555        items_string = self.request.get("work_items")
     56        work_items = queue.work_items()
    6657        work_items.item_ids = self._parse_work_items_string(items_string)
    6758        work_items.date = datetime.now()
Note: See TracChangeset for help on using the changeset viewer.