Merge lp:~brian-murray/ubuntu-archive-tools/add-release-tasks into lp:ubuntu-archive-tools

Proposed by Brian Murray
Status: Merged
Merged at revision: 1024
Proposed branch: lp:~brian-murray/ubuntu-archive-tools/add-release-tasks
Merge into: lp:ubuntu-archive-tools
Diff against target: 83 lines (+36/-1)
2 files modified
sru-accept (+18/-0)
sru-review (+18/-1)
To merge this branch: bzr merge lp:~brian-murray/ubuntu-archive-tools/add-release-tasks
Reviewer Review Type Date Requested Status
Ubuntu Package Archive Administrators Pending
Review via email: mp+296374@code.launchpad.net

Description of the change

Sometimes SRU bugs don't have a release task added, these changes will open a task in that situation.

To post a comment you must log in.
1023. By Brian Murray

improve comments

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'sru-accept'
--- sru-accept 2014-12-02 17:23:36 +0000
+++ sru-accept 2016-06-02 22:41:22 +0000
@@ -46,6 +46,8 @@
4646
47def process_bug(launchpad, options, num):47def process_bug(launchpad, options, num):
48 bug = launchpad.bugs[num]48 bug = launchpad.bugs[num]
49 sourcepkg_match = False
50 distroseries_match = False
4951
50 for task in bug.bug_tasks:52 for task in bug.bug_tasks:
51 # Ugly; we have to do URL-parsing to figure this out.53 # Ugly; we have to do URL-parsing to figure this out.
@@ -57,12 +59,28 @@
57 match.group('source') != options.package)):59 match.group('source') != options.package)):
58 print("Ignoring task %s in bug %s" % (task.web_link, num))60 print("Ignoring task %s in bug %s" % (task.web_link, num))
59 continue61 continue
62 sourcepkg_match = True
60 if (match.group('suite') in options.targets and63 if (match.group('suite') in options.targets and
61 task.status not in ("Invalid", "Won't Fix", "Fix Committed",64 task.status not in ("Invalid", "Won't Fix", "Fix Committed",
62 "Fix Released")):65 "Fix Released")):
63 task.status = "Fix Committed"66 task.status = "Fix Committed"
64 task.lp_save()67 task.lp_save()
65 print("Success: task %s in bug %s" % (task.web_link, num))68 print("Success: task %s in bug %s" % (task.web_link, num))
69 distroseries_match = True
70
71 if sourcepkg_match and not distroseries_match:
72 # add a release task
73 lp_url = launchpad._root_uri
74 for series in options.targets:
75 series_task_url = '%subuntu/%s/+source/%s' % (lp_url, series, options.package)
76 sourcepkg_target = launchpad.load(series_task_url)
77 new_task = bug.addTask(target=sourcepkg_target)
78 new_task.status = "Fix Committed"
79 new_task.lp_save()
80 print("LP: #%s added task for %s %s" % (num, options.package, series))
81 if not sourcepkg_match:
82 # warn that the bug has no source package tasks
83 print("LP: #%s has no %s tasks!" % (num, options.package))
6684
67 bug.subscribe(person=launchpad.people['ubuntu-sru'])85 bug.subscribe(person=launchpad.people['ubuntu-sru'])
68 bug.subscribe(person=launchpad.people['sru-verification'])86 bug.subscribe(person=launchpad.people['sru-verification'])
6987
=== modified file 'sru-review'
--- sru-review 2016-05-12 06:43:16 +0000
+++ sru-review 2016-06-02 22:41:22 +0000
@@ -237,6 +237,8 @@
237 bug = launchpad.bugs[num]237 bug = launchpad.bugs[num]
238 sourcepkg = upload.package_name238 sourcepkg = upload.package_name
239 release = upload.distroseries.name239 release = upload.distroseries.name
240 sourcepkg_match = False
241 distroseries_match = False
240 for task in bug.bug_tasks:242 for task in bug.bug_tasks:
241 # Ugly; we have to do URL-parsing to figure this out.243 # Ugly; we have to do URL-parsing to figure this out.
242 # /ubuntu/+source/foo can be fed to launchpad.load() to get a244 # /ubuntu/+source/foo can be fed to launchpad.load() to get a
@@ -247,12 +249,27 @@
247 match.group('source') != sourcepkg)):249 match.group('source') != sourcepkg)):
248 print("Ignoring task %s in bug %s" % (task.web_link, num))250 print("Ignoring task %s in bug %s" % (task.web_link, num))
249 continue251 continue
250 if (match.group('suite') == upload.distroseries.name and252 sourcepkg_match = True
253 if (match.group('suite') == release and
251 task.status not in ("Invalid", "Won't Fix", "Fix Committed",254 task.status not in ("Invalid", "Won't Fix", "Fix Committed",
252 "Fix Released")):255 "Fix Released")):
253 task.status = "Fix Committed"256 task.status = "Fix Committed"
254 task.lp_save()257 task.lp_save()
255 print("Success: task %s in bug %s" % (task.web_link, num))258 print("Success: task %s in bug %s" % (task.web_link, num))
259 distroseries_match = True
260
261 if sourcepkg_match and not distroseries_match:
262 # add a release task
263 lp_url = launchpad._root_uri
264 series_task_url = '%subuntu/%s/+source/%s' % (lp_url, release, sourcepkg)
265 sourcepkg_target = launchpad.load(series_task_url)
266 new_task = bug.addTask(target=sourcepkg_target)
267 new_task.status = "Fix Committed"
268 new_task.lp_save()
269 print("LP: #%s added task for %s %s" % (num, sourcepkg, release))
270 if not sourcepkg_match:
271 # warn that the bug has no source package tasks
272 print("LP: #%s has no %s tasks!" % (num, sourcepkg))
256273
257 # XXX: it might be useful if the package signer/sponsor was274 # XXX: it might be useful if the package signer/sponsor was
258 # subscribed to the bug report275 # subscribed to the bug report

Subscribers

People subscribed via source and target branches