Merge lp:~juliank/lp-ftbfs-report/teams into lp:~wgrant/lp-ftbfs-report/production

Proposed by Julian Andres Klode
Status: Merged
Merged at revision: 61
Proposed branch: lp:~juliank/lp-ftbfs-report/teams
Merge into: lp:~wgrant/lp-ftbfs-report/production
Diff against target: 93 lines (+31/-0)
2 files modified
source/build_status.html (+11/-0)
source/build_status.py (+20/-0)
To merge this branch: bzr merge lp:~juliank/lp-ftbfs-report/teams
Reviewer Review Type Date Requested Status
William Grant Approve
Review via email: mp+338016@code.launchpad.net

Description of the change

Generate per team lists

To post a comment you must log in.
Revision history for this message
Julian Andres Klode (juliank) wrote :

Ping

Revision history for this message
William Grant (wgrant) wrote :

Thanks, just a couple of minor changes needed.

review: Needs Fixing
lp:~juliank/lp-ftbfs-report/teams updated
62. By Julian Andres Klode

Minor cleanup based on wgrant's review

Revision history for this message
William Grant (wgrant) :
review: Approve

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 2016-01-29 01:15:20 +0000
3+++ source/build_status.html 2018-04-13 08:54:54 +0000
4@@ -134,6 +134,11 @@
5 <a href="#{{ ps }}">{{ ps }}</a> ({{ lst|count }})
6 {% endfor -%}
7 </p>
8+ <p>Jump to team:
9+ {% for (team, lst) in teams.items()|sort if lst|count > 0 -%}
10+ <a href="#{{ team }}">{{ team }}</a> ({{ lst|count }})
11+ {% endfor -%}
12+ </p>
13
14 {% if notice %}
15 {{ notice }}
16@@ -189,6 +194,12 @@
17 {{ table(lst, ps, 'Also belongs to another packageset?') }}
18 {% endfor -%}
19
20+ <h2>Teams</h2>
21+ {% for (team, lst) in teams.items()|sort if lst|count > 0 -%}
22+ <h3 id="{{ team }}">{{ team }}: {{ lst|count }} packages (<a href="#top">top</a>)</h3>
23+ {{ table(lst, team, 'Also belongs to another team?') }}
24+ {% endfor -%}
25+
26 {% if main_archive %}
27 <h2 id="main_superseded">main (superseded): {{ main_superseded|count }} packages (<a href="#top">top</a>)</h2>
28 {{ table(main_superseded) }}
29
30=== modified file 'source/build_status.py'
31--- source/build_status.py 2018-02-20 11:28:59 +0000
32+++ source/build_status.py 2018-04-13 08:54:54 +0000
33@@ -20,6 +20,7 @@
34 #httplib2.debuglevel = 1
35
36 import os
37+import requests
38 import sys
39 import time
40 import apt_pkg
41@@ -107,6 +108,10 @@
42 for ps in srcpkg.packagesets:
43 packagesets_ftbfs[ps].append(srcpkg)
44
45+ srcpkg.teams = set([team for (team, srcpkglist) in teams.items() if spph.source_package_name in srcpkglist])
46+ for team in srcpkg.teams:
47+ teams_ftbfs[team].append(srcpkg)
48+
49 # add to cache
50 cls._cache[spph.source_package_name] = srcpkg
51
52@@ -144,6 +149,13 @@
53 else:
54 return list(self.packagesets.difference((name,)))
55
56+ def getTeams(self, name=None):
57+ '''Return the list of teams without the team `name`.'''
58+ if name is None:
59+ return list(self.teams)
60+ else:
61+ return list(self.teams.difference((name,)))
62+
63 class SPPH(object):
64 _cache = dict() # dict with all SPPH objects
65
66@@ -300,6 +312,8 @@
67 data['%s_superseded' % comp] = filter_ftbfs(components[comp], False) if not release_only else []
68 for pkgset, pkglist in packagesets_ftbfs.items():
69 packagesets_ftbfs[pkgset] = filter_ftbfs(pkglist, True)
70+ for team, pkglist in teams_ftbfs.items():
71+ teams_ftbfs[team] = filter_ftbfs(pkglist, True)
72
73 # container object to hold the counts and the tooltip
74 class StatData(object):
75@@ -339,6 +353,7 @@
76 data['archs_by_archive'] = archs_by_archive
77 data['lastupdate'] = time.strftime('%F %T %z')
78 data['packagesets'] = packagesets_ftbfs
79+ data['teams'] = teams_ftbfs
80 data['notice'] = notice
81 data['abbrs'] = {
82 'FAILEDTOBUILD': 'F',
83@@ -476,6 +491,11 @@
84 packagesets[ps.name] = ps.getSourcesIncluded(direct_inclusion=False)
85 packagesets_ftbfs[ps.name] = [] # empty list to add FTBFS for each package set later
86
87+ teams = requests.get('https://people.canonical.com/~ubuntu-archive/package-team-mapping.json').json()
88+
89+ # Per team list of FTBFS
90+ teams_ftbfs = {team: [] for team in teams}
91+
92 for state in ('Failed to build', 'Dependency wait', 'Chroot problem', 'Failed to upload', 'Cancelled build'):
93 last_published[state] = fetch_pkg_list(archive, series, state, last_published[state], default_arch_list, main_archive, main_series, options.release_only)
94

Subscribers

People subscribed via source and target branches