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
reviewersdustin
bugs1318200
milestone53.0a1
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
taskcluster/docs/parameters.rst
taskcluster/taskgraph/decision.py
taskcluster/taskgraph/parameters.py
--- a/taskcluster/docs/parameters.rst
+++ b/taskcluster/docs/parameters.rst
@@ -64,16 +64,21 @@ Push Information
 
 ``moz_build_date``
    A formatted timestamp of ``build_date``. Expressed as a string with the following
    format: %Y%m%d%H%M%S
 
 Tree Information
 ----------------
 
+``have_servo``
+   Whether Servo is available in the commit being processed.
+
+   (This parameter should be populated automatically.)
+
 ``project``
    Another name for what may otherwise be called tree or branch or
    repository.  This is the unqualified name, such as ``mozilla-central`` or
    ``cedar``.
 
 ``level``
    The `SCM level
    <https://www.mozilla.org/en-US/about/governance/policies/commit/access-policy/>`_
--- 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",
                                                  time.gmtime(parameters['build_date']))
 
+    # Test for source checkout properties here.
+    parameters['have_servo'] = os.path.exists(os.path.join(options['root'], 'servo'))
+
     project = parameters['project']
     try:
         parameters.update(PER_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__))
         parameters.update(PER_PROJECT_PARAMETERS['default'])
--- 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
 PARAMETER_NAMES = set([
     'base_repository',
     'build_date',
     'filters',
+    'have_servo',
     'head_ref',
     'head_repository',
     'head_rev',
     'level',
     'message',
     'moz_build_date',
     'optimize_target_tasks',
     'owner',