Bug 1332407 - TC based nightlies should have en-US and "multi locale" routes as well. r=dustin, a=lizzard
authorJustin Wood <Callek@gmail.com>
Thu, 19 Jan 2017 14:25:35 -0500
changeset 378163 a943b51dbee90aeddb0804c59f40c550652b0ff6
parent 378162 c422e37f16671ba9d28ecd501927271cb6905ad5
child 378164 ba5398b3f6fc925b72174fa5740c620a56f21f46
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin, lizzard
bugs1332407
milestone53.0a2
Bug 1332407 - TC based nightlies should have en-US and "multi locale" routes as well. r=dustin, a=lizzard MozReview-Commit-ID: KwVqrYFfDUD
taskcluster/ci/build/android.yml
taskcluster/taskgraph/transforms/task.py
--- a/taskcluster/ci/build/android.yml
+++ b/taskcluster/ci/build/android.yml
@@ -101,17 +101,17 @@ android-api-15/opt:
 
 android-api-15-nightly/opt:
     description: "Android 4.0 API15+ Nightly"
     attributes:
         nightly: true
     index:
         product: mobile
         job-name: android-api-15-opt
-        type: nightly
+        type: nightly-with-multi-l10n
     treeherder:
         platform: android-4-0-armv7-api15/opt
         symbol: tc(N)
     worker-type: aws-provisioner-v1/gecko-{level}-b-android
     worker:
         implementation: docker-worker
         max-run-time: 7200
     run:
--- a/taskcluster/taskgraph/transforms/task.py
+++ b/taskcluster/taskgraph/transforms/task.py
@@ -88,17 +88,17 @@ task_description_schema = Schema({
     Optional('index'): {
         # the name of the product this build produces
         'product': Any('firefox', 'mobile', 'static-analysis'),
 
         # the names to use for this job in the TaskCluster index
         'job-name': basestring,
 
         # Type of gecko v2 index to use
-        'type': Any('generic', 'nightly', 'l10n'),
+        'type': Any('generic', 'nightly', 'l10n', 'nightly-with-multi-l10n'),
 
         # The rank that the task will receive in the TaskCluster
         # index.  A newly completed task supercedes the currently
         # indexed task iff it has a higher rank.  If unspecified,
         # 'by-tier' behavior will be used.
         'rank': Any(
             # Rank is equal the timestamp of the build_date for tier-1
             # tasks, and zero for non-tier-1.  This sorts tier-{2,3}
@@ -656,37 +656,51 @@ def add_nightly_index_routes(config, tas
                                             time.gmtime(config.params['build_date']))
     subs['build_date'] = time.strftime("%Y.%m.%d",
                                        time.gmtime(config.params['build_date']))
     subs['product'] = index['product']
 
     for tpl in V2_NIGHTLY_TEMPLATES:
         routes.append(tpl.format(**subs))
 
+    # Also add routes for en-US
+    task = add_l10n_index_routes(config, task, force_locale="en-US")
+
+    return task
+
+
+@index_builder('nightly-with-multi-l10n')
+def add_nightly_multi_index_routes(config, task):
+    task = add_nightly_index_routes(config, task)
+    task = add_l10n_index_routes(config, task, force_locale="multi")
     return task
 
 
 @index_builder('l10n')
-def add_l10n_index_routes(config, task):
+def add_l10n_index_routes(config, task, force_locale=None):
     index = task.get('index')
     routes = task.setdefault('routes', [])
 
     job_name = index['job-name']
     if job_name not in JOB_NAME_WHITELIST:
         raise Exception(JOB_NAME_WHITELIST_ERROR.format(job_name))
 
     subs = config.params.copy()
     subs['job-name'] = job_name
     subs['build_date_long'] = time.strftime("%Y.%m.%d.%Y%m%d%H%M%S",
                                             time.gmtime(config.params['build_date']))
     subs['product'] = index['product']
 
     locales = task['attributes'].get('chunk_locales',
                                      task['attributes'].get('all_locales'))
 
+    if force_locale:
+        # Used for en-US and multi-locale
+        locales = [force_locale]
+
     if not locales:
         raise Exception("Error: Unable to use l10n index for tasks without locales")
 
     # If there are too many locales, we can't write a route for all of them
     # See Bug 1323792
     if len(locales) > 18:  # 18 * 3 = 54, max routes = 64
         return task