← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wgrant/launchpad/bugtaskflat-v2-use into lp:launchpad

 

William Grant has proposed merging lp:~wgrant/launchpad/bugtaskflat-v2-use into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #989209 in Launchpad itself: "Timeout searching ubuntu patches"
  https://bugs.launchpad.net/launchpad/+bug/989209

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/bugtaskflat-v2-use/+merge/105545

This branch switches bugtasksearch to use the two new BugTaskFlat columns: date_closed and latest_patch_uploaded. Pretty trivial.
-- 
https://code.launchpad.net/~wgrant/launchpad/bugtaskflat-v2-use/+merge/105545
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/bugtaskflat-v2-use into lp:launchpad.
=== modified file 'lib/lp/bugs/model/bugtaskflat.py'
--- lib/lp/bugs/model/bugtaskflat.py	2012-04-17 02:30:39 +0000
+++ lib/lp/bugs/model/bugtaskflat.py	2012-05-12 01:35:23 +0000
@@ -24,12 +24,14 @@
     bug_id = Int(name='bug')
     bug = Reference(bug_id, 'Bug.id')
     datecreated = DateTime()
+    latest_patch_uploaded = DateTime()
+    date_closed = DateTime()
+    date_last_updated = DateTime()
     duplicateof_id = Int(name='duplicateof')
     duplicateof = Reference(duplicateof_id, 'Bug.id')
     bug_owner_id = Int(name='bug_owner')
     bug_owner = Reference(bug_owner_id, 'Person.id')
     information_type = EnumCol(enum=InformationType)
-    date_last_updated = DateTime()
     heat = Int()
     product_id = Int(name='product')
     product = Reference(product_id, 'Product.id')

=== modified file 'lib/lp/bugs/model/bugtasksearch.py'
--- lib/lp/bugs/model/bugtasksearch.py	2012-05-09 06:13:28 +0000
+++ lib/lp/bugs/model/bugtasksearch.py	2012-05-12 01:35:23 +0000
@@ -115,7 +115,7 @@
     'BugTask.milestoneID': BugTaskFlat.milestone_id,
     'BugTask.assignee': BugTaskFlat.assignee,
     'BugTask.owner': BugTaskFlat.owner,
-    'BugTask.date_closed': BugTask.date_closed,
+    'BugTask.date_closed': BugTaskFlat.date_closed,
     'BugTask.datecreated': BugTaskFlat.datecreated,
     'BugTask._status': BugTaskFlat.status,
     }
@@ -144,12 +144,12 @@
     "dateassigned": (BugTask.date_assigned, [bugtask_join]),
     "datecreated": (BugTaskFlat.datecreated, []),
     "date_last_updated": (BugTaskFlat.date_last_updated, []),
-    "date_closed": (BugTask.date_closed, [bugtask_join]),
+    "date_closed": (BugTaskFlat.date_closed, []),
     "number_of_duplicates": (Bug.number_of_duplicates, [bug_join]),
     "message_count": (Bug.message_count, [bug_join]),
     "users_affected_count": (Bug.users_affected_count, [bug_join]),
     "heat": (BugTaskFlat.heat, []),
-    "latest_patch_uploaded": (Bug.latest_patch_uploaded, [bug_join]),
+    "latest_patch_uploaded": (BugTaskFlat.latest_patch_uploaded, []),
     "milestone_name": (
         Milestone.name,
         [
@@ -387,11 +387,6 @@
         if where_cond is not None:
             extra_clauses.append(where_cond)
 
-    # All the standard args filter on BugTaskFlat, except for
-    # date_closed which isn't denormalised (yet?).
-    if params.date_closed is not None:
-        join_tables.append(bugtask_join)
-
     if params.status is not None:
         extra_clauses.append(
             _build_status_clause(cols['BugTask._status'], params.status))
@@ -476,8 +471,7 @@
 
     if params.attachmenttype is not None:
         if params.attachmenttype == BugAttachmentType.PATCH:
-            extra_clauses.append(Bug.latest_patch_uploaded != None)
-            join_tables.append(bug_join)
+            extra_clauses.append(BugTaskFlat.latest_patch_uploaded != None)
         else:
             extra_clauses.append(
                 cols['Bug.id'].is_in(

=== modified file 'lib/lp/bugs/tests/test_bugtaskflat_triggers.py'
--- lib/lp/bugs/tests/test_bugtaskflat_triggers.py	2012-05-03 01:14:29 +0000
+++ lib/lp/bugs/tests/test_bugtaskflat_triggers.py	2012-05-12 01:35:23 +0000
@@ -33,11 +33,13 @@
     'bugtask',
     'bug',
     'datecreated',
+    'latest_patch_uploaded',
+    'date_closed',
+    'date_last_updated',
     'duplicateof',
     'bug_owner',
     'fti',
     'information_type',
-    'date_last_updated',
     'heat',
     'product',
     'productseries',


Follow ups