Series.searchTasks() always returns an empty collection

Bug #320596 reported by Markus Korn
40
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Brian Murray

Bug Description

When I try to search for tasks in a distro series I always get an empty result, example reproducer:

In [1]: ubuntu = launchpad.distributions["ubuntu"]
In [2]: hardy = ubuntu.getSeries(name_or_version="hardy")
In [3]: list(hardy.searchTasks())
Out[3]: []

Which is obviously wrong.

A workaround is to search using omit_targeted=False, with the example query:

list(hardy.searchTasks(omit_targeted=False))

Related branches

Revision history for this message
Eleanor Berger (intellectronica) wrote :

There's really no need to include the tags in the bug title. That's what the 'tags' field is for :)

Changed in malone:
importance: Undecided → High
milestone: none → 2.2.2
status: New → Triaged
Changed in malone:
milestone: 2.2.2 → none
Revision history for this message
Markus Korn (thekorn) wrote :

Now that I've access to the code, I understand what's going wrong here. The omit_targeted search parameter of the searchTasks() method defaults to `True`, which makes sense for searchTasks() in general but not for searchTasks() on distro series, because we explicitly query for a target here. This default behavior results in a SQL statement like

[...] BugTask.distroseries = 3 AND [...] AND BugTask.distroseries is NULL AND BugTask.productseries is NULL [...]

which of course always returns an empty result.

I would be more than happy to help to fix this, if somebody could show me the best way to change the default value distro series objects only. Or is it not a bug in launchpad, but in the client (launchpadlib) which has to take care of sensible default values?
The attachment lists the SQL statements for the web UI and API calls, maybe the API statement could also be changed to be as simple as the web one by changing the default value of the status parameter.

Revision history for this message
Graham Binns (gmb) wrote : Re: [Bug 320596] Re: Series.searchTasks() always returns an empty collection

2009/7/24 Markus Korn <email address hidden>:
> Now that I've access to the code, I understand what's going wrong here.
> The omit_targeted search parameter of the searchTasks() method defaults
> to `True`, which makes sense for searchTasks() in general but not for
> searchTasks() on distro series, because we explicitly query for a target
> here.
> [...]
> I would be more than happy to help to fix this, if somebody could show me the best way to change the default value distro series objects only. Or is it not a bug in launchpad, but in the client (launchpadlib) which has to take care of sensible default values?

This is definitely a bug in Launchpad, not launchpadlib.

I think the best way to fix this would be to define searchTasks() on
IDistroSeriesPublic and make sure that omit_targeted defaulted to True
instead of being copied from IBugTaskSearch.

description: updated
tags: added: ubuntu-qa
Revision history for this message
Gavin Panella (allenap) wrote :

The branch lp:~allenap/launchpad/patch-report-for-people-and-teams-bug-506018 has a registration of BugsPatchesView for IPerson as well as IHasBugs. As part of fixing this bug (or soon after) we should remove the IPerson registration.

Revision history for this message
Gavin Panella (allenap) wrote :

Wrong bug, please ignore my previous comment.

Changed in malone:
assignee: nobody → Brian Murray (brian-murray)
status: Triaged → In Progress
milestone: none → 10.08
Deryck Hodge (deryck)
Changed in malone:
milestone: 10.08 → 10.09
Revision history for this message
Launchpad QA Bot (lpqabot) wrote : Bug fixed by a commit
tags: added: qa-needstesting
Changed in malone:
status: In Progress → Fix Committed
tags: added: qa-ok
removed: qa-needstesting
Curtis Hovey (sinzui)
Changed in malone:
status: Fix Committed → Fix Released
Revision history for this message
Anthony Wong (anthonywong) wrote :

This issue can still be reproduced, so I am re-opening this bug.

Revision history for this message
Anthony Wong (anthonywong) wrote :

Apparently I don't have the right to re-open, could someone in the Launchpad team take a look at this bug?

Revision history for this message
Brian Murray (brian-murray) wrote :
Download full text (3.5 KiB)

Could you explain what you command you are using that isn't working? It works for me.

(Pdb) [t for t in zesty.searchTasks()]
[<bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/linux/+bug/1635594>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/initramfs-tools/+bug/1631474>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/akonadi/+bug/1633855>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/linux/+bug/1638700>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/mariadb-10.0/+bug/1638125>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/ceph/+bug/1597411>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/ceph/+bug/1604501>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/ceph/+bug/1625489>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/openvswitch/+bug/1448254>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/openvswitch/+bug/1641956>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/linux/+bug/1642299>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/linux/+bug/1636847>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/linux/+bug/1636517>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/unity-control-center/+bug/1639507>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/linux/+bug/1640109>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/linux/+bug/1642044>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/linux/+bug/1642228>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/cloud-initramfs-tools/+bug/1641678>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/pidgin/+bug/1615602>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/cinder/+bug/1641148>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/python-django/+bug/1605278>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/linux/+bug/1585741>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/linux/+bug/1627028>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/linux/+bug/1628111>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/rhythmbox/+bug/1558539>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/maas/+bug/1633064>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/linux/+bug/1634050>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/juju-core/+bug/1634609>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/mysql-5.5/+bug/1633855>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/linux/+bug/1637565>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/openssl1.0/+bug/1638525>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/python-oslo.messaging/+bug/1518430>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/sssd/+bug/1641875>, <bug_task at https://api.launchpad.net/devel/ubuntu/zesty/+source/nova-lxd/+bug/1642274>, <bug_task a...

Read more...

Revision history for this message
Anthony Wong (anthonywong) wrote :

I am basically running the commands in the bug description.

>>> ubuntu = launchpad.distributions["ubuntu"]
>>> xenial = ubuntu.getSeries(name_or_version="xenial")
>>> list(xenial.searchTasks())
[]

[t for t in zesty.searchTasks()] also returns empty.

My python-launchpadlib is 1.10.3-3.

Revision history for this message
Brian Murray (brian-murray) wrote : Re: [Bug 320596] Re: Series.searchTasks() always returns an empty collection

On Fri, Nov 18, 2016 at 04:27:33PM -0000, Anthony Wong wrote:
> I am basically running the commands in the bug description.
>
> >>> ubuntu = launchpad.distributions["ubuntu"]
> >>> xenial = ubuntu.getSeries(name_or_version="xenial")
> >>> list(xenial.searchTasks())
> []
>
> [t for t in zesty.searchTasks()] also returns empty.
>
> My python-launchpadlib is 1.10.3-3.

What version of the Launchpad API are you connecting to? It works for me
with devel, but not with 1.0.

--
Brian Murray

Revision history for this message
Anthony Wong (anthonywong) wrote :

Brian, you are right. I didn't specify version='devel' when logging in. After I have added that, the result is no longer empty.
Thanks for the help.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.