Merge lp:~brian-murray/ubuntu-archive-tools/sru-report-uploaders into lp:ubuntu-archive-tools

Proposed by Brian Murray
Status: Merged
Merged at revision: 1086
Proposed branch: lp:~brian-murray/ubuntu-archive-tools/sru-report-uploaders
Merge into: lp:ubuntu-archive-tools
Diff against target: 144 lines (+36/-19)
1 file modified
sru-report (+36/-19)
To merge this branch: bzr merge lp:~brian-murray/ubuntu-archive-tools/sru-report-uploaders
Reviewer Review Type Date Requested Status
Steve Langasek Pending
Ubuntu Package Archive Administrators Pending
Review via email: mp+318686@code.launchpad.net

Description of the change

I realized I read the sru-report sometimes looking for stuff I uploaded and just have to try and remember what packages I uploaded which is ripe for failure. I thought it'd be great if the report showed the package creator and signer so made that change.

It'll also be useful to nag people who haven't verified SRUs they uploaded. Just wait to you see the report, the names will surprise you!

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'sru-report'
2--- sru-report 2016-12-19 13:19:31 +0000
3+++ sru-report 2017-03-01 22:14:19 +0000
4@@ -64,6 +64,7 @@
5 DEBUGLEVEL = logging.WARNING
6
7 lp = None
8+lp_url = None
9 ubuntu = None
10 archive = None
11 releases = {} # name -> distro_series
12@@ -76,8 +77,13 @@
13 def current_versions(distro_series, sourcename):
14 '''Get current package versions
15
16- Return map {'release': version, 'updates': version, 'proposed': version,
17- 'changesfiles': [urls_of_proposed_changes], 'published': proposed_date}
18+ Return map {'release': version,
19+ 'updates': version,
20+ 'proposed': version,
21+ 'creator': proposed_creator,
22+ 'signer': proposed_signer,
23+ 'changesfiles': [urls_of_proposed_changes],
24+ 'published': proposed_date}
25 '''
26 global archive
27
28@@ -105,6 +111,8 @@
29 elif p_pocket == 'Proposed':
30 history['changesfiles'].append(pub.changesFileUrl())
31 history['published'] = p_date_pub
32+ history['creator'] = pub.package_creator
33+ history['signer'] = pub.package_signer
34 logging.debug(
35 '%s=%s published to %s/%s on %s' %
36 (sourcename, p_srcpkg_version,
37@@ -138,7 +146,7 @@
38
39 js = ''
40 for b in bugs:
41- js += "window.open('https://bugs.launchpad.net/bugs/%d');" % b
42+ js += "window.open('%s/bugs/%d');" % (lp_url, b)
43 return '<button onclick="%s">%s (%i)</button>' % (js, title, len(bugs))
44
45
46@@ -255,7 +263,8 @@
47 continue
48 print('''<h3>%s</h3>
49 <table id='%s'>
50- <tr><th>Package</th><th>-release</th><th>-updates</th><th>-proposed</th>
51+ <tr><th>Package</th><th>-release</th><th>-updates</th>
52+ <th>-proposed (signer, creator)</th>
53 <th>changelog bugs</th><th>days</th></tr>''' % (release, release))
54 for pkg, pub in sorted(pkg_index[release].iteritems(),
55 key=itemgetter(1)):
56@@ -270,7 +279,7 @@
57 continue
58
59 rpkg = srus[release][pkg]
60- lpurl = 'https://launchpad.net/ubuntu/+source/%s/' % pkg
61+ pkgurl = '%s/ubuntu/+source/%s/' % (lp_url, pkg)
62 age = (datetime.datetime.now() - rpkg['published'].replace(
63 tzinfo=None)).days
64
65@@ -288,13 +297,20 @@
66 % autopkg_fails
67
68 print(' <tr><td><a href="%s">%s</a>%s %s</td> ' %
69- (lpurl, pkg, builds, autopkg_fails))
70- print(' <td><a href="%s">%s</a></td> ' %
71- (lpurl + rpkg['release'], rpkg['release']))
72- print(' <td><a href="%s">%s</a></td> ' %
73- (lpurl + rpkg['updates'], rpkg['updates']))
74- print(' <td><a href="%s">%s</a></td> ' %
75- (lpurl + rpkg['proposed'], rpkg['proposed']))
76+ (pkgurl, pkg, builds, autopkg_fails))
77+ print(' <td><a href="%s">%s</a></td> ' %
78+ (pkgurl + rpkg['release'], rpkg['release']))
79+ print(' <td><a href="%s">%s</a></td> ' %
80+ (pkgurl + rpkg['updates'], rpkg['updates']))
81+ signer = str(rpkg['signer']).split('~')[-1]
82+ uploaders = '<a href="%s/~%s">%s</a>' % \
83+ (lp_url, signer, signer)
84+ if rpkg['creator'] and rpkg['creator'] != rpkg['signer']:
85+ creator = str(rpkg['creator']).split('~')[-1]
86+ uploaders += ', <a href="%s/~%s">%s</a>' % \
87+ (lp_url, creator, creator)
88+ print(' <td><a href="%s">%s</a> (%s)</td> ' %
89+ (pkgurl + rpkg['proposed'], rpkg['proposed'], uploaders))
90 print(' <td>')
91 removable = True
92 antique = False
93@@ -370,9 +386,9 @@
94 continue
95 cls += '"'
96
97- print('<a href="https://bugs.launchpad.net/bugs/%d" '
98+ print('<a href="%s/bugs/%d" '
99 'title="%s" %s>#%d%s</a>' %
100- (b, hover_text.replace('"', ''), cls, b,
101+ (lp_url, b, hover_text.replace('"', ''), cls, b,
102 '(hw)' if 'hw-specific' in t else ''))
103 if antique and removable:
104 proposed_antique.append((releases[release].name, pkg,
105@@ -394,12 +410,12 @@
106 print('''<h3>%s</h3>
107 <table>
108 <tr><th>Package</th><th>-proposed</th><th>-security</th></tr>''' % pkg[0])
109- lpurl = 'https://launchpad.net/ubuntu/+source/%s/' % pkg[1]
110+ pkgurl = '%s/ubuntu/+source/%s/' % (lp_url, pkg[1])
111 (vprop, vsec) = (pkg[2]['proposed'], pkg[2]['security'])
112 print(' <tr><th><a href="%s">%s</a></th> \
113 <td><a href="%s">%s</a></td> \
114 <td><a href="%s">%s</a></td></tr>' % (
115- lpurl, pkg[1], lpurl + vprop, vprop, lpurl + vsec, vsec))
116+ pkgurl, pkg[1], pkgurl + vprop, vprop, pkgurl + vsec, vsec))
117 print('</table>')
118
119 print('''\
120@@ -417,9 +433,9 @@
121 <tr><th>Release</th><th>Unapproved</th><th>New</th></tr>''')
122 for r in sorted(releases):
123 new_url = (
124- 'https://launchpad.net/ubuntu/%s/+queue?queue_state=0' % r)
125+ '%s/ubuntu/%s/+queue?queue_state=0' % (lp_url, r))
126 unapproved_url = (
127- 'https://launchpad.net/ubuntu/%s/+queue?queue_state=1' % r)
128+ '%s/ubuntu/%s/+queue?queue_state=1' % (lp_url, r))
129 print(' <tr><td>%s</td><td><a href="%s">%s</a></td>'
130 '<td><a href="%s">%s</a></tr>' %
131 (r, unapproved_url,
132@@ -564,10 +580,11 @@
133
134 def lpinit():
135 '''Init LP credentials, archive, distro list and sru-team members'''
136- global lp, ubuntu, archive, releases, ignored_commenters
137+ global lp, lp_url, ubuntu, archive, releases, ignored_commenters
138 logging.debug("Initializing LP Credentials")
139 lp = Launchpad.login_anonymously('sru-report', 'production',
140 version="devel")
141+ lp_url = str(lp._root_uri).replace('api.', '').strip('devel/')
142 ubuntu = lp.distributions['ubuntu']
143 archive = ubuntu.getArchive(name='primary')
144 for s in ubuntu.series:

Subscribers

People subscribed via source and target branches