Bug 1214760 - prevent multiple tasks from using the same route in the gecko.v2 namespace; r=jonasfj

This commit is contained in:
Mike Shal
2015-10-14 10:42:29 -04:00
parent 3026a5dcbb
commit 272f579dd3

View File

@@ -369,6 +369,8 @@ class Graph(object):
'name': 'task graph local'
}
all_routes = {}
for build in job_graph:
interactive = cmdline_interactive or build["interactive"]
build_parameters = dict(parameters)
@@ -427,6 +429,15 @@ class Graph(object):
define_task = DEFINE_TASK.format(build_task['task']['workerType'])
for route in build_task['task'].get('routes', []):
if route.startswith('index.gecko.v2') and route in all_routes:
raise Exception("Error: route '%s' is in use by multiple tasks: '%s' and '%s'" % (
route,
build_task['task']['metadata']['name'],
all_routes[route],
))
all_routes[route] = build_task['task']['metadata']['name']
graph['scopes'].append(define_task)
graph['scopes'].extend(build_task['task'].get('scopes', []))
route_scopes = map(lambda route: 'queue:route:' + route, build_task['task'].get('routes', []))