Chromium Code Reviews| Index: appengine/findit/waterfall/flake/recursive_flake_pipeline.py |
| diff --git a/appengine/findit/waterfall/flake/recursive_flake_pipeline.py b/appengine/findit/waterfall/flake/recursive_flake_pipeline.py |
| index 465eaeeec9d8642dfd8f15d4373862e7d82bb093..a8098ddfe85e936dccb386d687e0764ec177c526 100644 |
| --- a/appengine/findit/waterfall/flake/recursive_flake_pipeline.py |
| +++ b/appengine/findit/waterfall/flake/recursive_flake_pipeline.py |
| @@ -5,6 +5,7 @@ |
| import logging |
| from datetime import timedelta |
| import random |
| +import textwrap |
| from common import appengine_util |
| from common import constants |
| @@ -15,12 +16,35 @@ from model import analysis_status |
| from model.flake.flake_swarming_task import FlakeSwarmingTask |
| from model.flake.master_flake_analysis import MasterFlakeAnalysis |
| from waterfall import waterfall_config |
| +from waterfall.post_comment_to_bug_pipeline import PostCommentToBugPipeline |
| from waterfall.process_flake_swarming_task_result_pipeline import ( |
| ProcessFlakeSwarmingTaskResultPipeline) |
| from waterfall.trigger_flake_swarming_task_pipeline import ( |
| TriggerFlakeSwarmingTaskPipeline) |
| +def _UpdateBugWithResult(analysis, queue_name): |
| + """Updates attached bug for the flakiness trend.""" |
| + if not analysis.bug_id: |
| + return False |
| + |
| + comment = textwrap.dedent(""" |
| + Findit has generated the flakiness trend for this flake in the config |
| + "%s / %s / %s" by rerun against build artifacts from Waterfall. Please visit |
|
lijeffrey
2016/10/21 17:10:27
nit: by rerunning
Also do we want to mention swar
stgao
2016/10/21 22:42:34
Done.
|
| + https://findit-for-me.appspot.com/waterfall/check-flake?key=%s\n |
| + Automatically posted by the findit-for-me app. |
|
lijeffrey
2016/10/21 17:10:27
nit: should we add the go/findit-site link after f
stgao
2016/10/21 22:42:34
Good idea. But go with a public short link https:/
|
| + Feedback are welcome in Tools>Test>FindIt>Flakiness!""") % ( |
|
chanli
2016/10/21 23:23:08
Nit: using component Tools>Test>FindIt>Flakiness?
stgao
2016/10/22 00:15:09
Done.
|
| + analysis.original_master_name, analysis.original_builder_name, |
| + analysis.original_step_name, analysis.key.urlsafe()) |
| + labels = ['AnalyzedByFindit'] |
| + pipeline = PostCommentToBugPipeline( |
| + analysis.bug_id, comment, labels) |
| + pipeline.target = appengine_util.GetTargetNameForModule( |
| + constants.WATERFALL_BACKEND) |
| + pipeline.start(queue_name=queue_name) |
| + return True |
| + |
| + |
| def _UpdateAnalysisStatusUponCompletion(master_flake_analysis, status, error): |
| master_flake_analysis.end_time = time_util.GetUTCNow() |
| master_flake_analysis.status = status |
| @@ -278,3 +302,5 @@ class NextBuildNumberPipeline(BasePipeline): |
| else: |
| _UpdateAnalysisStatusUponCompletion( |
| master_flake_analysis, analysis_status.COMPLETED, None) |
| + _UpdateBugWithResult( |
| + master_flake_analysis, self.queue_name or constants.DEFAULT_QUEUE) |