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

Side by Side Diff: appengine/findit/crash/crash_pipeline.py

Issue 2524633002: [Culprit-Finder] Refactor GitilesRepostory to make http_client required argument. (Closed)
Patch Set: Fix nits. Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
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 copy 5 import copy
6 import json 6 import json
7 import logging 7 import logging
8 8
9 from common import appengine_util 9 from common import appengine_util
10 from common import pubsub_util 10 from common import pubsub_util
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 # processes, so we'll actually end up reconstructing the ``Findit`` object 84 # processes, so we'll actually end up reconstructing the ``Findit`` object
85 # twice. This also means ``run`` can't store anything in the pipeline 85 # twice. This also means ``run`` can't store anything in the pipeline
86 # object and expect it to still be available in the ``finalized`` method. 86 # object and expect it to still be available in the ``finalized`` method.
87 87
88 class CrashBasePipeline(BasePipeline): 88 class CrashBasePipeline(BasePipeline):
89 def __init__(self, client_id, crash_identifiers): 89 def __init__(self, client_id, crash_identifiers):
90 super(CrashBasePipeline, self).__init__(client_id, crash_identifiers) 90 super(CrashBasePipeline, self).__init__(client_id, crash_identifiers)
91 self._crash_identifiers = crash_identifiers 91 self._crash_identifiers = crash_identifiers
92 self._findit = FinditForClientID( 92 self._findit = FinditForClientID(
93 client_id, 93 client_id,
94 gitiles_repository.GitilesRepository(http_client=HttpClientAppengine())) 94 gitiles_repository.GitilesRepository(HttpClientAppengine()))
95 95
96 @property 96 @property
97 def client_id(self): # pragma: no cover 97 def client_id(self): # pragma: no cover
98 return self._findit.client_id 98 return self._findit.client_id
99 99
100 def run(self, *args, **kwargs): 100 def run(self, *args, **kwargs):
101 raise NotImplementedError() 101 raise NotImplementedError()
102 102
103 103
104 class CrashAnalysisPipeline(CrashBasePipeline): 104 class CrashAnalysisPipeline(CrashBasePipeline):
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 N.B., due to the structure of AppEngine pipelines, this method must 215 N.B., due to the structure of AppEngine pipelines, this method must
216 accept the same arguments as are passed to ``__init__``; however, 216 accept the same arguments as are passed to ``__init__``; however,
217 because they were already passed to ``__init__`` there's no use in 217 because they were already passed to ``__init__`` there's no use in
218 recieving them here. Thus, we discard all the arguments to this method 218 recieving them here. Thus, we discard all the arguments to this method
219 (except for ``self``, naturally). 219 (except for ``self``, naturally).
220 """ 220 """
221 run_analysis = yield CrashAnalysisPipeline( 221 run_analysis = yield CrashAnalysisPipeline(
222 self._client_id, self._crash_identifiers) 222 self._client_id, self._crash_identifiers)
223 with pipeline.After(run_analysis): 223 with pipeline.After(run_analysis):
224 yield PublishResultPipeline(self._client_id, self._crash_identifiers) 224 yield PublishResultPipeline(self._client_id, self._crash_identifiers)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698