Merge lp:~brian-murray/ubuntu-archive-tools/reject-comment-bug into lp:ubuntu-archive-tools

Proposed by Brian Murray
Status: Merged
Merged at revision: 1072
Proposed branch: lp:~brian-murray/ubuntu-archive-tools/reject-comment-bug
Merge into: lp:ubuntu-archive-tools
Diff against target: 37 lines (+15/-0)
1 file modified
sru-review (+15/-0)
To merge this branch: bzr merge lp:~brian-murray/ubuntu-archive-tools/reject-comment-bug
Reviewer Review Type Date Requested Status
Steve Langasek Needs Fixing
Review via email: mp+313049@code.launchpad.net

Description of the change

When rejecting an upload from the -proposed queue also comment on the bug as to why the upload was rejected.

To post a comment you must log in.
Revision history for this message
Steve Langasek (vorlon) :
review: Needs Fixing
1072. By Brian Murray

modify comment used based on reviewer feedback

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'sru-review'
2--- sru-review 2016-12-02 00:07:55 +0000
3+++ sru-review 2016-12-12 20:51:03 +0000
4@@ -235,6 +235,15 @@
5 return (changes_url, debdiff_url)
6
7
8+def reject_comment(launchpad, num, package, release, reason):
9+ bug = launchpad.bugs[num]
10+ text = ('An upload of %s to %s-proposed has been rejected from the upload '
11+ 'queue for the following 'reason: "%s".' %
12+ (package, release, reason))
13+ bug.newMessage(content=text,
14+ subject='Proposed package upload rejected')
15+
16+
17 def process_bug(launchpad, upload, num):
18 bug_target_re = re.compile(
19 r'/ubuntu/(?:(?P<suite>[^/]+)/)?\+source/(?P<source>[^/]+)$')
20@@ -463,11 +472,17 @@
21 response = sys.stdin.readline()
22 if response.strip().lower().startswith('y'):
23 print("Please give a reason for the rejection.")
24+ print("Be advised it will appear in the bug.")
25 reason = sys.stdin.readline().strip()
26 if reason == '':
27 print("A reason must be provided.")
28 sys.exit(1)
29 upload.rejectFromQueue(comment=reason)
30+ if changelog_bugs:
31+ for bug_num in changes['bugs']:
32+ reject_comment(launchpad, bug_num,
33+ sourcepkg, opts.release,
34+ reason)
35 print("Rejected")
36 else:
37 print("Not accepted")

Subscribers

People subscribed via source and target branches