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
1=== modified file 'sru-accept'
2--- sru-accept 2014-12-02 17:23:36 +0000
3+++ sru-accept 2016-06-02 22:41:22 +0000
4@@ -46,6 +46,8 @@
5
6 def process_bug(launchpad, options, num):
7 bug = launchpad.bugs[num]
8+ sourcepkg_match = False
9+ distroseries_match = False
10
11 for task in bug.bug_tasks:
12 # Ugly; we have to do URL-parsing to figure this out.
13@@ -57,12 +59,28 @@
14 match.group('source') != options.package)):
15 print("Ignoring task %s in bug %s" % (task.web_link, num))
16 continue
17+ sourcepkg_match = True
18 if (match.group('suite') in options.targets and
19 task.status not in ("Invalid", "Won't Fix", "Fix Committed",
20 "Fix Released")):
21 task.status = "Fix Committed"
22 task.lp_save()
23 print("Success: task %s in bug %s" % (task.web_link, num))
24+ distroseries_match = True
25+
26+ if sourcepkg_match and not distroseries_match:
27+ # add a release task
28+ lp_url = launchpad._root_uri
29+ for series in options.targets:
30+ series_task_url = '%subuntu/%s/+source/%s' % (lp_url, series, options.package)
31+ sourcepkg_target = launchpad.load(series_task_url)
32+ new_task = bug.addTask(target=sourcepkg_target)
33+ new_task.status = "Fix Committed"
34+ new_task.lp_save()
35+ print("LP: #%s added task for %s %s" % (num, options.package, series))
36+ if not sourcepkg_match:
37+ # warn that the bug has no source package tasks
38+ print("LP: #%s has no %s tasks!" % (num, options.package))
39
40 bug.subscribe(person=launchpad.people['ubuntu-sru'])
41 bug.subscribe(person=launchpad.people['sru-verification'])
42
43=== modified file 'sru-review'
44--- sru-review 2016-05-12 06:43:16 +0000
45+++ sru-review 2016-06-02 22:41:22 +0000
46@@ -237,6 +237,8 @@
47 bug = launchpad.bugs[num]
48 sourcepkg = upload.package_name
49 release = upload.distroseries.name
50+ sourcepkg_match = False
51+ distroseries_match = False
52 for task in bug.bug_tasks:
53 # Ugly; we have to do URL-parsing to figure this out.
54 # /ubuntu/+source/foo can be fed to launchpad.load() to get a
55@@ -247,12 +249,27 @@
56 match.group('source') != sourcepkg)):
57 print("Ignoring task %s in bug %s" % (task.web_link, num))
58 continue
59- if (match.group('suite') == upload.distroseries.name and
60+ sourcepkg_match = True
61+ if (match.group('suite') == release and
62 task.status not in ("Invalid", "Won't Fix", "Fix Committed",
63 "Fix Released")):
64 task.status = "Fix Committed"
65 task.lp_save()
66 print("Success: task %s in bug %s" % (task.web_link, num))
67+ distroseries_match = True
68+
69+ if sourcepkg_match and not distroseries_match:
70+ # add a release task
71+ lp_url = launchpad._root_uri
72+ series_task_url = '%subuntu/%s/+source/%s' % (lp_url, release, sourcepkg)
73+ sourcepkg_target = launchpad.load(series_task_url)
74+ new_task = bug.addTask(target=sourcepkg_target)
75+ new_task.status = "Fix Committed"
76+ new_task.lp_save()
77+ print("LP: #%s added task for %s %s" % (num, sourcepkg, release))
78+ if not sourcepkg_match:
79+ # warn that the bug has no source package tasks
80+ print("LP: #%s has no %s tasks!" % (num, sourcepkg))
81
82 # XXX: it might be useful if the package signer/sponsor was
83 # subscribed to the bug report

Subscribers

People subscribed via source and target branches