Bug 1411796 - [taskgraph] Skip parameters.rst doc verification if parameters.strict is False, r=dustin
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Wed, 25 Oct 2017 20:27:17 -0400
changeset 388448 57e183ac30b5748776c0832c1930072bc55e0230
parent 388447 0464922649173660387fe62569a932a62fd37287
child 388449 738a4b6c0dadebc3dfe20fa86520eb4c0c904b71
push id32750
push userarchaeopteryx@coole-files.de
push dateThu, 26 Oct 2017 21:56:27 +0000
treeherdermozilla-central@a6d7be4ac1e3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1411796
milestone58.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 1411796 - [taskgraph] Skip parameters.rst doc verification if parameters.strict is False, r=dustin This is needed to prevent parameter mismatch errors when using |mach try fuzzy| from an older revision. This can happen if the parameters.yml is being downloaded from a commit with a recently added parameter. MozReview-Commit-ID: 4NxCM7i8B4W
taskcluster/taskgraph/generator.py
taskcluster/taskgraph/test/test_generator.py
--- a/taskcluster/taskgraph/generator.py
+++ b/taskcluster/taskgraph/generator.py
@@ -286,16 +286,19 @@ class TaskGraphGenerator(object):
             try:
                 k, v = self._run.next()
             except StopIteration:
                 raise AttributeError("No such run result {}".format(name))
             self._run_results[k] = v
         return self._run_results[name]
 
     def verify_parameters(self, parameters):
+        if not parameters.strict:
+            return
+
         parameters_dict = dict(**parameters)
         verify_docs(
             filename="parameters.rst",
             identifiers=parameters_dict.keys(),
             appearing_as="inline-literal"
          )
 
     def verify_kinds(self, kinds):
--- a/taskcluster/taskgraph/test/test_generator.py
+++ b/taskcluster/taskgraph/test/test_generator.py
@@ -40,32 +40,36 @@ class WithFakeKind(TaskGraphGenerator):
             config = {
                 'transforms': [],
             }
             if deps:
                 config['kind-dependencies'] = deps
             yield FakeKind(kind_name, '/fake', config)
 
 
+class FakeParameters(dict):
+    strict = True
+
+
 class TestGenerator(unittest.TestCase):
 
     def maketgg(self, target_tasks=None, kinds=[('_fake', [])]):
         FakeKind.loaded_kinds = []
         self.target_tasks = target_tasks or []
 
         def target_tasks_method(full_task_graph, parameters):
             return self.target_tasks
 
         target_tasks_mod._target_task_methods['test_method'] = target_tasks_method
 
-        parameters = {
+        parameters = FakeParameters({
             '_kinds': kinds,
             'target_tasks_method': 'test_method',
             'try_mode': None,
-        }
+        })
 
         return WithFakeKind('/root', parameters)
 
     def test_kind_ordering(self):
         "When task kinds depend on each other, they are loaded in postorder"
         self.tgg = self.maketgg(kinds=[
             ('_fake3', ['_fake2', '_fake1']),
             ('_fake2', ['_fake1']),