Bug 485777

Summary: xmlrpc query() method does not handle bug_status correctly
Product: [Community] Bugzilla Reporter: Toshio Ernie Kuratomi <a.badger>
Component: WebServiceAssignee: PnT DevOps Devs <hss-ied-bugs>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: 3.2CC: dkl
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-02-16 19:37:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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