Merge lp:~wgrant/lp-ftbfs-report/customise-archs into lp:lp-ftbfs-report

Proposed by William Grant
Status: Merged
Merged at revision: 47
Proposed branch: lp:~wgrant/lp-ftbfs-report/customise-archs
Merge into: lp:lp-ftbfs-report
Prerequisite: lp:~wgrant/lp-ftbfs-report/include-bugs
Diff against target: 103 lines (+30/-18)
2 files modified
source/build_status.html (+12/-4)
source/build_status.py (+18/-14)
To merge this branch: bzr merge lp:~wgrant/lp-ftbfs-report/customise-archs
Reviewer Review Type Date Requested Status
Michael Bienia Pending
Review via email: mp+78533@code.launchpad.net

Commit message

Allow commandline customisation of shown architectures.

Description of the change

Drop multi-series support, allow manual specification of archs on the commandline, and automatically work out main/ports.

This is preparatory work for rebuild support.

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
=== modified file 'source/build_status.html'
--- source/build_status.html 2011-10-07 03:30:31 +0000
+++ source/build_status.html 2011-10-07 03:30:31 +0000
@@ -36,8 +36,12 @@
36 <th rowspan="2">Version</th>36 <th rowspan="2">Version</th>
37 <th rowspan="2" onmouseover="Tip('{{ set_tooltip }}')"37 <th rowspan="2" onmouseover="Tip('{{ set_tooltip }}')"
38 onmouseout="UnTip()">Set?</th>38 onmouseout="UnTip()">Set?</th>
39 <th colspan="2" class="center">Main archive</th>39 {% if archs_by_archive['main'] %}
40 <th colspan="2" class="center">Ports archive</th>40 <th colspan="{{ archs_by_archive['main']|count }}" class="center">Main archive</th>
41 {% endif %}
42 {% if archs_by_archive['ports'] %}
43 <th colspan="{{ archs_by_archive['ports']|count }}" class="center">Ports archive</th>
44 {% endif %}
41 <th rowspan="2"/>Bugs</th>45 <th rowspan="2"/>Bugs</th>
42 <th rowspan="2"/>46 <th rowspan="2"/>
43 </tr>47 </tr>
@@ -152,8 +156,12 @@
152 <thead>156 <thead>
153 <tr>157 <tr>
154 <th colspan="2" rowspan="2">Failure type</th>158 <th colspan="2" rowspan="2">Failure type</th>
155 <th colspan="2" class="center">Main archive</th>159 {% if archs_by_archive['main'] %}
156 <th colspan="2" class="center">Ports archive</th>160 <th colspan="{{ archs_by_archive['main']|count }}" class="center">Main archive</th>
161 {% endif %}
162 {% if archs_by_archive['ports'] %}
163 <th colspan="{{ archs_by_archive['ports']|count }}" class="center">Ports archive</th>
164 {% endif %}
157 </tr>165 </tr>
158 <tr>166 <tr>
159 {% for arch in arch_list -%}167 {% for arch in arch_list -%}
160168
=== modified file 'source/build_status.py'
--- source/build_status.py 2011-10-07 03:30:31 +0000
+++ source/build_status.py 2011-10-07 03:30:31 +0000
@@ -31,7 +31,7 @@
3131
32lp_service = 'production'32lp_service = 'production'
33api_version = '1.0'33api_version = '1.0'
34default_arch_list = ('i386', 'amd64', 'armel', 'powerpc')34default_arch_list = []
35find_tagged_bugs = 'ftbfs'35find_tagged_bugs = 'ftbfs'
36apt_pkg.InitSystem()36apt_pkg.InitSystem()
3737
@@ -230,7 +230,7 @@
230230
231 return cur_last_published231 return cur_last_published
232232
233def generate_page(series, template = 'build_status.html', arch_list = default_arch_list):233def generate_page(series, archs_by_archive, template = 'build_status.html', arch_list = default_arch_list):
234 try:234 try:
235 out = open('../%s.html' % series.name, 'w')235 out = open('../%s.html' % series.name, 'w')
236 except IOError:236 except IOError:
@@ -274,6 +274,7 @@
274 data['series'] = series274 data['series'] = series
275 data['active_series_list'] = active_series_list275 data['active_series_list'] = active_series_list
276 data['arch_list'] = arch_list276 data['arch_list'] = arch_list
277 data['archs_by_archive'] = archs_by_archive
277 data['lastupdate'] = time.strftime('%F %T %z')278 data['lastupdate'] = time.strftime('%F %T %z')
278 data['packagesets'] = packagesets_ftbfs279 data['packagesets'] = packagesets_ftbfs
279280
@@ -335,17 +336,20 @@
335 ubuntu = launchpad.distributions['ubuntu']336 ubuntu = launchpad.distributions['ubuntu']
336 active_series_list = sorted([s for s in ubuntu.series if s.active], key = attrgetter('name'))337 active_series_list = sorted([s for s in ubuntu.series if s.active], key = attrgetter('name'))
337338
338 if len(sys.argv) > 1:339 assert len(sys.argv) >= 3
339 series_list = []340
340 for i in sys.argv[1:]:341 try:
341 try:342 series_list = [ubuntu.getSeries(name_or_version = sys.argv[1])]
342 series_list.append(ubuntu.getSeries(name_or_version = i))343 except HTTPError:
343 except HTTPError:344 print 'Error: %s is not a valid name or version' % sys.argv[1]
344 print 'Error: %s is not a valid name or version' % i345 sys.exit(1)
345 series_list.sort(key = attrgetter('name'))346
346347 archs_by_archive = dict(main=[], ports=[])
347 else:348 for arch in sys.argv[2:]:
348 series_list = (ubuntu.current_series,)349 das = series_list[0].getDistroArchSeries(archtag=arch)
350 archs_by_archive[das.official and 'main' or 'ports'].append(arch)
351 default_arch_list.extend(archs_by_archive['main'])
352 default_arch_list.extend(archs_by_archive['ports'])
349353
350 for series in series_list:354 for series in series_list:
351 print "Generating FTBFS for %s" % series.fullseriesname355 print "Generating FTBFS for %s" % series.fullseriesname
@@ -378,6 +382,6 @@
378 save_timestamps(series, last_published)382 save_timestamps(series, last_published)
379383
380 print "Generating HTML page..."384 print "Generating HTML page..."
381 generate_page(series)385 generate_page(series, archs_by_archive)
382 print "Generating CSV file..."386 print "Generating CSV file..."
383 generate_csvfile(series)387 generate_csvfile(series)

Subscribers

People subscribed via source and target branches

to all changes: