← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jcsackett/launchpad/unused-args-search-60055 into lp:launchpad

 

j.c.sackett has proposed merging lp:~jcsackett/launchpad/unused-args-search-60055 into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  #60055 IProjectSet.search() has unused untested optional arguments
  https://bugs.launchpad.net/bugs/60055


Summary
=======

The ProjectSet has a search parameter with a number of options to restrict the search to projects using various features (e.g. rosetta to restrict a search to ProjectGroups with translatables). This feature isn't actually used or exposed anywhere; it can only be accessed via url hacking.

Since it's not used, and not tested, this kills it.

Implementation
==============
Change the method signature and the function code to dispense with the extra parameters.

Tests
=====
There aren't any tests for this feature (an argument in favor of its deletion). To verify that nothing is damaged from this delete:

bin/test -t projectgroup
-- 
https://code.launchpad.net/~jcsackett/launchpad/unused-args-search-60055/+merge/42192
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jcsackett/launchpad/unused-args-search-60055 into lp:launchpad.
=== modified file 'lib/lp/registry/interfaces/projectgroup.py'
--- lib/lp/registry/interfaces/projectgroup.py	2010-10-31 20:18:45 +0000
+++ lib/lp/registry/interfaces/projectgroup.py	2010-11-29 23:14:21 +0000
@@ -393,10 +393,7 @@
     @operation_parameters(text=TextLine(title=_("Search text")))
     @operation_returns_collection_of(IProjectGroup)
     @export_read_operation()
-    def search(text=None, soyuz=None,
-               rosetta=None, malone=None,
-               bazaar=None,
-               search_products=False):
+    def search(text=None, search_products=False):
         """Search through the Registry database for projects that match the
         query terms. text is a piece of text in the title / summary /
         description fields of project (and possibly product). soyuz,

=== modified file 'lib/lp/registry/model/projectgroup.py'
--- lib/lp/registry/model/projectgroup.py	2010-11-24 11:12:51 +0000
+++ lib/lp/registry/model/projectgroup.py	2010-11-29 23:14:21 +0000
@@ -597,11 +597,7 @@
     def forReview(self):
         return ProjectGroup.select("reviewed IS FALSE")
 
-    def search(self, text=None, soyuz=None,
-               rosetta=None, malone=None,
-               bazaar=None,
-               search_products=False,
-               show_inactive=False):
+    def search(self, text=None, search_products=False, show_inactive=False):
         """Search through the Registry database for project groups that match
         the query terms. text is a piece of text in the title / summary /
         description fields of project group (and possibly product). soyuz,
@@ -614,19 +610,6 @@
         clauseTables = set()
         clauseTables.add('Project')
         queries = []
-        if rosetta:
-            clauseTables.add('Product')
-            clauseTables.add('POTemplate')
-            queries.append('POTemplate.product=Product.id')
-        if malone:
-            clauseTables.add('Product')
-            clauseTables.add('BugTask')
-            queries.append('BugTask.product=Product.id')
-        if bazaar:
-            clauseTables.add('Product')
-            clauseTables.add('ProductSeries')
-            queries.append('(ProductSeries.branch IS NOT NULL)')
-            queries.append('ProductSeries.product=Product.id')
 
         if text:
             if search_products: