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

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: 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 | « 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 4ae65cc0ee36303f095464282589ab9440331207..b876b3d7e82e40ee9a7ce0fb608bab8ac8e33d88 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
@@ -51,7 +53,7 @@ class CrashAnalysis(ndb.Model):
################### Properties for the analysis result. ###################
# Analysis results.
- result = ndb.JsonProperty(compressed=True, indexed=False, default={})
+ result = ndb.JsonProperty(compressed=True, indexed=False)
# Tags for query and monitoring.
has_regression_range = ndb.BooleanProperty(indexed=True)
@@ -64,24 +66,24 @@ class CrashAnalysis(ndb.Model):
# Triage results.
regression_range_triage_status = ndb.IntegerProperty(
indexed=True, default=triage_status.UNTRIAGED)
- culprit_regression_range = ndb.JsonProperty(indexed=False, default=[])
+ culprit_regression_range = ndb.JsonProperty(indexed=False)
suspected_cls_triage_status = ndb.IntegerProperty(
indexed=True, default=triage_status.UNTRIAGED)
- culprit_cls = ndb.JsonProperty(indexed=False, default=[])
+ culprit_cls = ndb.JsonProperty(indexed=False)
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)
suspected_components_triage_status = ndb.IntegerProperty(
indexed=True, default=triage_status.UNTRIAGED)
- culprit_components = ndb.JsonProperty(indexed=False, default=[])
+ culprit_components = ndb.JsonProperty(indexed=False)
triage_history = ndb.JsonProperty(indexed=False)
# Triage note.
- note = ndb.StringProperty(indexed=False, default='')
+ note = ndb.StringProperty(indexed=False)
def Reset(self):
self.pipeline_status_path = None
@@ -93,17 +95,28 @@ class CrashAnalysis(ndb.Model):
self.has_regression_range = None
self.found_suspects = None
self.solution = None
- self.result = {}
+ self.result = None
self.regression_range_triage_status = triage_status.UNTRIAGED
- self.culprit_regression_range = []
+ self.culprit_regression_range = None
self.suspected_cls_triage_status = triage_status.UNTRIAGED
- self.culprit_cls = []
+ self.culprit_cls = None
self.suspected_project_triage_status = triage_status.UNTRIAGED
- self.culprit_project = ''
+ self.culprit_project = None
self.suspected_components_triage_status = triage_status.UNTRIAGED
- self.culprit_components = []
+ self.culprit_components = None
self.triage_history = None
- self.note = ''
+ self.note = None
+
+ def Update(self, update):
+ updated = False
+ for key, value in update.iteritems():
+ if not hasattr(self, key):
+ continue
+
+ setattr(self, key, value)
+ updated = True
+
+ return updated
@property
def completed(self):
« 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