[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

eric at webkit.org eric at webkit.org
Wed Dec 22 14:44:49 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 6a7180c08e5ebbdda9cbeb535e83725931be74d4
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Oct 19 05:35:14 2010 +0000

    2010-10-18  Eric Seidel  <eric at 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:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70028 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 500b77d..85310d1 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -2,6 +2,36 @@
 
         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:
+
+2010-10-18  Eric Seidel  <eric at webkit.org>
+
+        Reviewed by Adam Barth.
+
         Correct a bunch of typos in QueueStatusServer
         https://bugs.webkit.org/show_bug.cgi?id=47880
 
diff --git a/WebKitTools/QueueStatusServer/app.yaml b/WebKitTools/QueueStatusServer/app.yaml
index 76d8963..e320eb0 100644
--- a/WebKitTools/QueueStatusServer/app.yaml
+++ b/WebKitTools/QueueStatusServer/app.yaml
@@ -3,13 +3,13 @@ version: 1
 runtime: python
 api_version: 1
 
+builtins:
+- datastore_admin: on
+- remote_api: on
+
 handlers:
 - url: /stylesheets
   static_dir: stylesheets
 
-- url: /remote_api
-  script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py
-  login: admin
-
 - url: /.*
   script: main.py
diff --git a/WebKitTools/QueueStatusServer/handlers/queuestatus.py b/WebKitTools/QueueStatusServer/handlers/queuestatus.py
index 52a926e..ae2a439 100644
--- a/WebKitTools/QueueStatusServer/handlers/queuestatus.py
+++ b/WebKitTools/QueueStatusServer/handlers/queuestatus.py
@@ -37,7 +37,9 @@ from model import queuestatus
 
 
 class QueueStatus(webapp.RequestHandler):
-    def _rows_for_work_items(self, queued_items, active_items):
+    def _rows_for_work_items(self, queue):
+        queued_items = queue.work_items()
+        active_items = queue.active_work_items()
         if not queued_items:
             return []
         rows = []
@@ -56,14 +58,11 @@ class QueueStatus(webapp.RequestHandler):
             self.error(404)
             return
 
-        queued_items = WorkItems.all().filter("queue_name =", queue.name()).get()
-        active_items = ActiveWorkItems.all().filter("queue_name =", queue.name()).get()
-        statuses = queuestatus.QueueStatus.all().filter("queue_name =", queue.name()).order("-date").fetch(15)
-
         status_groups = []
         last_patch_id = None
         synthetic_patch_id_counter = 0
 
+        statuses = queuestatus.QueueStatus.all().filter("queue_name =", queue.name()).order("-date").fetch(15)
         for status in statuses:
             patch_id = status.active_patch_id
             if not patch_id or last_patch_id != patch_id:
@@ -76,7 +75,7 @@ class QueueStatus(webapp.RequestHandler):
 
         template_values = {
             "display_queue_name": queue.display_name(),
-            "work_item_rows": self._rows_for_work_items(queued_items, active_items),
+            "work_item_rows": self._rows_for_work_items(queue),
             "status_groups": status_groups,
         }
         self.response.out.write(template.render("templates/queuestatus.html", template_values))
diff --git a/WebKitTools/QueueStatusServer/handlers/recentstatus.py b/WebKitTools/QueueStatusServer/handlers/recentstatus.py
index eba901f..fddc93a 100644
--- a/WebKitTools/QueueStatusServer/handlers/recentstatus.py
+++ b/WebKitTools/QueueStatusServer/handlers/recentstatus.py
@@ -40,7 +40,7 @@ class QueueBubble(object):
     """View support class for recentstatus.html"""
     def __init__(self, queue):
         self._queue = queue
-        self._work_items = WorkItems.all().filter("queue_name =", queue.name()).get()
+        self._work_items = queue.work_items()
         self._last_status = QueueStatus.all().filter("queue_name =", queue.name()).order("-date").get()
 
     # FIXME: name and display_name should be replaced by a .queue() accessor.
diff --git a/WebKitTools/QueueStatusServer/handlers/updatestatus.py b/WebKitTools/QueueStatusServer/handlers/updatestatus.py
index 2a46fd3..408fea9 100644
--- a/WebKitTools/QueueStatusServer/handlers/updatestatus.py
+++ b/WebKitTools/QueueStatusServer/handlers/updatestatus.py
@@ -69,9 +69,8 @@ class UpdateStatus(UpdateBase):
     def _update_active_work_items(self, queue_status):
         if not queue_status.is_retry_request():
             return
-        active_items = ActiveWorkItems.all().filter("queue_name =", queue_status.queue_name).get()
-        if not active_items:
-            return
+        active_items = queue_status.queue.active_work_items()
+        # FIXME: This should move onto the ActiveWorkItems class.
         return db.run_in_transaction(self._expire_item, active_items.key(), queue_status.active_patch_id)
 
     def post(self):
diff --git a/WebKitTools/QueueStatusServer/handlers/updateworkitems.py b/WebKitTools/QueueStatusServer/handlers/updateworkitems.py
index 6fe32bb..16a9d49 100644
--- a/WebKitTools/QueueStatusServer/handlers/updateworkitems.py
+++ b/WebKitTools/QueueStatusServer/handlers/updateworkitems.py
@@ -40,13 +40,6 @@ class UpdateWorkItems(UpdateBase):
     def get(self):
         self.response.out.write(template.render("templates/updateworkitems.html", None))
 
-    def _work_items_for_queue(self, queue):
-        work_items = WorkItems.all().filter("queue_name =", queue.name()).get()
-        if not work_items:
-            work_items = WorkItems()
-            work_items.queue = queue
-        return work_items
-
     def _parse_work_items_string(self, items_string):
         # Our parsing could be much more robust.
         item_strings = items_string.split(" ") if items_string else []
@@ -59,10 +52,8 @@ class UpdateWorkItems(UpdateBase):
             self.response.out.write("\"%s\" is not in queues %s" % (queue_name, Queue.all()))
             return None
 
-        work_items = self._work_items_for_queue(queue)
-        if not work_items:
-            return None
         items_string = self.request.get("work_items")
+        work_items = queue.work_items()
         work_items.item_ids = self._parse_work_items_string(items_string)
         work_items.date = datetime.now()
         return work_items

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list