Make IPerson an IHasBugs and make sure calling searchTasks on it works

Bug #282178 reported by Markus Korn
28
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Medium
Markus Korn

Bug Description

Related branches

Revision history for this message
Steve Beattie (sbeattie) wrote :

This bug, in combination with bug 314432 and bug 320596 make it difficult for people involved with Stable Release Updates (SRUs) for Ubuntu to use the launchpad api for tools. Typically, SRUs are fixed in the development (master) task first and then get targeted tasks opened for past releases. An example bug would be bug 208695, where (currently) the master and intrepid tasks are status Won't Fix, but the hardy task is status Fix Committed.

There will usually be one or more teams subscribed to the SRU bug, but because of this bug's missing functionality, we can't just ask for all the open bugs the particular team is susbscribed to.

Because of bug 314432 and the fact that the master task has usually been closed, launchpad.distributions['ubuntu'].searchTasks(bug_subscriber=TEAM) doesn't give us all the open bugs; i.e. the example bug 208695 does not show up on the list.

Because of bug 320596, launchpad.distributions['ubuntu'].series cannot be iterated over with searchTasks(bug_subscriber=TEAM) calls, because they always return an empty result.

I have not yet tried doing iterated queries over distributions['ubuntu'].searchTasks() with each of the closed states as parameters and then getting all of the related_tasks out of each to find the ones I want, but even if it works, it will request lots of tasks from launchpad (including all of the historical SRUs that have already been processed) and seems an extraordinarily inefficient means of collecting this information.

Thanks.

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

I'm trying to look at fixing this bug right now. If I understand the title of this report correctly one thing which has to be done is to inherit IPerson (I think this should be IPeronPublic ?!) from IHasBugs.
But when I try to import IHasBugs in lib/lp/registry/interfaces/person.py I get *a lot* of circular imports. I found out that this errors can be fixed by using lib/canonical/launchpad/interfaces/_schema_circular_imports.py.
Is this the correct way of avoiding such circular imports?

I will attach a branch with the work/experiments I've done so far soonish.

Markus

Revision history for this message
Markus Korn (thekorn) wrote :

I get the attached Oops when I try to open a users page.

Markus Korn (thekorn)
Changed in malone:
assignee: nobody → Markus Korn (thekorn)
Revision history for this message
Markus Korn (thekorn) wrote :

Person.searchTasks() is now working in the linked branch, it returns the tasks related to a user (the tasks shown in bugs.lp.net/~username)

Before requesting a merge I'll have to:
  * think about moving IHasBugs.official_bug_tags somewhere else, as persons can not have official tags
  * add more tests

Once this landed I will add 'alias' methods to IPerson which will map to +assignedbugs, +reportedbugs etc.
I think this methods will be called Person.searchAssignedTasks() , Person.searchReportedTasks(), etc.

Changed in malone:
status: Triaged → In Progress
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
Diogo Matsubara (matsubara) wrote : Bug fixed by a commit
Changed in malone:
status: In Progress → Fix Committed
Deryck Hodge (deryck)
Changed in malone:
milestone: none → 10.02
Deryck Hodge (deryck)
Changed in malone:
status: Fix Committed → Fix Released
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.