Bug 1275774 - Improve notification finding logic
MozReview-Commit-ID: I0s0Zdpnruw
--- a/taskcluster/taskgraph/target_tasks.py
+++ b/taskcluster/taskgraph/target_tasks.py
@@ -55,20 +55,20 @@ def target_tasks_try_option_syntax(full_
for l in target_tasks_labels:
task = full_task_graph[l]
if 'unittest_suite' in task.attributes:
task.attributes['task_duplicates'] = options.trigger_tests
# Add notifications here as well
if options.notifications:
for task in full_task_graph:
- if not task.task.get('routes'):
+ owner = task.task.get('tags', {}).get('createdForUser')
+ routes = task.task.get('routes')
+ if not (owner or routes):
continue
- owner = task.task['metadata'].get('owner')
- routes = task.task['routes']
if options.notifications == 'all':
routes.append("notify.email.{}.on-any".format(owner))
elif options.notifications == 'failure':
routes.append("notify.email.{}.on-failed".format(owner))
routes.append("notify.email.{}.on-exception".format(owner))
return target_tasks_labels