From c0a53bbc4ac041e0f547c46bf244196eab3caef9 Mon Sep 17 00:00:00 2001 From: David Symonds Date: Thu, 1 Dec 2011 16:37:30 +1100 Subject: [PATCH] dashboard: don't choke on weird builder names. R=adg CC=golang-dev https://golang.org/cl/5447060 --- misc/dashboard/godashboard/gobuild.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/misc/dashboard/godashboard/gobuild.py b/misc/dashboard/godashboard/gobuild.py index 1f9db79380f..3202b40b64e 100644 --- a/misc/dashboard/godashboard/gobuild.py +++ b/misc/dashboard/godashboard/gobuild.py @@ -60,6 +60,8 @@ N = 30 def builderInfo(b): f = b.split('-', 3) + if len(f) < 2: + f.append(None) goos = f[0] goarch = f[1] note = "" @@ -105,7 +107,15 @@ class MainPage(webapp.RequestHandler): for r in revs: for b in r['builds']: - builders[b['builder']] = builderInfo(b['builder']) + if b['builder'] in builders: + continue + bi = builderInfo(b['builder']) + builders[b['builder']] = bi + bad_builders = [key for key in builders if not builders[key]['goarch']] + for key in bad_builders: + del builders[key] + for r in revs: + r['builds'] = [b for b in r['builds'] if b['builder'] not in bad_builders] for r in revs: have = set(x['builder'] for x in r['builds']) @@ -123,6 +133,7 @@ class MainPage(webapp.RequestHandler): if len(results) == num: values['next'] = page + 1 + values['bad'] = bad_builders path = os.path.join(os.path.dirname(__file__), 'main.html') self.response.out.write(template.render(path, values))