Bug 1318200 - Populate parameter indicating whether Servo is present; r?dustin draft
authorGregory Szorc <gps@mozilla.com>
Thu, 17 Nov 2016 17:43:29 -0800
changeset 440729 7588fd7c3185b6bac42b4abbc75211a76c31c620
parent 440728 ad659e6f327d06272d2821a76302fc4d7ae97fab
child 440730 6d1e32a5de3688ae7dc8868a7197189423e60372
push id36308
push userbmo:gps@mozilla.com
push dateFri, 18 Nov 2016 02:00:18 +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,20 @@ 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['topsrcdir'], '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',