launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #00221
[Merge] lp:~brian-murray/launchpad/bug-320596 into lp:launchpad/devel
Brian Murray has proposed merging lp:~brian-murray/launchpad/bug-320596 into lp:launchpad/devel.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
#320596 Series.searchTasks() always returns an empty collection
https://bugs.launchpad.net/bugs/320596
Remove the default value of True for omit_targeted so that bug tasks targeted to a milestone are no longer hidden in search results.
Tests modified:
bin/test -cvvt xx-bug.txt -t bugtask-search.txt
--
https://code.launchpad.net/~brian-murray/launchpad/bug-320596/+merge/30690
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~brian-murray/launchpad/bug-320596 into lp:launchpad/devel.
=== modified file 'lib/lp/bugs/doc/bugtask-search.txt'
--- lib/lp/bugs/doc/bugtask-search.txt 2010-07-22 12:17:41 +0000
+++ lib/lp/bugs/doc/bugtask-search.txt 2010-07-22 17:24:56 +0000
@@ -1364,3 +1364,25 @@
... series_tasks.count())
>>> found_bugtasks.count() == combined_bugtasks_count
True
+
+
+== Using omit_targeted parameter ==
+
+Searching for a distribution's series bug tasks combined with the
+omit_targeted parameter.
+
+ >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
+ >>> ubuntu_hoary = ubuntu.getSeries('hoary')
+ >>> hoary_cnews = ubuntu_hoary.getSourcePackage('cnews')
+ >>> bug = factory.makeBugTask(target=hoary_cnews)
+ >>> default_results = ubuntu_hoary.searchTasks(None)
+ >>> default_results.count()
+ 2
+ >>> not_targeted_results = ubuntu_hoary.searchTasks(None,
+ ... omit_targeted=True)
+ >>> not_targeted_results.count()
+ 0
+ >>> targeted_results = ubuntu_hoary.searchTasks(None,
+ ... omit_targeted=False)
+ >>> targeted_results.count()
+ 2
=== modified file 'lib/lp/bugs/interfaces/bugtask.py'
--- lib/lp/bugs/interfaces/bugtask.py 2010-06-25 15:03:10 +0000
+++ lib/lp/bugs/interfaces/bugtask.py 2010-07-22 17:24:56 +0000
@@ -843,8 +843,7 @@
title=_('Omit bugs marked as duplicate,'), required=False,
default=True)
omit_targeted = Bool(
- title=_('Omit bugs targeted to series'), required=False,
- default=True)
+ title=_('Omit bugs targeted to a series'), required=False)
statusexplanation = TextLine(
title=_("Status notes"), required=False)
has_patch = Bool(
=== modified file 'lib/lp/bugs/stories/webservice/xx-bug-target.txt'
--- lib/lp/bugs/stories/webservice/xx-bug-target.txt 2010-07-14 15:42:40 +0000
+++ lib/lp/bugs/stories/webservice/xx-bug-target.txt 2010-07-22 17:24:56 +0000
@@ -57,8 +57,8 @@
>>> product = factory.makeProduct(name='tags-test-product', owner=salgado)
>>> logout()
-The webserice client is logged in as salgado, so we can add a new
-official tag.
+The webservice client is logged in as salgado, so we can add a new official
+tag.
>>> print webservice.named_post(
... '/tags-test-product', 'addOfficialBugTag',
=== modified file 'lib/lp/bugs/stories/webservice/xx-bug.txt'
--- lib/lp/bugs/stories/webservice/xx-bug.txt 2010-06-30 21:19:36 +0000
+++ lib/lp/bugs/stories/webservice/xx-bug.txt 2010-07-22 17:24:56 +0000
@@ -1494,6 +1494,37 @@
http://.../ubuntu/+bug/2
http://.../ubuntu/+source/linux-source-2.6.15/+bug/10
+It is possible to omit bug tasks targeted to a release in a search, but the
+default is not to hide these.
+
+ >>> from lp.registry.interfaces.distribution import IDistributionSet
+ >>> login('foo.bar@xxxxxxxxxxxxx')
+ >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
+ >>> release = factory.makeDistroRelease(distribution=ubuntu,
+ ... name='inkanyamba')
+ >>> bug = factory.makeBugTask(target=release)
+ >>> logout()
+
+ >>> pprint_collection(webservice.named_get(
+ ... webservice.getAbsoluteUrl('/ubuntu/inkanyamba'),
+ ... 'searchTasks').jsonBody())
+ start: 0
+ total_size: 1
+ ...
+ ---
+ >>> pprint_collection(webservice.named_get(
+ ... webservice.getAbsoluteUrl('/ubuntu/inkanyamba'),
+ ... 'searchTasks', omit_targeted=False).jsonBody())
+ start: 0
+ total_size: 1
+ ...
+ ---
+ >>> pprint_collection(webservice.named_get(
+ ... webservice.getAbsoluteUrl('/ubuntu/inkanyamba'),
+ ... 'searchTasks', omit_targeted=True).jsonBody())
+ start: None
+ total_size: 0
+ ---
Hardware related bug tasks
~~~~~~~~~~~~~~~~~~~~~~~~~~