Merge lp:~arges/ubuntu-archive-tools/sru-review1 into lp:ubuntu-archive-tools

Proposed by Chris J Arges
Status: Rejected
Rejected by: Steve Langasek
Proposed branch: lp:~arges/ubuntu-archive-tools/sru-review1
Merge into: lp:ubuntu-archive-tools
Diff against target: 72 lines (+20/-9)
1 file modified
sru-review (+20/-9)
To merge this branch: bzr merge lp:~arges/ubuntu-archive-tools/sru-review1
Reviewer Review Type Date Requested Status
Steve Langasek Disapprove
Brian Murray Approve
Review via email: mp+277481@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Brian Murray (brian-murray) wrote :

This looks fine to me, although I'm not perfectly clear on the use case. I think if there are two versions of the package in the queue we should reject one of them, and adding an option to provide the version might result in one of them not being rejected. This could later result in some confusion for the next person processing the queue.

Revision history for this message
Chris J Arges (arges) wrote :

The use case is something like, somebody uploads for both backports and proposed.
Example:

[Source] lxc (source)
1.1.5-0ubuntu3~ubuntu14.04.1 main admin medium ubuntu-server Backports 9 minutes ago

[Source] lxc (source)
1.0.8-0ubuntu0.3 main admin medium ubuntu-server Proposed 19 minutes ago

In this case the tool can't handle both and picks the latest. I just want to review the other upload without rejecting the backports one.

Revision history for this message
Brian Murray (brian-murray) wrote :

Okay, this seems like a useful addition then, thanks! Feel free to make the merge yourself, as I can't because I'm not in ubuntu-archive.

review: Approve
Revision history for this message
Steve Langasek (vorlon) wrote :

In the meantime, this was implemented otherwise in the branch.

review: Disapprove
Revision history for this message
Steve Langasek (vorlon) wrote :

actually, there are two pieces of this that are still relevant (there's a --version option, but we still get an error on multiple uploads telling us to handle manually!) So I'll fix this up and apply it.

review: Approve
Revision history for this message
Steve Langasek (vorlon) wrote :

nope, on further review, current sru-review works fine with --version :)

review: Disapprove

Unmerged revisions

983. By Chris J Arges

sru-review: Add version flag to select when multiple version are in queue

This helps if multiple versions are in the queue. In addition if there is
a version in -backports we may accidentally pick up that diff instead of the
one we want if that diff is before the correct one.

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 2015-10-22 15:58:33 +0000
3+++ sru-review 2015-11-13 20:05:58 +0000
4@@ -62,6 +62,9 @@
5 "-p", dest="ppa", metavar="LP_USER/PPA_NAME",
6 help="Check a PPA instead of the Ubuntu unapproved queue")
7 parser.add_option(
8+ "--version", dest="version",
9+ help="Only use specific package version (optional)")
10+ parser.add_option(
11 "-b", "--browser", dest="browser", action="store_true",
12 default=True, help="Open Launchpad bugs in browser")
13 parser.add_option(
14@@ -104,7 +107,7 @@
15 return info
16
17
18-def from_queue(options, archive, sourcepkg, series):
19+def from_queue(options, archive, sourcepkg, series, version):
20 '''Get package_upload from LP and debdiff from queue page.
21
22 Return (package_upload, changes URL, debdiff URL) tuple.
23@@ -116,14 +119,15 @@
24 uploads = [upload for upload in
25 series.getPackageUploads(archive=archive, exact_match=True,
26 name=sourcepkg, pocket='Proposed',
27- status=options.queue)]
28+ status=options.queue, version=version)]
29+
30 if len(uploads) == 0:
31 print('ERROR: Queue does not have an upload of this source.',
32 file=sys.stderr)
33 sys.exit(1)
34- if len(uploads) > 1:
35+ if len(uploads) > 1 and version is None:
36 print('ERROR: Queue has more than one upload of this source, '
37- 'please handle manually', file=sys.stderr)
38+ 'please handle manually, or use --version flag', file=sys.stderr)
39 sys.exit(1)
40 upload = uploads[0]
41
42@@ -145,10 +149,17 @@
43
44 if options.diff:
45 oops_re = re.compile('class="oopsid">(OOPS[a-zA-Z0-9-]+)<')
46- debdiff_re = re.compile(
47- 'href="(http://launchpadlibrarian.net/'
48- '\d+/%s_[^"_]+_[^_"]+\.diff\.gz)">\s*diff from' %
49- re.escape(quote(sourcepkg)))
50+ if version is None:
51+ debdiff_re = re.compile(
52+ 'href="(http://launchpadlibrarian.net/'
53+ '\d+/%s_[^"_]+_[^_"]+\.diff\.gz)">\s*diff from' %
54+ re.escape(quote(sourcepkg)))
55+ else:
56+ debdiff_re = re.compile(
57+ 'href="(http://launchpadlibrarian.net/'
58+ '\d+/%s_[^_"]+_%s\.diff\.gz)">\s*diff from' %
59+ (re.escape(quote(sourcepkg)), re.escape(quote(version))))
60+
61
62 queue_html = urlopen(queue_url).read()
63
64@@ -334,7 +345,7 @@
65 (changes_url, debdiff_url) = from_ppa(opts, sourcepkg, user, ppaname)
66 else:
67 (upload, changes_url, debdiff_url) = from_queue(
68- opts, archive, sourcepkg, series)
69+ opts, archive, sourcepkg, series, opts.version)
70
71 # Check for existing version in proposed
72 if series != ubuntu.current_series:

Subscribers

People subscribed via source and target branches