Chromium Code Reviews| Index: appengine/findit/waterfall/pull_changelog_pipeline.py |
| diff --git a/appengine/findit/waterfall/pull_changelog_pipeline.py b/appengine/findit/waterfall/pull_changelog_pipeline.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..98d21549123cc0f0950e45fe90df41038cfb82c0 |
| --- /dev/null |
| +++ b/appengine/findit/waterfall/pull_changelog_pipeline.py |
| @@ -0,0 +1,43 @@ |
| +# Copyright 2015 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +from pipeline_utils.appengine_third_party_pipeline_src_pipeline import pipeline |
| + |
| +from common.git_repository import GitRepository |
| +from common.http_client_appengine import HttpClientAppengine as HttpClient |
| +from waterfall.base_pipeline import BasePipeline |
| + |
| + |
| +class PullChangelogPipeline(BasePipeline): |
| + """ A pipeline to pull change log of CLs. |
|
qyearsley
2015/01/16 22:55:26
Extra space after """
stgao
2015/01/21 20:29:23
Done.
|
| + |
| + Input: |
| + It is output of pipeline DetectFirstFailurePipeline. |
|
qyearsley
2015/01/16 22:55:26
"It is" can be omitted, I think -- you could say:
stgao
2015/01/21 20:29:23
Done.
|
| + |
| + Output: |
| + It is a json like below: |
|
qyearsley
2015/01/16 22:55:26
json -> dict
stgao
2015/01/21 20:29:23
Done.
|
| + { |
| + 'git_hash_revision1': model.change_log.ChangeLog.ToJson(), |
| + ... |
| + } |
| + """ |
| + |
| + # TODO: for files in dependencies(blink, v8, skia, etc), use blame first. |
| + GIT_REPO = GitRepository( |
| + 'https://chromium.googlesource.com/chromium/src', HttpClient()) |
| + |
| + # Arguments number differs from overridden method - pylint: disable=W0221 |
| + def run(self, failure_info): |
| + change_logs = {} |
| + |
| + for build in failure_info['builds'].values(): |
| + for revision in build['blame_list']: |
| + change_log = self.GIT_REPO.GetChangeLog(revision) |
| + if not change_log: # pragma: no cover |
| + raise pipeline.Retry('Failed to get change log for %s' % revision) |
| + |
| + # TODO: save in datastore? |
| + change_logs[revision] = change_log.ToJson() |
| + |
| + return change_logs |