Bug 1275774 - Improve notification finding logic draft
authorBrian Stack <bstack@mozilla.com>
Thu, 22 Sep 2016 19:41:00 -0500
changeset 417706 c5a6723b16436d1654448520e728a72092ede7ac
parent 417705 880bee6e391c81bc70ba23f75f1bf998b7380ae8
child 532143 295a0d2e311a920ef11e5f9d0c61256673afed40
push id30460
push userbstack@mozilla.com
push dateMon, 26 Sep 2016 16:52:15 +0000
bugs1275774
milestone52.0a1
Bug 1275774 - Improve notification finding logic MozReview-Commit-ID: I0s0Zdpnruw
taskcluster/taskgraph/target_tasks.py
--- 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