diff --git a/tools/quality_tracking/dashboard/app.yaml b/tools/quality_tracking/dashboard/app.yaml index d06a813161..64324fe430 100644 --- a/tools/quality_tracking/dashboard/app.yaml +++ b/tools/quality_tracking/dashboard/app.yaml @@ -21,4 +21,4 @@ handlers: # Redirect all other requests to our dynamic handlers. - url: /.* - script: dashboard.app \ No newline at end of file + script: main.app \ No newline at end of file diff --git a/tools/quality_tracking/dashboard/dashboard.py b/tools/quality_tracking/dashboard/dashboard.py index 08e4877f98..3b067ab813 100644 --- a/tools/quality_tracking/dashboard/dashboard.py +++ b/tools/quality_tracking/dashboard/dashboard.py @@ -15,8 +15,6 @@ __author__ = 'phoglund@webrtc.org (Patrik Höglund)' from google.appengine.ext.webapp import template import webapp2 -import add_build_status_data -import add_coverage_data import load_build_status import load_coverage @@ -51,10 +49,3 @@ class ShowDashboard(webapp2.RequestHandler): def _show_error_page(self, error_message): self.response.write('%s' % error_message) - -app = webapp2.WSGIApplication([('/', ShowDashboard), - ('/add_coverage_data', - add_coverage_data.AddCoverageData), - ('/add_build_status_data', - add_build_status_data.AddBuildStatusData)], - debug=True) diff --git a/tools/quality_tracking/dashboard/lkgr_page.py b/tools/quality_tracking/dashboard/lkgr_page.py new file mode 100644 index 0000000000..a0254898ac --- /dev/null +++ b/tools/quality_tracking/dashboard/lkgr_page.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python +#-*- coding: utf-8 -*- +# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. +# +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file in the root of the source +# tree. An additional intellectual property rights grant can be found +# in the file PATENTS. All contributing project authors may +# be found in the AUTHORS file in the root of the source tree. + +"""Implements the LKGR page.""" + +__author__ = 'phoglund@webrtc.org (Patrik Höglund)' + +import webapp2 + +import load_build_status + +class ShowLkgr(webapp2.RequestHandler): + """This handler shows the LKGR in the simplest possible way. + + The page is intended to be used by automated tools. + """ + def get(self): + build_status_loader = load_build_status.BuildStatusLoader() + + lkgr = build_status_loader.compute_lkgr() + if lkgr is None: + self.response.out.write('No data has been uploaded to the dashboard.') + else: + self.response.out.write(lkgr) diff --git a/tools/quality_tracking/dashboard/load_build_status.py b/tools/quality_tracking/dashboard/load_build_status.py index 9a0eebb3d6..ab991e26ba 100644 --- a/tools/quality_tracking/dashboard/load_build_status.py +++ b/tools/quality_tracking/dashboard/load_build_status.py @@ -116,5 +116,5 @@ class BuildStatusLoader: # There was only one revision and it was OK. return current_lkgr - # There is no all-green revision in the database. + # There are no all-green revision in the database. return None diff --git a/tools/quality_tracking/dashboard/main.py b/tools/quality_tracking/dashboard/main.py new file mode 100644 index 0000000000..41d4bebe63 --- /dev/null +++ b/tools/quality_tracking/dashboard/main.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python +#-*- coding: utf-8 -*- +# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. +# +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file in the root of the source +# tree. An additional intellectual property rights grant can be found +# in the file PATENTS. All contributing project authors may +# be found in the AUTHORS file in the root of the source tree. + +"""Connects all URLs with their respective handlers.""" + +__author__ = 'phoglund@webrtc.org (Patrik Höglund)' + +from google.appengine.ext.webapp import template +import webapp2 + +import add_build_status_data +import add_coverage_data +import dashboard +import lkgr_page + +app = webapp2.WSGIApplication([('/', dashboard.ShowDashboard), + ('/lkgr', lkgr_page.ShowLkgr), + ('/add_coverage_data', + add_coverage_data.AddCoverageData), + ('/add_build_status_data', + add_build_status_data.AddBuildStatusData)], + debug=True) \ No newline at end of file