summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTill Maas <opensource@till.name>2009-07-18 23:10:32 +0200
committerTill Maas <opensource@till.name>2009-07-18 23:10:32 +0200
commit73a2ddac4fab166149aae400ef6fad6ce8311401 (patch)
tree2d9fab4d3cdade40c41a78155c0f6885aaeb5dcf
parent31c84d0a6895f321307b7494232c4cc655fecf95 (diff)
parent6f04a3896a3aaed612ede34a45772c69c2705c7c (diff)
downloadcnucnu-73a2ddac4fab166149aae400ef6fad6ce8311401.tar.gz
cnucnu-73a2ddac4fab166149aae400ef6fad6ce8311401.tar.xz
cnucnu-73a2ddac4fab166149aae400ef6fad6ce8311401.zip
Merge branch 'work' into setup
-rwxr-xr-xbugzilla_set_status.py5
-rw-r--r--lib/cnucnu/bugzilla_reporter.py22
2 files changed, 22 insertions, 5 deletions
diff --git a/bugzilla_set_status.py b/bugzilla_set_status.py
index bdb547f..78306e4 100755
--- a/bugzilla_set_status.py
+++ b/bugzilla_set_status.py
@@ -62,6 +62,11 @@ bz.login(user=username, password=getpass.getpass())
#bug_id_list = [b.bug_id for b in bugs]
#bz._update_bugs(bug_id_list, update)
+def set_summary(bug_id, short_desc):
+ update = {'short_desc': short_desc}
+ res = bz._update_bugs(bug_id, update)
+ print res
+ return res
def set_FutureFeature(bug_id):
kw_defaults = {'nomail': 1, 'action': 'add', 'keywords': 'FutureFeature'}
diff --git a/lib/cnucnu/bugzilla_reporter.py b/lib/cnucnu/bugzilla_reporter.py
index 9af3407..1c336d9 100644
--- a/lib/cnucnu/bugzilla_reporter.py
+++ b/lib/cnucnu/bugzilla_reporter.py
@@ -30,10 +30,15 @@ class BugzillaReporter(object):
bug_status_closed = ['CLOSED']
new_bug = {'version': 'rawhide',
- 'status': 'ASSIGNED',
+# Using assigned returns an exception:
+# <Fault 32000: 'You are not allowed to file new bugs with the\n ASSIGNED status.'>
+# if the account is in editbugs, fedora_bugs, fedora_contrib, setpriority
+# if not, then it is silently ignored
+# 'status': 'ASSIGNED',
+ 'status': 'NEW',
'keywords': 'FutureFeature'
}
-
+ summary_template = "%(name)s-%(latest_upstream)s is available"
description_template = \
"""Latest upstream release: %(latest_upstream)s
Current version in %(repo_name)s: %(repo_version)s
@@ -50,6 +55,7 @@ https://fedoraproject.org/wiki/Using_FEver_to_track_upstream_changes"""
self.base_query['product'] = [bugzilla_product]
self.base_query['email1'] = [bugzilla_username]
self.new_bug['product'] = bugzilla_product
+ self.bugzilla_username = bugzilla_username
def report_outdated(self, package, dry_run=True):
@@ -60,13 +66,14 @@ https://fedoraproject.org/wiki/Using_FEver_to_track_upstream_changes"""
open = self.get_open(package)
if not open:
bug = {'component': package.name,
- 'summary': "%(name)s-%(latest_upstream)s is available" % package,
+ 'summary': self.summary_template % package,
'description': self.description_template % package
}
bug.update(self.new_bug)
if not dry_run:
new_bug = self.bz.createbug(**bug)
+ print self.bz._proxy.bugzilla.changeStatus(new_bug.bug_id, "ASSIGNED", self.bugzilla_username, "", "", False, False, 1)
print "https://bugzilla.redhat.com/show_bug.cgi?id=%s" % new_bug.bug_id
else:
pprint(bug)
@@ -80,8 +87,13 @@ https://fedoraproject.org/wiki/Using_FEver_to_track_upstream_changes"""
bug_version = summary.split(" ")[0][len(package.name)+1:]
if bug_version != package.latest_upstream:
- # :TODO:
- print "bug needs to be updated, but python-bugzilla seems not to support updating summary"
+ # :TODO: comment creation untested
+ update = {'short_desc': self.summary_template % package,
+ 'comment': self.description_template % package
+ }
+ res = self.bz._update_bugs(open_bug.bug_id, update)
+ print res
+ return res
else:
for bug in matching_bugs:
print "bug already filed: https://bugzilla.redhat.com/show_bug.cgi?id=%s %s" % (bug.bug_id, bug.bug_status)