| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import hashlib | 5 import hashlib |
| 6 import json | 6 import json |
| 7 import logging | 7 import logging |
| 8 | 8 |
| 9 from google.appengine.ext import ndb | 9 from google.appengine.ext import ndb |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 # The signature of the crash. | 25 # The signature of the crash. |
| 26 signature = ndb.StringProperty(indexed=False) | 26 signature = ndb.StringProperty(indexed=False) |
| 27 | 27 |
| 28 # The platform of this crash. | 28 # The platform of this crash. |
| 29 platform = ndb.StringProperty(indexed=False) | 29 platform = ndb.StringProperty(indexed=False) |
| 30 | 30 |
| 31 # ID to differentiate different client. | 31 # ID to differentiate different client. |
| 32 client_id = ndb.StringProperty(indexed=False) | 32 client_id = ndb.StringProperty(indexed=False) |
| 33 | 33 |
| 34 # Chrome regression range. |
| 35 regression_range = ndb.JsonProperty(indexed=False) |
| 36 |
| 34 ################### Properties for the analysis progress. ################### | 37 ################### Properties for the analysis progress. ################### |
| 35 | 38 |
| 36 # The url path to the pipeline status page. | 39 # The url path to the pipeline status page. |
| 37 pipeline_status_path = ndb.StringProperty(indexed=False) | 40 pipeline_status_path = ndb.StringProperty(indexed=False) |
| 38 | 41 |
| 39 # The status of the analysis. | 42 # The status of the analysis. |
| 40 status = ndb.IntegerProperty( | 43 status = ndb.IntegerProperty( |
| 41 default=analysis_status.PENDING, indexed=False) | 44 default=analysis_status.PENDING, indexed=False) |
| 42 | 45 |
| 43 # When the analysis was requested. | 46 # When the analysis was requested. |
| 44 requested_time = ndb.DateTimeProperty(indexed=True) | 47 requested_time = ndb.DateTimeProperty(indexed=True) |
| 45 | 48 |
| 46 # When the analysis was started. | 49 # When the analysis was started. |
| 47 started_time = ndb.DateTimeProperty(indexed=False) | 50 started_time = ndb.DateTimeProperty(indexed=False) |
| 48 | 51 |
| 49 # When the analysis was completed. | 52 # When the analysis was completed. |
| 50 completed_time = ndb.DateTimeProperty(indexed=False) | 53 completed_time = ndb.DateTimeProperty(indexed=False) |
| 51 | 54 |
| 52 # Which version of findit produces this result. | 55 # Which version of findit produces this result. |
| 53 findit_version = ndb.StringProperty(indexed=False) | 56 findit_version = ndb.StringProperty(indexed=False) |
| 54 | 57 |
| 55 ################### Properties for the analysis result. ################### | 58 ################### Properties for the analysis result. ################### |
| 56 | 59 |
| 60 solution = ndb.StringProperty(indexed=True) # 'core', 'blame', etc. |
| 61 |
| 57 # Analysis results. | 62 # Analysis results. |
| 58 result = ndb.JsonProperty(compressed=True, indexed=False) | 63 result = ndb.JsonProperty(compressed=True, indexed=False) |
| 59 | 64 |
| 60 # Tags for query and monitoring. | 65 # Flag to check whether there is a result. |
| 61 has_regression_range = ndb.BooleanProperty(indexed=True) | 66 has_regression_range = ndb.BooleanProperty(indexed=True) |
| 62 found_suspects = ndb.BooleanProperty(indexed=True) | 67 found_suspects = ndb.BooleanProperty(indexed=True) |
| 63 found_project = ndb.BooleanProperty(indexed=True) | 68 found_project = ndb.BooleanProperty(indexed=True) |
| 64 found_components = ndb.BooleanProperty(indexed=True) | 69 found_components = ndb.BooleanProperty(indexed=True) |
| 65 | 70 |
| 66 solution = ndb.StringProperty(indexed=True) # 'core', 'blame', etc. | 71 # Correct results. |
| 72 culprit_regression_range = ndb.JsonProperty(indexed=False) |
| 73 culprit_cls = ndb.JsonProperty(indexed=False) |
| 74 culprit_components = ndb.JsonProperty(indexed=False) |
| 75 culprit_project = ndb.StringProperty(indexed=False) |
| 67 | 76 |
| 68 # Triage results. | 77 # Triage status - 'Untriaged', 'Incorrect', 'Correct', 'Unsure'. |
| 69 regression_range_triage_status = ndb.IntegerProperty( | 78 regression_range_triage_status = ndb.IntegerProperty( |
| 70 indexed=True, default=triage_status.UNTRIAGED) | 79 indexed=True, default=triage_status.UNTRIAGED) |
| 71 culprit_regression_range = ndb.JsonProperty(indexed=False) | |
| 72 | |
| 73 suspected_cls_triage_status = ndb.IntegerProperty( | 80 suspected_cls_triage_status = ndb.IntegerProperty( |
| 74 indexed=True, default=triage_status.UNTRIAGED) | 81 indexed=True, default=triage_status.UNTRIAGED) |
| 75 culprit_cls = ndb.JsonProperty(indexed=False) | 82 suspected_components_triage_status = ndb.IntegerProperty( |
| 76 | 83 indexed=True, default=triage_status.UNTRIAGED) |
| 77 suspected_project_triage_status = ndb.IntegerProperty( | 84 suspected_project_triage_status = ndb.IntegerProperty( |
| 78 indexed=True, default=triage_status.UNTRIAGED) | 85 indexed=True, default=triage_status.UNTRIAGED) |
| 79 culprit_project = ndb.StringProperty(indexed=False) | |
| 80 | |
| 81 suspected_components_triage_status = ndb.IntegerProperty( | |
| 82 indexed=True, default=triage_status.UNTRIAGED) | |
| 83 culprit_components = ndb.JsonProperty(indexed=False) | |
| 84 | 86 |
| 85 triage_history = ndb.JsonProperty(indexed=False) | 87 triage_history = ndb.JsonProperty(indexed=False) |
| 86 | 88 |
| 87 # Triage note. | 89 # Triage note. |
| 88 note = ndb.StringProperty(indexed=False) | 90 note = ndb.StringProperty(indexed=False) |
| 89 | 91 |
| 90 def Reset(self): | 92 def Reset(self): |
| 91 self.pipeline_status_path = None | 93 self.pipeline_status_path = None |
| 92 self.status = analysis_status.PENDING | 94 self.status = analysis_status.PENDING |
| 93 self.requested_time = None | 95 self.requested_time = None |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 return ndb.Key(cls.__name__, hashlib.sha1( | 143 return ndb.Key(cls.__name__, hashlib.sha1( |
| 142 json.dumps(crash_identifiers, sort_keys=True)).hexdigest()) | 144 json.dumps(crash_identifiers, sort_keys=True)).hexdigest()) |
| 143 | 145 |
| 144 @classmethod | 146 @classmethod |
| 145 def Get(cls, crash_identifiers): | 147 def Get(cls, crash_identifiers): |
| 146 return cls._CreateKey(crash_identifiers).get() | 148 return cls._CreateKey(crash_identifiers).get() |
| 147 | 149 |
| 148 @classmethod | 150 @classmethod |
| 149 def Create(cls, crash_identifiers): | 151 def Create(cls, crash_identifiers): |
| 150 return cls(key=cls._CreateKey(crash_identifiers)) | 152 return cls(key=cls._CreateKey(crash_identifiers)) |
| OLD | NEW |