Bug 1395563 - Handle case of missing decision task for backfills
MozReview-Commit-ID: BIo948IuUlO
--- a/taskcluster/taskgraph/actions/backfill.py
+++ b/taskcluster/taskgraph/actions/backfill.py
@@ -4,16 +4,17 @@
# 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 logging
import requests
+from requests.exceptions import HTTPError
from .registry import register_callback_action
from .util import find_decision_task, create_tasks
from taskgraph.util.taskcluster import get_artifact_from_index
from taskgraph.taskgraph import TaskGraph
PUSHLOG_TMPL = '{}/json-pushes?version=2&startID={}&endID={}'
INDEX_TMPL = 'gecko.v2.{}.pushlog-id.{}.decision'
@@ -65,25 +66,29 @@ def backfill_action(parameters, input, t
end_id = start_id - 1
start_id -= depth
if start_id < 0:
break
pushes = sorted(pushes)[-depth:]
for push in pushes:
- full_task_graph = get_artifact_from_index(
- INDEX_TMPL.format(parameters['project'], push),
- 'public/full-task-graph.json')
- _, full_task_graph = TaskGraph.from_json(full_task_graph)
- label_to_taskid = get_artifact_from_index(
- INDEX_TMPL.format(parameters['project'], push),
- 'public/label-to-taskid.json')
- push_params = get_artifact_from_index(
- INDEX_TMPL.format(parameters['project'], push),
- 'public/parameters.yml')
- push_decision_task_id = find_decision_task(push_params)
+ try:
+ full_task_graph = get_artifact_from_index(
+ INDEX_TMPL.format(parameters['project'], push),
+ 'public/full-task-graph.json')
+ _, full_task_graph = TaskGraph.from_json(full_task_graph)
+ label_to_taskid = get_artifact_from_index(
+ INDEX_TMPL.format(parameters['project'], push),
+ 'public/label-to-taskid.json')
+ push_params = get_artifact_from_index(
+ INDEX_TMPL.format(parameters['project'], push),
+ 'public/parameters.yml')
+ push_decision_task_id = find_decision_task(push_params)
+ except HTTPError as e:
+ logger.info('Skipping {} due to missing index artifacts! Error: {}'.format(push, e))
+ continue
if label in full_task_graph.tasks.keys():
create_tasks(
[label], full_task_graph, label_to_taskid, push_params, push_decision_task_id)
else:
logging.info('Could not find {} on {}. Skipping.'.format(label, push))