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

Unified Diff: appengine/findit/model/crash/crash_analysis.py

Issue 2067373002: [Findit] Add fracas analysis result feedback page for manual triage. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@only-dashboard
Patch Set: Merge branch 'only-dashboard' into dashboard 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 | « appengine/findit/main.py ('k') | appengine/findit/model/crash/test/crash_analysis_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/model/crash/crash_analysis.py
diff --git a/appengine/findit/model/crash/crash_analysis.py b/appengine/findit/model/crash/crash_analysis.py
index 59bcdf4d62f757c9f19470b8303fac6857b9a419..330b0492cb7d7b386edf2b8ce65a4ae2f62e8c77 100644
--- a/appengine/findit/model/crash/crash_analysis.py
+++ b/appengine/findit/model/crash/crash_analysis.py
@@ -1,6 +1,8 @@
# 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.
+import json
+import logging
from google.appengine.ext import ndb
@@ -64,7 +66,7 @@ class CrashAnalysis(ndb.Model):
# Triage results.
regression_range_triage_status = ndb.StringProperty(
indexed=True, default=triage_status.UNTRIAGED)
- culprit_regression_range = ndb.JsonProperty(indexed=False)
+ culprit_regression_range = ndb.JsonProperty(indexed=False, default=[])
suspected_cls_triage_status = ndb.StringProperty(
indexed=True, default=triage_status.UNTRIAGED)
@@ -72,35 +74,17 @@ class CrashAnalysis(ndb.Model):
suspected_project_triage_status = ndb.StringProperty(
indexed=True, default=triage_status.UNTRIAGED)
- culprit_project = ndb.JsonProperty(indexed=False, default=[])
+ culprit_project = ndb.StringProperty(indexed=False, default='')
suspected_components_triage_status = ndb.StringProperty(
indexed=True, default=triage_status.UNTRIAGED)
culprit_components = ndb.JsonProperty(indexed=False, default=[])
- triage_history = ndb.JsonProperty(indexed=False)
+ triage_history = ndb.JsonProperty(indexed=False, default=[])
# Triage note.
note = ndb.StringProperty(indexed=False, default='')
- def ResultCorrect(self, result_property):
- """Returns triage result of a result property.
-
- True if the result is triaged-correct, False if triaged-incorrect, else
- return None.
- """
- if not self.completed or self.failed:
- return None
-
- result_triage_status = getattr(self, '%s_triage_status' % result_property)
- if result_triage_status == triage_status.TRIAGED_CORRECT:
- return True
-
- if result_triage_status == triage_status.TRIAGED_INCORRECT:
- return False
-
- return None
-
def Reset(self):
self.pipeline_status_path = None
self.status = analysis_status.PENDING
@@ -112,6 +96,16 @@ class CrashAnalysis(ndb.Model):
self.found_suspects = None
self.solution = None
+ def Update(self, update):
+ try:
+ for key, value in update.iteritems():
+ setattr(self, key, value)
+
+ return True
+ except Exception: # pragma: no cover.
+ logging.warning('Failed to update %s' % json.dumps(update))
+ return False
+
@property
def completed(self):
return self.status in (
« no previous file with comments | « appengine/findit/main.py ('k') | appengine/findit/model/crash/test/crash_analysis_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698