bug 1442793 - nightly-l10n artifact_prefix. r=bhearsum, a=release
authorAki Sasaki <asasaki@mozilla.com>
Tue, 13 Mar 2018 12:13:51 -0700
changeset 460946 1a2759c169162bd18b6e49415a56e5177b925252
parent 460945 7e2fd5fbfc0fe7b3d1033289c35ef691914db36a
child 460947 fc7c05c57f5b1a204439762555279032da67e627
push id9098
push userbhearsum@mozilla.com
push dateThu, 19 Apr 2018 20:02:16 +0000
treeherdermozilla-beta@98d536130349 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhearsum, release
bugs1442793
milestone60.0
bug 1442793 - nightly-l10n artifact_prefix. r=bhearsum, a=release MozReview-Commit-ID: xdxkpsU9Yy
taskcluster/ci/nightly-l10n/kind.yml
taskcluster/taskgraph/transforms/l10n.py
--- a/taskcluster/ci/nightly-l10n/kind.yml
+++ b/taskcluster/ci/nightly-l10n/kind.yml
@@ -119,37 +119,37 @@ job-template:
             win32-devedition-nightly: windows2012-32-devedition/opt
             win64-devedition-nightly: windows2012-64-devedition/opt
             android-api-16-nightly: android-4-0-armv7-api16/opt
    env:
       by-build-platform:
          linux.*:   # linux64 and 32 get same treatment here
             EN_US_PACKAGE_NAME: target.tar.bz2
             EN_US_BINARY_URL:
-               task-reference: https://queue.taskcluster.net/v1/task/<signed-build>/artifacts/public/build
+               task-reference: https://queue.taskcluster.net/v1/task/<signed-build>/artifacts/{artifact_prefix}
             MAR_TOOLS_URL:
-               task-reference: https://queue.taskcluster.net/v1/task/<unsigned-build>/artifacts/public/build/host/bin
+               task-reference: https://queue.taskcluster.net/v1/task/<unsigned-build>/artifacts/{artifact_prefix}/host/bin
          macosx64.*:
             EN_US_PACKAGE_NAME: target.dmg
             EN_US_BINARY_URL:
-               task-reference: https://queue.taskcluster.net/v1/task/<repackage>/artifacts/public/build
+               task-reference: https://queue.taskcluster.net/v1/task/<repackage>/artifacts/{artifact_prefix}
             MAR_TOOLS_URL:
-               task-reference: https://queue.taskcluster.net/v1/task/<unsigned-build>/artifacts/public/build/host/bin
+               task-reference: https://queue.taskcluster.net/v1/task/<unsigned-build>/artifacts/{artifact_prefix}/host/bin
          win.*:
             EN_US_PACKAGE_NAME: target.zip
             EN_US_BINARY_URL:
-               task-reference: https://queue.taskcluster.net/v1/task/<signed-build>/artifacts/public/build
+               task-reference: https://queue.taskcluster.net/v1/task/<signed-build>/artifacts/{artifact_prefix}
             EN_US_INSTALLER_BINARY_URL:
-               task-reference: https://queue.taskcluster.net/v1/task/<repackage-signed>/artifacts/public/build
+               task-reference: https://queue.taskcluster.net/v1/task/<repackage-signed>/artifacts/{artifact_prefix}
             MAR_TOOLS_URL:
-               task-reference: https://queue.taskcluster.net/v1/task/<unsigned-build>/artifacts/public/build/host/bin
+               task-reference: https://queue.taskcluster.net/v1/task/<unsigned-build>/artifacts/{artifact_prefix}/host/bin
          android-api-16-nightly:
             EN_US_PACKAGE_NAME: target.apk
             EN_US_BINARY_URL:
-               task-reference: https://queue.taskcluster.net/v1/task/<unsigned-build>/artifacts/public/build/en-US
+               task-reference: https://queue.taskcluster.net/v1/task/<unsigned-build>/artifacts/{artifact_prefix}/en-US
    mozharness:
       config:
          by-build-platform:
             linux-nightly:
                - single_locale/{project}.py
                - single_locale/linux32.py
                - single_locale/tc_common.py
                - single_locale/tc_linux32.py
--- a/taskcluster/taskgraph/transforms/l10n.py
+++ b/taskcluster/taskgraph/transforms/l10n.py
@@ -15,16 +15,17 @@ from taskgraph.transforms.base import (
     TransformSequence,
 )
 from taskgraph.util.schema import (
     validate_schema,
     optionally_keyed_by,
     resolve_keyed_by,
     Schema,
 )
+from taskgraph.util.taskcluster import get_artifact_prefix
 from taskgraph.util.treeherder import split_symbol, join_symbol
 from taskgraph.transforms.job import job_description_schema
 from taskgraph.transforms.task import task_description_schema
 from voluptuous import (
     Any,
     Optional,
     Required,
 )
@@ -214,16 +215,18 @@ def setup_name(config, jobs):
 @transforms.add
 def copy_in_useful_magic(config, jobs):
     for job in jobs:
         dep = job['dependent-task']
         attributes = job.setdefault('attributes', {})
         # build-platform is needed on `job` for by-build-platform
         job['build-platform'] = dep.attributes.get("build_platform")
         attributes['build_type'] = dep.attributes.get("build_type")
+        if dep.attributes.get('artifact_prefix'):
+            attributes['artifact_prefix'] = dep.attributes['artifact_prefix']
         if dep.attributes.get("nightly"):
             attributes['nightly'] = dep.attributes.get("nightly")
         else:
             # set build_platform to have l10n as well, to match older l10n setup
             # for now
             job['build-platform'] = "{}-l10n".format(job['build-platform'])
 
         attributes['build_platform'] = job['build-platform']
@@ -291,16 +294,34 @@ def handle_keyed_by(config, jobs):
     for job in jobs:
         job = copy.deepcopy(job)  # don't overwrite dict values here
         for field in fields:
             resolve_keyed_by(item=job, field=field, item_name=job['name'])
         yield job
 
 
 @transforms.add
+def handle_artifact_prefix(config, jobs):
+    """Resolve ``artifact_prefix`` in env vars"""
+    for job in jobs:
+        artifact_prefix = get_artifact_prefix(job)
+        for k1, v1 in job.get('env', {}).iteritems():
+            if isinstance(v1, basestring):
+                job['env'][k1] = v1.format(
+                    artifact_prefix=artifact_prefix
+                )
+            elif isinstance(v1, dict):
+                for k2, v2 in v1.iteritems():
+                    job['env'][k1][k2] = v2.format(
+                        artifact_prefix=artifact_prefix
+                    )
+        yield job
+
+
+@transforms.add
 def all_locales_attribute(config, jobs):
     for job in jobs:
         locales_platform = job['attributes']['build_platform'].replace("-nightly", "")
         locales_with_changesets = parse_locales_file(job["locales-file"],
                                                      platform=locales_platform)
         locales_with_changesets = _remove_locales(locales_with_changesets,
                                                   to_remove=job['ignore-locales'])