Red Hat Bugzilla – Bug 608050
python-bugzilla should use the upstream API to access bugs
Last modified: 2018-04-11 08:39:37 EDT
Description of problem:
Seems python-bugzilla is using bugzilla.getBug() for fetching
bugs, which is to be obsoleted by the upstream API in the future.
Pasting David Lawrence's comment from bug 606695:
> > Petr, which method are you using to get the bug details? Bug.get
> > and Bug.comments or are you using bugzilla.getBug?
> > If you are using the latter, then maybe consider updating your
> > scripts to use the former two calls as they are the upstream API
> > and less likely to change going forward.
> I'm using python-bugzilla's method getbug() which seems to be
> implemented using the old interface:
> #---- Methods for reading bugs and bug info
> def _getbug(self,id):
> '''Return a dict of full bug info for the given bug id'''
> return self._proxy.bugzilla.getBug(id)
Version-Release number of selected component (if applicable):
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release. Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release. This request is not yet committed for
The new API seems to be implemented in class RHBugzilla3. From the documentation:
> By default, _getbugs will multicall getBug(id) multiple times, rather than
> doing a single Bug.get(idlist) call. You can disable this behavior by
> setting the 'multicall' property to False. This will make it somewhat
> faster, but any missing/unreadable bugs will cause the entire call to
> Fault rather than returning any data.
From the above, do you think the multicall property should defaults to False?
No. What should actually be done is what the bug summary says - the RHBugzilla3 class should use Bug.get(idlist) instead of multicalling bugzilla.getBug().
The reason RHBugzilla3 was still using bugzilla.getBug() instead of Bug.get() was that Bug.get() will throw a Fault (and return no results) if any of the given bug ids is invalid.
But now that Bug.get() has the 'permissive' argument - which more closely models the old RHBZ behavior - we can move to the upstream method.
This bug appears to have been reported against 'rawhide' during the Fedora 14 development cycle.
Changing version to '14'.
More information and reason for this action is here:
Still valid, moving to F17
Much of this is done upstream now. The next rhbz update is actually going to remove a ton of custom API calls, so just duping this report to the bug tracking all that work
*** This bug has been marked as a duplicate of bug 886843 ***