ANNOUNCE: python-bugzilla 1.0.0 released
by Cole Robinson
I'm happy to announce a new release of python-bugzilla, version 1.0.0. With
the addition of python3 support, now seemed like as good a time as any to go
1.0 :)
python-bugzilla is a library and commandline tool for interacting with
a bugzilla instance, including querying, modifying, and creating bug reports.
The release can be downloaded from:
https://fedorahosted.org/released/python-bugzilla/python-bugzilla-1.0.0.t...
This release includes:
- Python 3 support (Arun Babu Neelicattu)
- Port to python-requests (Arun Babu Neelicattu)
- bugzilla: new: Add --keywords, --assigned_to, --qa_contact (Lon Hohberger)
- bugzilla: query: Add --quicksearch, --savedsearch
- bugzilla: query: Support saved searches with --from-url
- bugzilla: --sub-component support for all relevant commands
Thanks to everyone who has contributed to this release through testing,
bug reporting, submitting patches, and otherwise sending in feedback!
Thanks,
Cole
10 years, 1 month
Examples of querying with a flag?
by Bryan Kearney
I am trying to use the python api to query based on flags. I have tried
build_qeury with lines like:
flag = ["sat-6.0.3+"],
and
flag = [{"name": "sat-6.0.3", "status": "+"}],
neither of which seem to work. Are there examples of using the API to
query via flags?
Thanks in advance.
-- bk
10 years, 1 month
Not switching python-bugzilla to github
by Cole Robinson
Hey all,
A few times on this mailing list there's been mention of possibly moving to
host on github (mostly through Arun's prodding :) ):
https://lists.fedorahosted.org/pipermail/python-bugzilla/2013-September/0...
I just spent some time considering it some more, and I've decided I don't want
to do the move.
I like github. The main benefits I see for moving there is that 1) It can
double as the project homepage and we can drop trac, 2) it is way faster than
fedorahosted, and 3) it will likely generate more outside contributions
#3 is really the big 'advantage'. But here's the thing, and maybe it's total
sacrilege, but I don't really want to increase the number of contributions.
I more or less fell into this role because a bugzilla.redhat.com update
totally broke python-bugzilla in 2012. I was using the tool locally, and set
out to help fix things. It grew from there to where I'm the primary
maintainer/developer. I put in a lot of time in the first year to make things
robust and basically feature complete, but nowadays I would call
python-bugzilla 'done'. I'm happy to fix bugs, cut releases, add the
occasional feature when a new bugzilla version comes out, but that's about the
extent of my energy for it.
Despite the fact that the tool/library should work with most bugzilla versions
in the wild, the reality is that its primary usage is talking to
bugzilla.redhat.com. Fedora infrastructure depends on it, many many RH
employed people depend on it for their own workflow. My absolute primary
motivation is to keep things working cleanly for those people. My second
motivation is keeping the required maintenance effort as low as possible.
My fear with moving to github is that other people would try out the tool,
find it lacking in their setup, and either file issues or provide non-trivial
patches to do what they want it to do. github makes it really easy. I honestly
don't want it to be easy, because if someone has an idea about adding extra
smarts to the API, or CLI, or making it more pythonic, it's basically all
antithesis to motivation #1, and reviewing those patches is against motivation #2.
And the reality is that there's already a bunch of other tools that do similar
things, just googling 'python bugzilla' brings up a bunch of other options. So
there are other options if people want to make something work in their setup,
I'd rather keep python-bugzilla right where it is.
Another big bit is that I don't have any workflow around github. I have
workflow for bugzilla.redhat.com and patches on mailing lists, it would take
some time for me to integrate keeping up with github into all that. So overall
it would make things harder for me, while providing a big benefit that I don't
want nor do I think the current users would benefit from.
(If there was a way to send pull-request notifications to a mailing list, this
would ease the burden for me a bit. But there isn't:
https://github.com/github/github-services/issues/804 )
So, yeah. Questions, comments, insults, ...?
- Cole
10 years, 1 month
[PATCH] Fix bugzilla detection behind proxy
by Jani Nikula
Python requests handles proxying, use it also during bugzilla detection
phase. Don't bother with cookies at this point.
---
bugzilla/__init__.py | 3 ++-
bugzilla/base.py | 15 ++++++++-------
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/bugzilla/__init__.py b/bugzilla/__init__.py
index e6fdeef03566..95bf53875c1e 100644
--- a/bugzilla/__init__.py
+++ b/bugzilla/__init__.py
@@ -26,6 +26,7 @@ log = getLogger("bugzilla")
from bugzilla.base import BugzillaBase as _BugzillaBase
from bugzilla.base import BugzillaError
+from bugzilla.base import RequestsTransport
from bugzilla.bugzilla3 import Bugzilla3, Bugzilla32, Bugzilla34, Bugzilla36
from bugzilla.bugzilla4 import Bugzilla4, Bugzilla42, Bugzilla44
from bugzilla.rhbugzilla import RHBugzilla, RHBugzilla3, RHBugzilla4
@@ -39,7 +40,7 @@ class NovellBugzilla(Bugzilla34):
def getBugzillaClassForURL(url):
url = Bugzilla3.fix_url(url)
log.debug("Detecting subclass for %s", url)
- s = ServerProxy(url)
+ s = ServerProxy(url, RequestsTransport(url))
rhbz = False
bzversion = ''
c = None
diff --git a/bugzilla/base.py b/bugzilla/base.py
index bb7b9405bf1c..4553e1c3cdc7 100644
--- a/bugzilla/base.py
+++ b/bugzilla/base.py
@@ -108,7 +108,7 @@ def _build_cookiejar(cookiefile):
class RequestsTransport(Transport):
user_agent = 'Python/Bugzilla'
- def __init__(self, url, cookiejar,
+ def __init__(self, url, cookiejar=None,
sslverify=True, sslcafile=None, debug=0):
# pylint: disable=W0231
# pylint does not handle multiple import of Transport well
@@ -128,7 +128,7 @@ class RequestsTransport(Transport):
self.request_defaults = {
'cert': sslcafile if self.use_https else None,
- 'cookies': cookiejar,
+ 'cookies': cookiejar if cookiejar else None,
'verify': sslverify,
'headers': {
'Content-Type': 'text/xml',
@@ -157,12 +157,13 @@ class RequestsTransport(Transport):
response.encoding = 'UTF-8'
# update/set any cookies
- for cookie in response.cookies:
- self._cookiejar.set_cookie(cookie)
+ if self._cookiejar is not None:
+ for cookie in response.cookies:
+ self._cookiejar.set_cookie(cookie)
- if self._cookiejar.filename is not None:
- # Save is required only if we have a filename
- self._cookiejar.save()
+ if self._cookiejar.filename is not None:
+ # Save is required only if we have a filename
+ self._cookiejar.save()
response.raise_for_status()
return self.parse_response(response)
--
1.7.9.5
10 years, 1 month