Bug 1543380: Always require a push task in cron tasks; r=dustin
authorTom Prince <mozilla@hocat.ca>
Wed, 01 May 2019 13:01:42 +0000
changeset 530944 684d31a3f000ab44efca4976b389ee489aeb3062
parent 530943 75a51f405b42a1789fccaa3dc0fda58b8b1235e3
child 530945 626173a3383d697d59629ba869142c60a7f41bbe
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1543380
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1543380: Always require a push task in cron tasks; r=dustin When a cron task depends on tasks from the on-push build, wait for the on-push decision task to complete, and fail if it doesn't complete succesfully. Differential Revision: https://phabricator.services.mozilla.com/D29429
taskcluster/taskgraph/decision.py
--- a/taskcluster/taskgraph/decision.py
+++ b/taskcluster/taskgraph/decision.py
@@ -3,18 +3,20 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from __future__ import absolute_import, print_function, unicode_literals
 
 import os
 import json
 import logging
+import time
+import sys
 
-import time
+from redo import retry
 import yaml
 
 from . import GECKO
 from .actions import render_actions_json
 from .create import create_tasks
 from .generator import TaskGraphGenerator
 from .parameters import Parameters, get_version, get_app_version
 from .taskgraph import TaskGraph
@@ -315,22 +317,26 @@ def get_decision_parameters(config, opti
 
 def get_existing_tasks(rebuild_kinds, parameters, graph_config):
     """
     Find the decision task corresponding to the on-push graph, and return
     a mapping of labels to task-ids from it. This will skip the kinds specificed
     by `rebuild_kinds`.
     """
     try:
-        decision_task = find_decision_task(parameters, graph_config)
-        task_graph = get_artifact(decision_task, "public/full-task-graph.json")
+        decision_task = retry(
+            find_decision_task,
+            args=(parameters, graph_config),
+            attempts=4,
+            sleeptime=5*60,
+        )
     except Exception:
         logger.exception("Didn't find existing push task.")
-        return
-    _, task_graph = TaskGraph.from_json(task_graph)
+        sys.exit(1)
+    _, task_graph = TaskGraph.from_json(get_artifact(decision_task, "public/full-task-graph.json"))
     parameters['existing_tasks'] = find_existing_tasks_from_previous_kinds(
         task_graph, [decision_task], rebuild_kinds
     )
 
 
 def set_try_config(parameters, task_config_file):
     if os.path.isfile(task_config_file):
         logger.info("using try tasks from {}".format(task_config_file))