Bug 485777 - xmlrpc query() method does not handle bug_status correctly
Summary: xmlrpc query() method does not handle bug_status correctly
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Bugzilla
Classification: Community
Component: WebService
Version: 3.2
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: PnT DevOps Devs
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-02-16 19:08 UTC by Toshio Ernie Kuratomi
Modified: 2013-06-24 02:15 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2009-02-16 19:37:35 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Mozilla Foundation 478771 0 None None None Never

Description Toshio Ernie Kuratomi 2009-02-16 19:08:21 UTC
Description of problem:

When using the bugzilla xmlrpc query method via python-bugzilla, we're unable to query for the complete list of bugs that have a status other than CLOSED due to a bug in query() when listing all but one bug_status.

For instance, 'yum', has 1844 bugs total and 38 that are not closed but this query returns all 1844 bugs::

  import bugzilla
  bz = bugzilla.Bugzilla(url='https://bugzilla.redhat.com/xmlrpc.cgi')
  query = {'product': 'Fedora',
           'component': 'yum',
           'bug_status': ['ASSIGNED', 'NEW', 'NEEDINFO', 'MODIFIED',
               'ON_DEV', 'ON_QA', 'VERIFIED', 'FAILS_QA',
               'RELEASE_PENDING', 'POST'] }
  buglist = bz.query(query)
  len(buglist)


The strange thing is that if I remove *any* one of the statuses from bug_status, we get the proper bugs back.  (For instance, removing either 'RELEASE_PENDING' or 'POST' shows only 38 bugs; removing 'NEW' results in 11 bugs).

Comment 1 David Lawrence 2009-02-16 19:37:35 UTC
This is a bug in Bugzilla that when it looks at your search criteria and more specifically the values you have entered for bug_status, it does a simple comparison to see how many statuses you provided and how many total statuses the system uses. So if they are equal, it assumes you want all bugs for any status so it drops that part from the search criteria.

The issue here is that NEEDINFO is not currently a valid bug state but by having it in the list it equals out to the same number of states the system uses. By substituting NEEDINFO with CLOSED you would have the right full status list.

So as a workaround this problem to get you going, simply drop NEEDINFO from your list and it should do what you need. That way your list is not equal to all of the statuses and it will not drop that part.

Dave


Note You need to log in before you can comment on or make changes to this bug.