Merge lp:~sil2100/ubuntu-archive-tools/common-sru-process-bug into lp:ubuntu-archive-tools
- common-sru-process-bug
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 1132 |
Proposed branch: | lp:~sil2100/ubuntu-archive-tools/common-sru-process-bug |
Merge into: | lp:ubuntu-archive-tools |
Diff against target: |
427 lines (+142/-234) 3 files modified
sru-accept (+4/-117) sru-review (+4/-117) sru_workflow.py (+134/-0) |
To merge this branch: | bzr merge lp:~sil2100/ubuntu-archive-tools/common-sru-process-bug |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Brian Murray | Approve | ||
Ubuntu Package Archive Administrators | Pending | ||
Review via email: mp+333980@code.launchpad.net |
Commit message
Extract the process_bug() function to a common module so that both sru-review and sru-accept use the same mechanics for updating SRU bugs after acceptance. This also slightly changes the behavior of sru-accept for more than one series.
Description of the change
Extract the process_bug() function to a common module so that both sru-review and sru-accept use the same mechanics for updating SRU bugs after acceptance. This also slightly changes the behavior of sru-accept for more than one series.
Currently we had two versions of process_bug and the sru-accept one was outdated. Having to maintain two of those was crazy.
Also, with this change, sru-accept when called with multiple targets now just runs process_bug() multiple times (e.g. adding one comment per series) instead of once with multiple series in the bug comment. I changed this because it was easier to do and mimics what happens when you use the sru-review tool.
- 1127. By Łukasz Zemczak
-
Merge trunk, resolve conflicts.
- 1128. By Łukasz Zemczak
-
Dumb docstring for the sru_workflow.py file.
Preview Diff
1 | === modified file 'sru-accept' | |||
2 | --- sru-accept 2016-06-07 22:36:28 +0000 | |||
3 | +++ sru-accept 2017-12-07 16:28:26 +0000 | |||
4 | @@ -24,126 +24,11 @@ | |||
5 | 24 | 24 | ||
6 | 25 | import launchpadlib.errors | 25 | import launchpadlib.errors |
7 | 26 | from launchpadlib.launchpad import Launchpad | 26 | from launchpadlib.launchpad import Launchpad |
8 | 27 | from sru_workflow import process_bug | ||
9 | 27 | 28 | ||
10 | 28 | 29 | ||
11 | 29 | CONSUMER_KEY = "sru-accept" | 30 | CONSUMER_KEY = "sru-accept" |
12 | 30 | 31 | ||
13 | 31 | bug_target_re = re.compile( | ||
14 | 32 | r'/ubuntu/(?:(?P<suite>[^/]+)/)?\+source/(?P<source>[^/]+)$') | ||
15 | 33 | |||
16 | 34 | |||
17 | 35 | def join_english_list(words): | ||
18 | 36 | num_words = len(words) | ||
19 | 37 | assert num_words > 0 | ||
20 | 38 | if num_words > 2: | ||
21 | 39 | # Yes, I use the Oxford comma. Deal with it. | ||
22 | 40 | return '%s, and %s' % (', '.join(words[:-1]), words[-1]) | ||
23 | 41 | elif num_words == 2: | ||
24 | 42 | return '%s and %s' % (words[0], words[1]) | ||
25 | 43 | else: | ||
26 | 44 | return words[0] | ||
27 | 45 | |||
28 | 46 | |||
29 | 47 | def process_bug(launchpad, options, num): | ||
30 | 48 | bug = launchpad.bugs[num] | ||
31 | 49 | sourcepkg_match = False | ||
32 | 50 | distroseries_match = False | ||
33 | 51 | |||
34 | 52 | for task in bug.bug_tasks: | ||
35 | 53 | # Ugly; we have to do URL-parsing to figure this out. | ||
36 | 54 | # /ubuntu/+source/foo can be fed to launchpad.load() to get a | ||
37 | 55 | # distribution_source_package, but /ubuntu/hardy/+source/foo can't. | ||
38 | 56 | match = bug_target_re.search(task.target.self_link) | ||
39 | 57 | if (not match or | ||
40 | 58 | (options.package and | ||
41 | 59 | match.group('source') != options.package)): | ||
42 | 60 | print("Ignoring task %s in bug %s" % (task.web_link, num)) | ||
43 | 61 | continue | ||
44 | 62 | sourcepkg_match = True | ||
45 | 63 | if (match.group('suite') in options.targets and | ||
46 | 64 | task.status not in ("Invalid", "Won't Fix", | ||
47 | 65 | "Fix Released")): | ||
48 | 66 | task.status = "Fix Committed" | ||
49 | 67 | task.lp_save() | ||
50 | 68 | print("Success: task %s in bug %s" % (task.web_link, num)) | ||
51 | 69 | distroseries_match = True | ||
52 | 70 | |||
53 | 71 | if sourcepkg_match and not distroseries_match: | ||
54 | 72 | # add a release task | ||
55 | 73 | lp_url = launchpad._root_uri | ||
56 | 74 | for series in options.targets: | ||
57 | 75 | series_task_url = '%subuntu/%s/+source/%s' % \ | ||
58 | 76 | (lp_url, series, options.package) | ||
59 | 77 | sourcepkg_target = launchpad.load(series_task_url) | ||
60 | 78 | new_task = bug.addTask(target=sourcepkg_target) | ||
61 | 79 | new_task.status = "Fix Committed" | ||
62 | 80 | new_task.lp_save() | ||
63 | 81 | print("LP: #%s added task for %s %s" % | ||
64 | 82 | (num, options.package, series)) | ||
65 | 83 | if not sourcepkg_match: | ||
66 | 84 | # warn that the bug has no source package tasks | ||
67 | 85 | print("LP: #%s has no %s tasks!" % (num, options.package)) | ||
68 | 86 | |||
69 | 87 | bug.subscribe(person=launchpad.people['ubuntu-sru']) | ||
70 | 88 | bug.subscribe(person=launchpad.people['sru-verification']) | ||
71 | 89 | |||
72 | 90 | if not options.package or 'linux' not in options.package: | ||
73 | 91 | for t in ('verification-failed', 'verification-done'): | ||
74 | 92 | if t in bug.tags: | ||
75 | 93 | # this dance is needed due to | ||
76 | 94 | # https://bugs.launchpad.net/launchpadlib/+bug/254901 | ||
77 | 95 | tags = bug.tags | ||
78 | 96 | tags.remove(t) | ||
79 | 97 | bug.tags = tags | ||
80 | 98 | bug.lp_save() | ||
81 | 99 | |||
82 | 100 | if 'verification-needed' not in bug.tags: | ||
83 | 101 | # this dance is needed due to | ||
84 | 102 | # https://bugs.launchpad.net/launchpadlib/+bug/254901 | ||
85 | 103 | tags = bug.tags | ||
86 | 104 | tags.append('verification-needed') | ||
87 | 105 | bug.tags = tags | ||
88 | 106 | bug.lp_save() | ||
89 | 107 | |||
90 | 108 | text = ('Hello %s, or anyone else affected,\n\n' % | ||
91 | 109 | re.split(r'[,\s]', bug.owner.display_name)[0]) | ||
92 | 110 | |||
93 | 111 | if options.package: | ||
94 | 112 | text += 'Accepted %s into ' % options.package | ||
95 | 113 | else: | ||
96 | 114 | text += 'Accepted into ' | ||
97 | 115 | if options.package and options.version: | ||
98 | 116 | text += ('%s. The package will build now and be available at ' | ||
99 | 117 | 'https://launchpad.net/ubuntu/+source/%s/%s in a few hours, ' | ||
100 | 118 | 'and then in the -proposed repository.\n\n' % ( | ||
101 | 119 | join_english_list([ | ||
102 | 120 | '%s-proposed' % target | ||
103 | 121 | for target in options.targets]), | ||
104 | 122 | options.package, options.version)) | ||
105 | 123 | else: | ||
106 | 124 | text += ('%s. The package will build now and be available in a few ' | ||
107 | 125 | 'hours in the -proposed repository.\n\n' % ( | ||
108 | 126 | join_english_list([ | ||
109 | 127 | '%s-proposed' % target | ||
110 | 128 | for target in options.targets]))) | ||
111 | 129 | |||
112 | 130 | text += ('Please help us by testing this new package. See ' | ||
113 | 131 | 'https://wiki.ubuntu.com/Testing/EnableProposed for ' | ||
114 | 132 | 'documentation how to enable and use -proposed. Your feedback ' | ||
115 | 133 | 'will aid us getting this update out to other Ubuntu users.\n\n' | ||
116 | 134 | 'If this package fixes the bug for you, please add a comment to ' | ||
117 | 135 | 'this bug, mentioning the version of the package you tested, and ' | ||
118 | 136 | 'change the tag from verification-needed to verification-done. ' | ||
119 | 137 | 'If it does not fix the bug for you, please add a comment ' | ||
120 | 138 | 'stating that, and change the tag to verification-failed. In ' | ||
121 | 139 | 'either case, details of your testing will help us make a better ' | ||
122 | 140 | 'decision.\n\n' | ||
123 | 141 | 'Further information regarding the verification process can be ' | ||
124 | 142 | 'found at ' | ||
125 | 143 | 'https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . ' | ||
126 | 144 | 'Thank you in advance!') | ||
127 | 145 | bug.newMessage(content=text, subject='Please test proposed package') | ||
128 | 146 | |||
129 | 147 | 32 | ||
130 | 148 | def append_series(option, opt_str, value, parser): | 33 | def append_series(option, opt_str, value, parser): |
131 | 149 | if value.endswith('-proposed'): | 34 | if value.endswith('-proposed'): |
132 | @@ -184,7 +69,9 @@ | |||
133 | 184 | if series.status == "Current Stable Release"][0]] | 69 | if series.status == "Current Stable Release"][0]] |
134 | 185 | try: | 70 | try: |
135 | 186 | for num in args: | 71 | for num in args: |
137 | 187 | process_bug(launchpad, options, num) | 72 | for series in options.targets: |
138 | 73 | process_bug( | ||
139 | 74 | launchpad, options.package, options.version, series, num) | ||
140 | 188 | except launchpadlib.errors.HTTPError as err: | 75 | except launchpadlib.errors.HTTPError as err: |
141 | 189 | print("There was an error:") | 76 | print("There was an error:") |
142 | 190 | print(err.content) | 77 | print(err.content) |
143 | 191 | 78 | ||
144 | === modified file 'sru-review' (properties changed: +x to -x) | |||
145 | --- sru-review 2017-12-04 21:56:46 +0000 | |||
146 | +++ sru-review 2017-12-07 16:28:26 +0000 | |||
147 | @@ -43,6 +43,7 @@ | |||
148 | 43 | import webbrowser | 43 | import webbrowser |
149 | 44 | 44 | ||
150 | 45 | from launchpadlib.launchpad import Launchpad | 45 | from launchpadlib.launchpad import Launchpad |
151 | 46 | from sru_workflow import process_bug | ||
152 | 46 | from time import sleep | 47 | from time import sleep |
153 | 47 | 48 | ||
154 | 48 | 49 | ||
155 | @@ -245,122 +246,6 @@ | |||
156 | 245 | subject='Proposed package upload rejected') | 246 | subject='Proposed package upload rejected') |
157 | 246 | 247 | ||
158 | 247 | 248 | ||
159 | 248 | def process_bug(launchpad, upload, num): | ||
160 | 249 | bug_target_re = re.compile( | ||
161 | 250 | r'/ubuntu/(?:(?P<suite>[^/]+)/)?\+source/(?P<source>[^/]+)$') | ||
162 | 251 | bug = launchpad.bugs[num] | ||
163 | 252 | sourcepkg = upload.package_name | ||
164 | 253 | release = upload.distroseries.name | ||
165 | 254 | sourcepkg_match = False | ||
166 | 255 | distroseries_match = False | ||
167 | 256 | for task in bug.bug_tasks: | ||
168 | 257 | # Ugly; we have to do URL-parsing to figure this out. | ||
169 | 258 | # /ubuntu/+source/foo can be fed to launchpad.load() to get a | ||
170 | 259 | # distribution_source_package, but /ubuntu/hardy/+source/foo can't. | ||
171 | 260 | match = bug_target_re.search(task.target.self_link) | ||
172 | 261 | if (not match or | ||
173 | 262 | (sourcepkg and | ||
174 | 263 | match.group('source') != sourcepkg)): | ||
175 | 264 | print("Ignoring task %s in bug %s" % (task.web_link, num)) | ||
176 | 265 | continue | ||
177 | 266 | sourcepkg_match = True | ||
178 | 267 | if (match.group('suite') == release and | ||
179 | 268 | task.status not in ("Invalid", "Won't Fix", | ||
180 | 269 | "Fix Released")): | ||
181 | 270 | task.status = "Fix Committed" | ||
182 | 271 | task.lp_save() | ||
183 | 272 | print("Success: task %s in bug %s" % (task.web_link, num)) | ||
184 | 273 | distroseries_match = True | ||
185 | 274 | |||
186 | 275 | if sourcepkg_match and not distroseries_match: | ||
187 | 276 | # add a release task | ||
188 | 277 | lp_url = launchpad._root_uri | ||
189 | 278 | series_task_url = '%subuntu/%s/+source/%s' % \ | ||
190 | 279 | (lp_url, release, sourcepkg) | ||
191 | 280 | sourcepkg_target = launchpad.load(series_task_url) | ||
192 | 281 | new_task = bug.addTask(target=sourcepkg_target) | ||
193 | 282 | new_task.status = "Fix Committed" | ||
194 | 283 | new_task.lp_save() | ||
195 | 284 | print("LP: #%s added task for %s %s" % (num, sourcepkg, release)) | ||
196 | 285 | if not sourcepkg_match: | ||
197 | 286 | # warn that the bug has no source package tasks | ||
198 | 287 | print("LP: #%s has no %s tasks!" % (num, sourcepkg)) | ||
199 | 288 | |||
200 | 289 | # XXX: it might be useful if the package signer/sponsor was | ||
201 | 290 | # subscribed to the bug report | ||
202 | 291 | bug.subscribe(person=launchpad.people['ubuntu-sru']) | ||
203 | 292 | bug.subscribe(person=launchpad.people['sru-verification']) | ||
204 | 293 | |||
205 | 294 | # there may be something else to sponsor so just warn | ||
206 | 295 | subscribers = [sub.person for sub in bug.subscriptions] | ||
207 | 296 | if launchpad.people['ubuntu-sponsors'] in subscribers: | ||
208 | 297 | print('ubuntu-sponsors is still subscribed to LP: #%s. ' | ||
209 | 298 | 'Is there anything left to sponsor?' % num) | ||
210 | 299 | |||
211 | 300 | if not sourcepkg or 'linux' not in sourcepkg: | ||
212 | 301 | # this dance is needed due to | ||
213 | 302 | # https://bugs.launchpad.net/launchpadlib/+bug/254901 | ||
214 | 303 | btags = bug.tags | ||
215 | 304 | for t in ('verification-failed', 'verification-failed-%s' % release, | ||
216 | 305 | 'verification-done', 'verification-done-%s' % release): | ||
217 | 306 | if t in btags: | ||
218 | 307 | tags = btags | ||
219 | 308 | tags.remove(t) | ||
220 | 309 | bug.tags = tags | ||
221 | 310 | |||
222 | 311 | if 'verification-needed' not in btags: | ||
223 | 312 | btags.append('verification-needed') | ||
224 | 313 | bug.tags = btags | ||
225 | 314 | |||
226 | 315 | needed_tag = 'verification-needed-%s' % release | ||
227 | 316 | if needed_tag not in btags: | ||
228 | 317 | btags.append(needed_tag) | ||
229 | 318 | bug.tags = btags | ||
230 | 319 | |||
231 | 320 | bug.lp_save() | ||
232 | 321 | |||
233 | 322 | |||
234 | 323 | text = ('Hello %s, or anyone else affected,\n\n' % | ||
235 | 324 | re.split(r'[,\s]', bug.owner.display_name)[0]) | ||
236 | 325 | |||
237 | 326 | if sourcepkg: | ||
238 | 327 | text += 'Accepted %s into ' % sourcepkg | ||
239 | 328 | else: | ||
240 | 329 | text += 'Accepted into ' | ||
241 | 330 | if sourcepkg and release: | ||
242 | 331 | text += ('%s-proposed. The package will build now and be available at ' | ||
243 | 332 | 'https://launchpad.net/ubuntu/+source/%s/%s in a few hours, ' | ||
244 | 333 | 'and then in the -proposed repository.\n\n' % ( | ||
245 | 334 | release, sourcepkg, upload.package_version)) | ||
246 | 335 | else: | ||
247 | 336 | text += ('%s-proposed. The package will build now and be available in ' | ||
248 | 337 | 'a few hours in the -proposed repository.\n\n' % ( | ||
249 | 338 | release)) | ||
250 | 339 | |||
251 | 340 | text += ('Please help us by testing this new package. ') | ||
252 | 341 | |||
253 | 342 | if sourcepkg == 'casper': | ||
254 | 343 | text += ('To properly test it you will need to obtain and boot ' | ||
255 | 344 | 'a daily build of a Live CD for %s.' % (release)) | ||
256 | 345 | else: | ||
257 | 346 | text += ('See https://wiki.ubuntu.com/Testing/EnableProposed for ' | ||
258 | 347 | 'documentation on how to enable and use -proposed.') | ||
259 | 348 | |||
260 | 349 | text += ('Your feedback will aid us getting this update out to other ' | ||
261 | 350 | 'Ubuntu users.\n\nIf this package fixes the bug for you, ' | ||
262 | 351 | 'please add a comment to this bug, mentioning the version of the ' | ||
263 | 352 | 'package you tested and change the tag from ' | ||
264 | 353 | 'verification-needed-%s to verification-done-%s. ' | ||
265 | 354 | 'If it does not fix the bug for you, please add a comment ' | ||
266 | 355 | 'stating that, and change the tag to verification-failed-%s. ' | ||
267 | 356 | 'In either case, without details of your testing we will not ' | ||
268 | 357 | 'be able to proceed.\n\nFurther information regarding the ' | ||
269 | 358 | 'verification process can be found at ' | ||
270 | 359 | 'https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . ' | ||
271 | 360 | 'Thank you in advance!' % (release, release, release)) | ||
272 | 361 | bug.newMessage(content=text, subject='Please test proposed package') | ||
273 | 362 | |||
274 | 363 | |||
275 | 364 | if __name__ == '__main__': | 249 | if __name__ == '__main__': |
276 | 365 | 250 | ||
277 | 366 | default_release = 'artful' | 251 | default_release = 'artful' |
278 | @@ -472,7 +357,9 @@ | |||
279 | 472 | print("Accepted") | 357 | print("Accepted") |
280 | 473 | if changes['bugs']: | 358 | if changes['bugs']: |
281 | 474 | for bug_num in changes['bugs']: | 359 | for bug_num in changes['bugs']: |
283 | 475 | process_bug(launchpad, upload, bug_num) | 360 | process_bug( |
284 | 361 | launchpad, upload.package_name, upload.package_version, | ||
285 | 362 | upload.distroseries.name, bug_num) | ||
286 | 476 | else: | 363 | else: |
287 | 477 | print("REJECT the package from -proposed? [yN] ", end="") | 364 | print("REJECT the package from -proposed? [yN] ", end="") |
288 | 478 | response = sys.stdin.readline() | 365 | response = sys.stdin.readline() |
289 | 479 | 366 | ||
290 | === added file 'sru_workflow.py' | |||
291 | --- sru_workflow.py 1970-01-01 00:00:00 +0000 | |||
292 | +++ sru_workflow.py 2017-12-07 16:28:26 +0000 | |||
293 | @@ -0,0 +1,134 @@ | |||
294 | 1 | #!/usr/bin/python3 | ||
295 | 2 | |||
296 | 3 | # Copyright (C) 2017 Canonical Ltd. | ||
297 | 4 | # Author: Brian Murray <brian.murray@canonical.com> | ||
298 | 5 | # Author: Lukasz 'sil2100' Zemczak <lukasz.zemczak@canonical.com> | ||
299 | 6 | |||
300 | 7 | # This program is free software: you can redistribute it and/or modify | ||
301 | 8 | # it under the terms of the GNU General Public License as published by | ||
302 | 9 | # the Free Software Foundation; version 3 of the License. | ||
303 | 10 | # | ||
304 | 11 | # This program is distributed in the hope that it will be useful, | ||
305 | 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
306 | 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
307 | 14 | # GNU General Public License for more details. | ||
308 | 15 | # | ||
309 | 16 | # You should have received a copy of the GNU General Public License | ||
310 | 17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
311 | 18 | |||
312 | 19 | """Portions of SRU-related code that is re-used by various SRU tools.""" | ||
313 | 20 | |||
314 | 21 | import re | ||
315 | 22 | |||
316 | 23 | |||
317 | 24 | def process_bug(launchpad, sourcepkg, version, release, num): | ||
318 | 25 | bug_target_re = re.compile( | ||
319 | 26 | r'/ubuntu/(?:(?P<suite>[^/]+)/)?\+source/(?P<source>[^/]+)$') | ||
320 | 27 | bug = launchpad.bugs[num] | ||
321 | 28 | sourcepkg_match = False | ||
322 | 29 | distroseries_match = False | ||
323 | 30 | for task in bug.bug_tasks: | ||
324 | 31 | # Ugly; we have to do URL-parsing to figure this out. | ||
325 | 32 | # /ubuntu/+source/foo can be fed to launchpad.load() to get a | ||
326 | 33 | # distribution_source_package, but /ubuntu/hardy/+source/foo can't. | ||
327 | 34 | match = bug_target_re.search(task.target.self_link) | ||
328 | 35 | if (not match or | ||
329 | 36 | (sourcepkg and | ||
330 | 37 | match.group('source') != sourcepkg)): | ||
331 | 38 | print("Ignoring task %s in bug %s" % (task.web_link, num)) | ||
332 | 39 | continue | ||
333 | 40 | sourcepkg_match = True | ||
334 | 41 | if (match.group('suite') == release and | ||
335 | 42 | task.status not in ("Invalid", "Won't Fix", | ||
336 | 43 | "Fix Released")): | ||
337 | 44 | task.status = "Fix Committed" | ||
338 | 45 | task.lp_save() | ||
339 | 46 | print("Success: task %s in bug %s" % (task.web_link, num)) | ||
340 | 47 | distroseries_match = True | ||
341 | 48 | |||
342 | 49 | if sourcepkg_match and not distroseries_match: | ||
343 | 50 | # add a release task | ||
344 | 51 | lp_url = launchpad._root_uri | ||
345 | 52 | series_task_url = '%subuntu/%s/+source/%s' % \ | ||
346 | 53 | (lp_url, release, sourcepkg) | ||
347 | 54 | sourcepkg_target = launchpad.load(series_task_url) | ||
348 | 55 | new_task = bug.addTask(target=sourcepkg_target) | ||
349 | 56 | new_task.status = "Fix Committed" | ||
350 | 57 | new_task.lp_save() | ||
351 | 58 | print("LP: #%s added task for %s %s" % (num, sourcepkg, release)) | ||
352 | 59 | if not sourcepkg_match: | ||
353 | 60 | # warn that the bug has no source package tasks | ||
354 | 61 | print("LP: #%s has no %s tasks!" % (num, sourcepkg)) | ||
355 | 62 | |||
356 | 63 | # XXX: it might be useful if the package signer/sponsor was | ||
357 | 64 | # subscribed to the bug report | ||
358 | 65 | bug.subscribe(person=launchpad.people['ubuntu-sru']) | ||
359 | 66 | bug.subscribe(person=launchpad.people['sru-verification']) | ||
360 | 67 | |||
361 | 68 | # there may be something else to sponsor so just warn | ||
362 | 69 | subscribers = [sub.person for sub in bug.subscriptions] | ||
363 | 70 | if launchpad.people['ubuntu-sponsors'] in subscribers: | ||
364 | 71 | print('ubuntu-sponsors is still subscribed to LP: #%s. ' | ||
365 | 72 | 'Is there anything left to sponsor?' % num) | ||
366 | 73 | |||
367 | 74 | if not sourcepkg or 'linux' not in sourcepkg: | ||
368 | 75 | # this dance is needed due to | ||
369 | 76 | # https://bugs.launchpad.net/launchpadlib/+bug/254901 | ||
370 | 77 | btags = bug.tags | ||
371 | 78 | for t in ('verification-failed', 'verification-failed-%s' % release, | ||
372 | 79 | 'verification-done', 'verification-done-%s' % release): | ||
373 | 80 | if t in btags: | ||
374 | 81 | tags = btags | ||
375 | 82 | tags.remove(t) | ||
376 | 83 | bug.tags = tags | ||
377 | 84 | |||
378 | 85 | if 'verification-needed' not in btags: | ||
379 | 86 | btags.append('verification-needed') | ||
380 | 87 | bug.tags = btags | ||
381 | 88 | |||
382 | 89 | needed_tag = 'verification-needed-%s' % release | ||
383 | 90 | if needed_tag not in btags: | ||
384 | 91 | btags.append(needed_tag) | ||
385 | 92 | bug.tags = btags | ||
386 | 93 | |||
387 | 94 | bug.lp_save() | ||
388 | 95 | |||
389 | 96 | text = ('Hello %s, or anyone else affected,\n\n' % | ||
390 | 97 | re.split(r'[,\s]', bug.owner.display_name)[0]) | ||
391 | 98 | |||
392 | 99 | if sourcepkg: | ||
393 | 100 | text += 'Accepted %s into ' % sourcepkg | ||
394 | 101 | else: | ||
395 | 102 | text += 'Accepted into ' | ||
396 | 103 | if sourcepkg and release: | ||
397 | 104 | text += ('%s-proposed. The package will build now and be available at ' | ||
398 | 105 | 'https://launchpad.net/ubuntu/+source/%s/%s in a few hours, ' | ||
399 | 106 | 'and then in the -proposed repository.\n\n' % ( | ||
400 | 107 | release, sourcepkg, version)) | ||
401 | 108 | else: | ||
402 | 109 | text += ('%s-proposed. The package will build now and be available in ' | ||
403 | 110 | 'a few hours in the -proposed repository.\n\n' % ( | ||
404 | 111 | release)) | ||
405 | 112 | |||
406 | 113 | text += ('Please help us by testing this new package. ') | ||
407 | 114 | |||
408 | 115 | if sourcepkg == 'casper': | ||
409 | 116 | text += ('To properly test it you will need to obtain and boot ' | ||
410 | 117 | 'a daily build of a Live CD for %s.' % (release)) | ||
411 | 118 | else: | ||
412 | 119 | text += ('See https://wiki.ubuntu.com/Testing/EnableProposed for ' | ||
413 | 120 | 'documentation on how to enable and use -proposed.') | ||
414 | 121 | |||
415 | 122 | text += ('Your feedback will aid us getting this update out to other ' | ||
416 | 123 | 'Ubuntu users.\n\nIf this package fixes the bug for you, ' | ||
417 | 124 | 'please add a comment to this bug, mentioning the version of the ' | ||
418 | 125 | 'package you tested and change the tag from ' | ||
419 | 126 | 'verification-needed-%s to verification-done-%s. ' | ||
420 | 127 | 'If it does not fix the bug for you, please add a comment ' | ||
421 | 128 | 'stating that, and change the tag to verification-failed-%s. ' | ||
422 | 129 | 'In either case, without details of your testing we will not ' | ||
423 | 130 | 'be able to proceed.\n\nFurther information regarding the ' | ||
424 | 131 | 'verification process can be found at ' | ||
425 | 132 | 'https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . ' | ||
426 | 133 | 'Thank you in advance!' % (release, release, release)) | ||
427 | 134 | bug.newMessage(content=text, subject='Please test proposed package') |
This looks good to me thanks for working on it - I think a docstring in sru_workflow.py would be good though. Additionally, a change of mine was recently merged to ubuntu- archive- tools which changed the content of the comment added to bug reports requesting feed back (lines 121-132) so please be sure not to loose that.
Thanks!