Bug 1501878: [taskgraph] Verify that required signoffs propagate to dependent tasks; r=aki
☠☠ backed out by 94debc6ca20b ☠ ☠
authorTom Prince <mozilla@hocat.ca>
Fri, 16 Nov 2018 03:14:41 +0000
changeset 503280 f1843fdd4c0fa13722f5fe7ab7b73d5fdc2ad3ef
parent 503279 af0ea80f7b081a64d964e762b06b940e3c4f1b3f
child 503281 00f109437e82f6e9a350911573cbe11a5bafcfed
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaki
bugs1501878
milestone65.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 1501878: [taskgraph] Verify that required signoffs propagate to dependent tasks; r=aki Differential Revision: https://phabricator.services.mozilla.com/D12041
taskcluster/taskgraph/util/verify.py
--- a/taskcluster/taskgraph/util/verify.py
+++ b/taskcluster/taskgraph/util/verify.py
@@ -176,16 +176,43 @@ def verify_dependency_tiers(task, taskgr
                     continue
                 if tier < tiers[d]:
                     raise Exception(
                         '{} (tier {}) cannot depend on {} (tier {})'
                         .format(task.label, printable_tier(tier),
                                 d, printable_tier(tiers[d])))
 
 
+@verifications.add('full_task_graph')
+def verify_required_signoffs(task, taskgraph, scratch_pad):
+    """
+    Task with required signoffs can't be dependencies of tasks with less
+    required signoffs.
+    """
+    all_required_signoffs = scratch_pad
+    if task is not None:
+        all_required_signoffs[task.label] = set(task.attributes.get('required_signoffs', []))
+    else:
+        def printable_signoff(signoffs):
+            if len(signoffs) == 1:
+                return 'required signoff {}'.format(*signoffs)
+            elif signoffs:
+                return 'required signoffs {}'.format(', '.join(signoffs))
+            else:
+                return 'no required signoffs'
+        for task in taskgraph.tasks.itervalues():
+            required_signoffs = all_required_signoffs[task.label]
+            for d in task.dependencies.itervalues():
+                if required_signoffs < all_required_signoffs[d]:
+                    raise Exception(
+                        '{} ({}) cannot depend on {} ({})'
+                        .format(task.label, printable_signoff(required_signoffs),
+                                d, printable_signoff(all_required_signoffs[d])))
+
+
 @verifications.add('optimized_task_graph')
 def verify_always_optimized(task, taskgraph, scratch_pad):
     """
         This function ensures that always-optimized tasks have been optimized.
     """
     if task is None:
         return
     if task.task.get('workerType') == 'always-optimized':