Chromium Code Reviews| Index: appengine/findit/waterfall/process_flake_swarming_task_result_pipeline.py |
| diff --git a/appengine/findit/waterfall/process_flake_swarming_task_result_pipeline.py b/appengine/findit/waterfall/process_flake_swarming_task_result_pipeline.py |
| index 5d81cbbe1d10406b3813b4ac27c425176e8ab6ba..f69b01775977a6c47a821793be66488c431ed18b 100644 |
| --- a/appengine/findit/waterfall/process_flake_swarming_task_result_pipeline.py |
| +++ b/appengine/findit/waterfall/process_flake_swarming_task_result_pipeline.py |
| @@ -13,8 +13,8 @@ from waterfall.process_base_swarming_task_result_pipeline import ( |
| ProcessBaseSwarmingTaskResultPipeline) |
| -def _GetCommitPositionAndGitHash(master_name, builder_name, build_number): |
| - """Gets the commit position and git hash of a build. |
| +def _GetBuildInfo(master_name, builder_name, build_number): |
|
stgao
2017/01/03 23:41:11
It seems better to move this function to waterfall
lijeffrey
2017/01/04 00:43:07
Done.
|
| + """Gets build info given a master, builder, and build number. |
| Args: |
| master_name (str): The name of the master. |
| @@ -25,19 +25,14 @@ def _GetCommitPositionAndGitHash(master_name, builder_name, build_number): |
| commit_position (int), git_hash (str): The git commit position corresponding |
|
stgao
2017/01/03 23:41:11
This needs updating.
lijeffrey
2017/01/04 00:43:07
Done.
|
| to the last commit in the build, and the git hash itself. |
| """ |
| - if build_number < 0: |
| - return None, None |
| - |
| build = build_util.DownloadBuildData(master_name, builder_name, build_number) |
| if not build.data: |
| - return None, None |
| + return None |
| - build_info = buildbot.ExtractBuildInfo( |
| + return buildbot.ExtractBuildInfo( |
| master_name, builder_name, build_number, build.data) |
| - return build_info.commit_position, build_info.chromium_revision |
| - |
| class ProcessFlakeSwarmingTaskResultPipeline( |
| ProcessBaseSwarmingTaskResultPipeline): |
| @@ -104,17 +99,18 @@ class ProcessFlakeSwarmingTaskResultPipeline( |
| data_point.pass_rate = pass_rate |
| data_point.task_id = flake_swarming_task.task_id |
| - # Include git commit position information about each build that was run. |
| + # Include git information about each build that was run. |
| if build_number > 0: |
| - previous_commit, previous_build_git_hash = _GetCommitPositionAndGitHash( |
| + previous_build = _GetBuildInfo( |
| master_name, builder_name, build_number - 1) |
| - data_point.previous_build_commit_position = previous_commit |
| - data_point.previous_build_git_hash = previous_build_git_hash |
| - |
| - commit_position, git_hash = _GetCommitPositionAndGitHash( |
| - master_name, builder_name, build_number) |
| - data_point.commit_position = commit_position |
| - data_point.git_hash = git_hash |
| + data_point.previous_build_commit_position = previous_build.commit_position |
| + data_point.previous_build_git_hash = previous_build.chromium_revision |
| + data_point.blame_list = previous_build.blame_list |
| + |
| + build_info = _GetBuildInfo(master_name, builder_name, build_number) |
| + data_point.commit_position = build_info.commit_position |
| + data_point.git_hash = build_info.chromium_revision |
| + data_point.blame_list = build_info.blame_list |
| master_flake_analysis.data_points.append(data_point) |