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

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

Issue 2074273002: [Findit] Add feedback button for manual triage. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@show-result
Patch Set: 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
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 4ae65cc0ee36303f095464282589ab9440331207..d48ffba7ad455be92ebd4cb2728de9b6eb6a9525 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
@@ -72,13 +74,13 @@ class CrashAnalysis(ndb.Model):
suspected_project_triage_status = ndb.IntegerProperty(
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.IntegerProperty(
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=[])
stgao 2016/06/30 01:28:02 We'd better not "hard-code" [] as the default valu
Sharu Jiang 2016/07/01 22:05:48 Done.
# Triage note.
note = ndb.StringProperty(indexed=False, default='')
@@ -105,6 +107,19 @@ class CrashAnalysis(ndb.Model):
self.triage_history = None
self.note = ''
+ def Update(self, update):
+ try:
+ for key, value in update.iteritems():
+ if not hasattr(self, key):
+ continue
+
+ setattr(self, key, value)
+
+ return True
+ except Exception: # pragma: no cover.
stgao 2016/06/30 01:28:02 Why there will be exceptions here? What kinds of e
Sharu Jiang 2016/07/01 22:05:48 Just want to return False somehow, changed it to i
+ logging.warning('Failed to update %s' % json.dumps(update))
+ return False
+
@property
def completed(self):
return self.status in (

Powered by Google App Engine
This is Rietveld 408576698