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

Side by Side Diff: appengine/findit/waterfall/pull_changelog_pipeline.py

Issue 838003004: [Findit] Add three sub-pipelines to analyze build failure. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Just rebase. Created 5 years, 11 months 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
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698