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. | |
qyearsley
2015/01/16 22:55:26
Extra space after """
stgao
2015/01/21 20:29:23
Done.
| |
14 | |
15 Input: | |
16 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.
| |
17 | |
18 Output: | |
19 It is a json like below: | |
qyearsley
2015/01/16 22:55:26
json -> dict
stgao
2015/01/21 20:29:23
Done.
| |
20 { | |
21 'git_hash_revision1': model.change_log.ChangeLog.ToJson(), | |
22 ... | |
23 } | |
24 """ | |
25 | |
26 # TODO: for files in dependencies(blink, v8, skia, etc), use blame first. | |
27 GIT_REPO = GitRepository( | |
28 'https://chromium.googlesource.com/chromium/src', HttpClient()) | |
29 | |
30 # Arguments number differs from overridden method - pylint: disable=W0221 | |
31 def run(self, failure_info): | |
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 |