Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2256)

Unified Diff: appengine/findit/handlers/crash/fracas_result_feedback.py

Issue 2075153003: [Findit] Add fracas analysis result feedback page. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Rebase. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | appengine/findit/handlers/crash/test/fracas_result_feedback_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/handlers/crash/fracas_result_feedback.py
diff --git a/appengine/findit/handlers/crash/fracas_result_feedback.py b/appengine/findit/handlers/crash/fracas_result_feedback.py
new file mode 100644
index 0000000000000000000000000000000000000000..197bfe5d4c8a1214e451d7d2419be3da8acda93c
--- /dev/null
+++ b/appengine/findit/handlers/crash/fracas_result_feedback.py
@@ -0,0 +1,47 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from google.appengine.ext import ndb
+
+from common import constants
+from common import time_util
+from common.base_handler import BaseHandler
+from common.base_handler import Permission
+
+
+class FracasResultFeedback(BaseHandler):
+ PERMISSION_LEVEL = Permission.CORP_USER
+
+ def HandleGet(self):
+ """Gets the analysis and feedback triage result of a crash.
+
+ Serve HTML page or JSON result as requested.
+ """
+ key = self.request.get('key')
+
+ analysis = ndb.Key(urlsafe=key).get()
+ if not analysis: # pragma: no cover.
+ return BaseHandler.CreateError(
+ 'cannot find analysis for crash key %s' % key)
+
+ data = {
+ 'signature': analysis.signature,
+ 'version': analysis.crashed_version,
+ 'channel': analysis.channel,
+ 'platform': analysis.platform,
+ 'regression_range': analysis.result.get('regression_range'),
+ 'historical_metadata': analysis.historical_metadata,
+ 'stack_trace': analysis.stack_trace,
+ 'suspected_cls': analysis.result.get('suspected_cls'),
+ 'suspected_project': analysis.result.get('suspected_project'),
+ 'suspected_components': analysis.result.get('suspected_components'),
+ 'request_time': time_util.FormatDatetime(analysis.requested_time),
+ 'analysis_completed': analysis.completed,
+ 'analysis_failed': analysis.failed,
+ }
+
+ return {
+ 'template': 'crash/fracas_result_feedback.html',
+ 'data': data,
+ }
« no previous file with comments | « no previous file | appengine/findit/handlers/crash/test/fracas_result_feedback_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698