OLD | NEW |
(Empty) | |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 from pipeline_utils.appengine_third_party_pipeline_src_pipeline import pipeline |
| 6 |
| 7 from common.git_repository import GitRepository |
| 8 from common.http_client_appengine import HttpClientAppengine as HttpClient |
| 9 from waterfall.base_pipeline import BasePipeline |
| 10 |
| 11 |
| 12 class PullChangelogPipeline(BasePipeline): |
| 13 """A pipeline to pull change log of CLs.""" |
| 14 |
| 15 # TODO: for files in dependencies(blink, v8, skia, etc), use blame first. |
| 16 GIT_REPO = GitRepository( |
| 17 'https://chromium.googlesource.com/chromium/src', HttpClient()) |
| 18 |
| 19 # Arguments number differs from overridden method - pylint: disable=W0221 |
| 20 def run(self, failure_info): |
| 21 """ |
| 22 Args: |
| 23 failure_info (dict): Output of pipeline DetectFirstFailurePipeline.run(). |
| 24 |
| 25 Returns: |
| 26 A dict with the following form: |
| 27 { |
| 28 'git_hash_revision1': common.change_log.ChangeLog.ToJson(), |
| 29 ... |
| 30 } |
| 31 """ |
| 32 change_logs = {} |
| 33 |
| 34 for build in failure_info['builds'].values(): |
| 35 for revision in build['blame_list']: |
| 36 change_log = self.GIT_REPO.GetChangeLog(revision) |
| 37 if not change_log: # pragma: no cover |
| 38 raise pipeline.Retry('Failed to get change log for %s' % revision) |
| 39 |
| 40 # TODO: save in datastore? |
| 41 change_logs[revision] = change_log.ToJson() |
| 42 |
| 43 return change_logs |
OLD | NEW |