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

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

Issue 2074273002: [Findit] Add feedback button for manual triage. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@show-result
Patch Set: Rebase and fix tests. Created 4 years, 5 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
index 197bfe5d4c8a1214e451d7d2419be3da8acda93c..ac379e16faaa8076a7bf3264eea7dde740484c18 100644
--- a/appengine/findit/handlers/crash/fracas_result_feedback.py
+++ b/appengine/findit/handlers/crash/fracas_result_feedback.py
@@ -2,6 +2,9 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+from datetime import datetime
+
+from google.appengine.api import users
from google.appengine.ext import ndb
from common import constants
@@ -10,6 +13,25 @@ from common.base_handler import BaseHandler
from common.base_handler import Permission
+def _GetTriageHistory(analysis):
+ if (not users.is_current_user_admin() or
+ not analysis.completed or
+ not analysis.triage_history):
+ return None
+
+ triage_history = []
+ for triage_record in analysis.triage_history:
+ triage_history.append({
+ 'triage_time': time_util.FormatDatetime(
+ datetime.utcfromtimestamp(triage_record['triage_timestamp'])),
+ 'result_property': triage_record['result_property'],
+ 'user_name': triage_record['user_name'],
+ 'triage_status': triage_record['triage_status']
+ })
+
+ return triage_history
+
+
class FracasResultFeedback(BaseHandler):
PERMISSION_LEVEL = Permission.CORP_USER
@@ -31,14 +53,27 @@ class FracasResultFeedback(BaseHandler):
'channel': analysis.channel,
'platform': analysis.platform,
'regression_range': analysis.result.get('regression_range'),
+ 'culprit_regression_range': analysis.culprit_regression_range,
'historical_metadata': analysis.historical_metadata,
'stack_trace': analysis.stack_trace,
'suspected_cls': analysis.result.get('suspected_cls'),
+ 'culprit_cls': analysis.culprit_cls,
'suspected_project': analysis.result.get('suspected_project'),
+ 'culprit_project': analysis.culprit_project,
'suspected_components': analysis.result.get('suspected_components'),
+ 'culprit_components': analysis.culprit_components,
'request_time': time_util.FormatDatetime(analysis.requested_time),
'analysis_completed': analysis.completed,
'analysis_failed': analysis.failed,
+ 'triage_history': _GetTriageHistory(analysis),
+ 'analysis_correct': {
+ 'regression_range': analysis.regression_range_triage_status,
+ 'suspected_cls': analysis.suspected_cls_triage_status,
+ 'suspected_project': analysis.suspected_project_triage_status,
+ 'suspected_components': analysis.suspected_components_triage_status,
+ },
+ 'note': analysis.note,
+ 'key': analysis.key.urlsafe(),
}
return {
« 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