summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2016-09-24 12:51:30 +0200
committerHolger Levsen <holger@layer-acht.org>2016-09-24 12:51:30 +0200
commit1fa7b9fb976fc79020e4527770bc6b0c68000db7 (patch)
treeba01d56153ad0d921e5dee0780ba4b9813cadded
parent3e5e7eca272721ea84165cd364f5e2819298e1d6 (diff)
downloadjenkins.debian.net-1fa7b9fb976fc79020e4527770bc6b0c68000db7.tar.xz
reproducible Debian: let's beat the notes job in shape, to make it deal gracefully with broken popcon data
-rwxr-xr-xbin/reproducible_html_notes.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/bin/reproducible_html_notes.py b/bin/reproducible_html_notes.py
index 509a2bcb..3d2a6461 100755
--- a/bin/reproducible_html_notes.py
+++ b/bin/reproducible_html_notes.py
@@ -393,13 +393,16 @@ def iterate_over_issues(issues):
def issues_popcon_annotate(issues_list):
# outputs [(package, popcon, is_popular)] where is_popular True if it's
# in the upper 1/4 of issues_list, i.e. a relative measure
- n = len(issues_list)
- popcon_dict = dict((p, 0) for p in issues_list)
- popcon_dict.update(popcon.package(*issues_list))
- issues = sorted(popcon_dict.items(), key=lambda p: p[0])
- issues_by_popcon = sorted(issues, key=lambda p: p[1], reverse=True)
- issues_with_popcon = [(p[0], p[1], i<n/4) for i, p in enumerate(issues_by_popcon)]
- return sorted(issues_with_popcon, key=lambda p: p[0])
+ try:
+ n = len(issues_list)
+ popcon_dict = dict((p, 0) for p in issues_list)
+ popcon_dict.update(popcon.package(*issues_list))
+ issues = sorted(popcon_dict.items(), key=lambda p: p[0])
+ issues_by_popcon = sorted(issues, key=lambda p: p[1], reverse=True)
+ issues_with_popcon = [(p[0], p[1], i<n/4) for i, p in enumerate(issues_by_popcon)]
+ return sorted(issues_with_popcon, key=lambda p: p[0])
+ except:
+ return issues_list
def sort_issues(scorefunc, issue):