New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFE: Support bugzilla REST API #75
Comments
When the REST API will be supported by python-bugzilla? Thanks! |
GothenburgBitFactory/bugwarrior#697 shows Mozilla dropping support for the XMLRPC APi. Will support be added here, soon, or should we plan to call the REST API directly in bugwarrior? |
I took a look at what it would mean to add REST support to this library -- XMLRPC is pretty deeply ingrained, and I suspect it would be difficult or impossible to retain the same Python and CLI APIs with a How would you see this being done? |
I was hoping to get to this over xmas break or early january, but no guarantees. Here's how I see it happening:
class BugzillaBackendXMLRPC(object):
...
def bug_update(self, args):
return self._xmlrpc.Bug.update(args)
That's the mechanical part that should be API transparent. From there you can split out a base class _BackendBase that defines a common API, start implementing a BugzillaBackendRest, and continuing to make sure the API passes as new APIs are implemented. Something like that. I'm happy to take patches for any of those steps. Doing it as incrementally as possible will make it easier for review and testing |
Thanks! That sounds like a good plan! |
Hm, the second step has turned out to be a lot more complicated: REST doesn't support login, cookies, etc., so a great deal of the functionality involving the rcfile, config options, etc., need to change. The RHBugzilla hack is a bit confusing in there, too. I'm not sure I'll be able to make this work, at least not in a way that would make any sense in a review or have any chance of actually working against bugzilla's other that Mozilla or in modalities (such as CLI) other than the one I use. |
Thanks for attempting it. If you get something even partially working it's useful to share. If the REST API means that existing functionality no longer works, so be it; we will just have to live with it. So even if you can get just one auth method working (API key I presume), and hack that into place, but then with that get most other API usage to work in a relatively clean way, that's a big step in the right direction. We could also start a side branch work work-in-progress will happen |
Re: side branch, even if you get something working that full on comments out code or changes the default to be REST based, that can be a step for further exploring. So don't worry about making it play nice with the existing code in the early stages |
Any chance we can drop the RHBugzilla support? That's .. quite a hack. |
In particular, I'm getting errors like these:
and I think it's because the rh detection is failing, but I can't quite figure out how it used to work with the tests (it depends on url being set, but url isn't set..) |
Here's my work so far |
We probably can't drop it entirely from the API, like fully removing the class. But if we can fold the behavior into the base class and just keep RHBugzilla as an alias for Bugzilla, that would be fine. If for a first pass RHBugzilla is totally busted, that's fine with me, I'll need to dig more into it all to give useful feedback. I'll try to check your code in the latter half of this week. Thanks again! |
This is in preparation for python-bugzilla#75.
This is in preparation for #75. Reviewed-by: Cole Robinson <crobinso@redhat.com>
I've pushed a complete REST implementation upstream. The only public compatibility issues that I know of are:
There's some small heuristics like, if we see To force use of REST via the API, use Any testing will be much appreciated! |
For bugzilla 5 and later, the XMLRPC API is deprecated and won't be receiving new features, and eventually removed (though I suspect not for a while). So we need to add support for the REST API to python-bugzilla soon
The text was updated successfully, but these errors were encountered: