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

Unified Diff: appengine/findit/handlers/crash/crash_handler.py

Issue 2414523002: [Findit] Reorganizing findit_for_*.py (Closed)
Patch Set: Fixing call to ScheduleNewAnalysis in handlers/crash/crash_handler.py Created 4 years, 2 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/handlers/crash/crash_handler.py
diff --git a/appengine/findit/handlers/crash/crash_handler.py b/appengine/findit/handlers/crash/crash_handler.py
index 64970dda5c61d4bed496a3a2d34ae932bf661836..2b39412c47b407fe27ee7fe14185d4821dfbf4c6 100644
--- a/appengine/findit/handlers/crash/crash_handler.py
+++ b/appengine/findit/handlers/crash/crash_handler.py
@@ -9,7 +9,26 @@ import logging
from common import constants
from common.base_handler import BaseHandler
from common.base_handler import Permission
-from crash import crash_pipeline
+from crash import findit_for_chromecrash
+from crash import findit_for_clusterfuzz
+from crash.crash_report import CrashReport
+from crash.type_enums import CrashClient
+
+
+# TODO(wrengr): we'd like to move this to findit.py (or somewhere similar)
+# so it's encapsulated along with the Findit classes; but to do that we'd
+# need to merge findit.py and findit_for_chromecrash.py to avoid cyclic
+# dependencies. Is there a clean way to do what we want?
+def FinditForClientID(client_id):
+ if client_id == CrashClient.FRACAS:
+ return findit_for_chromecrash.FinditForFracas()
+ elif client_id == CrashClient.CRACAS:
+ return findit_for_chromecrash.FinditForCracas()
+ elif client_id == CrashClient.CLUSTERFUZZ:
+ return findit_for_clusterfuzz.FinditForClusterfuzz()
+ else:
+ logging.info('Client %s is not supported by findit right now', client_id)
+ raise ValueError()
class CrashHandler(BaseHandler):
@@ -102,15 +121,9 @@ class CrashHandler(BaseHandler):
logging.info('Crash data is %s', json.dumps(crash_data))
- crash_pipeline.ScheduleNewAnalysisForCrash(
- crash_data['crash_identifiers'],
- crash_data['chrome_version'],
- crash_data['signature'],
- crash_data['client_id'],
- crash_data['platform'],
- crash_data['stack_trace'],
- crash_data['customized_data'],
- queue_name=constants.CRASH_ANALYSIS_QUEUE[crash_data['client_id']])
+ client_id = crash_data['client_id']
+ FinditForClientID(client_id).ScheduleNewAnalysis(crash_data,
+ queue_name=constants.CRASH_ANALYSIS_QUEUE[client_id])
except (KeyError, ValueError): # pragma: no cover.
# TODO: save exception in datastore and create a page to show them.
logging.exception('Failed to process crash message')

Powered by Google App Engine
This is Rietveld 408576698