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

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

Issue 2523343002: [Predator] Refactor ToPublishResult and fix keyerror 'found' (Closed)
Patch Set: Rebase. Created 4 years 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 30f99a74d4ad61613b7b9236770d3872bcb08373..8ae1b20777b2524c19b20ec67e99f3b0ea261597 100644
--- a/appengine/findit/model/crash/crash_analysis.py
+++ b/appengine/findit/model/crash/crash_analysis.py
@@ -9,13 +9,10 @@ import logging
from google.appengine.ext import ndb
-from common import appengine_util
from crash.type_enums import CrashClient
from model import analysis_status
from model import triage_status
-# TODO(katesonia): Move this to fracas config.
-_FINDIT_FRACAS_FEEDBACK_URL_TEMPLATE = '%s/crash/fracas-result-feedback?key=%s'
class CrashAnalysis(ndb.Model):
"""Base class to represent an analysis of a Chrome/Clusterfuzz crash."""
@@ -155,37 +152,3 @@ class CrashAnalysis(ndb.Model):
@classmethod
def Create(cls, crash_identifiers):
return cls(key=cls._CreateKey(crash_identifiers))
-
- def ToPublishableResult(self, crash_identifiers):
- """Convert this datastore analysis into a publishable result.
-
- Args:
- crash_identifiers (dict): ??
-
- Returns:
- A dict of the given ``crash_identifiers``, this model's
- ``client_id``, and a publishable version of this model's ``result``.
- """
- result = copy.deepcopy(self.result)
- client_id = self.client_id
-
- # TODO(katesonia): move this to ChromeCrashAnalysis
- if (client_id == CrashClient.FRACAS or
- client_id == CrashClient.CRACAS):
- result['feedback_url'] = _FINDIT_FRACAS_FEEDBACK_URL_TEMPLATE % (
- appengine_util.GetDefaultVersionHostname(), self.key.urlsafe())
- if result['found'] and 'suspected_cls' in result:
- for cl in result['suspected_cls']:
- cl['confidence'] = round(cl['confidence'], 2)
- cl.pop('reason', None)
- elif client_id == CrashClient.CLUSTERFUZZ: # pragma: no cover.
- # TODO(katesonia): Post process clusterfuzz model result if needed.
- pass
-
- logging.info('Publish result:\n%s',
- json.dumps(result, indent=4, sort_keys=True))
- return {
- 'crash_identifiers': crash_identifiers,
- 'client_id': client_id,
- 'result': result,
- }
« no previous file with comments | « appengine/findit/crash/test/findit_test.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