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
1=== modified file 'source/build_status.html'
2--- source/build_status.html 2011-10-07 03:30:31 +0000
3+++ source/build_status.html 2011-10-07 03:30:31 +0000
4@@ -36,8 +36,12 @@
5 <th rowspan="2">Version</th>
6 <th rowspan="2" onmouseover="Tip('{{ set_tooltip }}')"
7 onmouseout="UnTip()">Set?</th>
8- <th colspan="2" class="center">Main archive</th>
9- <th colspan="2" class="center">Ports archive</th>
10+ {% if archs_by_archive['main'] %}
11+ <th colspan="{{ archs_by_archive['main']|count }}" class="center">Main archive</th>
12+ {% endif %}
13+ {% if archs_by_archive['ports'] %}
14+ <th colspan="{{ archs_by_archive['ports']|count }}" class="center">Ports archive</th>
15+ {% endif %}
16 <th rowspan="2"/>Bugs</th>
17 <th rowspan="2"/>
18 </tr>
19@@ -152,8 +156,12 @@
20 <thead>
21 <tr>
22 <th colspan="2" rowspan="2">Failure type</th>
23- <th colspan="2" class="center">Main archive</th>
24- <th colspan="2" class="center">Ports archive</th>
25+ {% if archs_by_archive['main'] %}
26+ <th colspan="{{ archs_by_archive['main']|count }}" class="center">Main archive</th>
27+ {% endif %}
28+ {% if archs_by_archive['ports'] %}
29+ <th colspan="{{ archs_by_archive['ports']|count }}" class="center">Ports archive</th>
30+ {% endif %}
31 </tr>
32 <tr>
33 {% for arch in arch_list -%}
34
35=== modified file 'source/build_status.py'
36--- source/build_status.py 2011-10-07 03:30:31 +0000
37+++ source/build_status.py 2011-10-07 03:30:31 +0000
38@@ -31,7 +31,7 @@
39
40 lp_service = 'production'
41 api_version = '1.0'
42-default_arch_list = ('i386', 'amd64', 'armel', 'powerpc')
43+default_arch_list = []
44 find_tagged_bugs = 'ftbfs'
45 apt_pkg.InitSystem()
46
47@@ -230,7 +230,7 @@
48
49 return cur_last_published
50
51-def generate_page(series, template = 'build_status.html', arch_list = default_arch_list):
52+def generate_page(series, archs_by_archive, template = 'build_status.html', arch_list = default_arch_list):
53 try:
54 out = open('../%s.html' % series.name, 'w')
55 except IOError:
56@@ -274,6 +274,7 @@
57 data['series'] = series
58 data['active_series_list'] = active_series_list
59 data['arch_list'] = arch_list
60+ data['archs_by_archive'] = archs_by_archive
61 data['lastupdate'] = time.strftime('%F %T %z')
62 data['packagesets'] = packagesets_ftbfs
63
64@@ -335,17 +336,20 @@
65 ubuntu = launchpad.distributions['ubuntu']
66 active_series_list = sorted([s for s in ubuntu.series if s.active], key = attrgetter('name'))
67
68- if len(sys.argv) > 1:
69- series_list = []
70- for i in sys.argv[1:]:
71- try:
72- series_list.append(ubuntu.getSeries(name_or_version = i))
73- except HTTPError:
74- print 'Error: %s is not a valid name or version' % i
75- series_list.sort(key = attrgetter('name'))
76-
77- else:
78- series_list = (ubuntu.current_series,)
79+ assert len(sys.argv) >= 3
80+
81+ try:
82+ series_list = [ubuntu.getSeries(name_or_version = sys.argv[1])]
83+ except HTTPError:
84+ print 'Error: %s is not a valid name or version' % sys.argv[1]
85+ sys.exit(1)
86+
87+ archs_by_archive = dict(main=[], ports=[])
88+ for arch in sys.argv[2:]:
89+ das = series_list[0].getDistroArchSeries(archtag=arch)
90+ archs_by_archive[das.official and 'main' or 'ports'].append(arch)
91+ default_arch_list.extend(archs_by_archive['main'])
92+ default_arch_list.extend(archs_by_archive['ports'])
93
94 for series in series_list:
95 print "Generating FTBFS for %s" % series.fullseriesname
96@@ -378,6 +382,6 @@
97 save_timestamps(series, last_published)
98
99 print "Generating HTML page..."
100- generate_page(series)
101+ generate_page(series, archs_by_archive)
102 print "Generating CSV file..."
103 generate_csvfile(series)

Subscribers

People subscribed via source and target branches

to all changes: