| 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 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 Loading... |
| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 N.B., due to the structure of AppEngine pipelines, this method must | 220 N.B., due to the structure of AppEngine pipelines, this method must |
| 221 accept the same arguments as are passed to ``__init__``; however, | 221 accept the same arguments as are passed to ``__init__``; however, |
| 222 because they were already passed to ``__init__`` there's no use in | 222 because they were already passed to ``__init__`` there's no use in |
| 223 recieving them here. Thus, we discard all the arguments to this method | 223 recieving them here. Thus, we discard all the arguments to this method |
| 224 (except for ``self``, naturally). | 224 (except for ``self``, naturally). |
| 225 """ | 225 """ |
| 226 run_analysis = yield CrashAnalysisPipeline( | 226 run_analysis = yield CrashAnalysisPipeline( |
| 227 self._client_id, self._crash_identifiers) | 227 self._client_id, self._crash_identifiers) |
| 228 with pipeline.After(run_analysis): | 228 with pipeline.After(run_analysis): |
| 229 yield PublishResultPipeline(self._client_id, self._crash_identifiers) | 229 yield PublishResultPipeline(self._client_id, self._crash_identifiers) |
| OLD | NEW |