Bug 1318200 - Populate parameter indicating whether Servo is present; r?dustin draft
authorGregory Szorc <gps@mozilla.com>
Thu, 17 Nov 2016 16:46:43 -0800
changeset 440713 b583367773c543ee8602c7417a4a3f635b5fe3bf
parent 440712 90fb86c71c9511749f90b6c5102d6a0a4ad4d5ce
child 440714 f66c670e852b67fce75d2e1dc041466f8019c21d
push id36303
push userbmo:gps@mozilla.com
push dateFri, 18 Nov 2016 01:27:24 +0000
Bug 1318200 - Populate parameter indicating whether Servo is present; r?dustin We wish to conditionally schedule Stylo related tasks depending on whether Servo is vendored in the source checkout. In order to do this, we add an "have_servo" parameter when obtaining parameters as part of running the decision logic. The value is determined by looking for a "servo" directory in the repository root. MozReview-Commit-ID: E96R6GtqmuJ
--- a/taskcluster/docs/parameters.rst
+++ b/taskcluster/docs/parameters.rst
@@ -64,16 +64,21 @@ Push Information
    A formatted timestamp of ``build_date``. Expressed as a string with the following
    format: %Y%m%d%H%M%S
 Tree Information
+   Whether Servo is available in the commit being processed.
+   (This parameter should be populated automatically.)
    Another name for what may otherwise be called tree or branch or
    repository.  This is the unqualified name, such as ``mozilla-central`` or
    The `SCM level
--- a/taskcluster/taskgraph/decision.py
+++ b/taskcluster/taskgraph/decision.py
@@ -135,16 +135,19 @@ def get_decision_parameters(options):
         parameters['owner'] += '@noreply.mozilla.org'
     # use the pushdate as build_date if given, else use current time
     parameters['build_date'] = parameters['pushdate'] or int(time.time())
     # moz_build_date is the build identifier based on build_date
     parameters['moz_build_date'] = time.strftime("%Y%m%d%H%M%S",
+    # Test for source checkout properties here.
+    parameters['have_servo'] = os.path.exists(os.path.join(options['root'], 'servo'))
     project = parameters['project']
     except KeyError:
         logger.warning("using default project parameters; add {} to "
                        "PER_PROJECT_PARAMETERS in {} to customize behavior "
                        "for this project".format(project, __file__))
--- a/taskcluster/taskgraph/parameters.py
+++ b/taskcluster/taskgraph/parameters.py
@@ -10,16 +10,17 @@ import json
 import yaml
 from mozbuild.util import ReadOnlyDict
 # Please keep this list sorted and in sync with taskcluster/docs/parameters.rst
+    'have_servo',