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

Unified Diff: appengine/findit/waterfall/flake/recursive_flake_pipeline.py

Issue 2438673004: [Findit] Post analysis results of flakes to bug filed by chromium-try-flakes. (Closed)
Patch Set: Add a config flag to enable/disable updating monorail bug. Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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 e72230c73bda6b4790ebce9f16be19c56cf72d04..f2e6bffc90e3239d367bb410a77383adf5f2c98e 100644
--- a/appengine/findit/waterfall/flake/recursive_flake_pipeline.py
+++ b/appengine/findit/waterfall/flake/recursive_flake_pipeline.py
@@ -5,6 +5,7 @@
from datetime import timedelta
import logging
import random
+import textwrap
from common import appengine_util
from common import constants
@@ -16,12 +17,37 @@ from model import result_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 or
+ not analysis.algorithm_parameters.get('update_monorail_bug')):
+ return False
+
+ comment = textwrap.dedent("""
+ Findit has generated the flakiness trend for this flake in the config
+ "%s / %s / %s" by rerunning the test on Swarming with build artifacts from
+ Waterfall. Please visit
+ https://findit-for-me.appspot.com/waterfall/check-flake?key=%s\n
+ Automatically posted by the findit-for-me app (https://goo.gl/YTKnaU).
+ Feedback are welcome using component Tools>Test>FindIt>Flakiness !""") % (
+ 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
@@ -285,3 +311,5 @@ class NextBuildNumberPipeline(BasePipeline):
else:
_UpdateAnalysisStatusUponCompletion(
master_flake_analysis, analysis_status.COMPLETED, None)
+ _UpdateBugWithResult(
+ master_flake_analysis, self.queue_name or constants.DEFAULT_QUEUE)

Powered by Google App Engine
This is Rietveld 408576698