Bug 1538278 - Adds route for accessing geckoview releases r=tomprince,jlorenzo
authorMitchell Hentges <mhentges@mozilla.com>
Tue, 16 Apr 2019 09:46:07 +0000
changeset 469635 9463e541aa94
parent 469634 41227706dc29
child 469636 2d1d88a793a3
push id35878
push userapavel@mozilla.com
push dateTue, 16 Apr 2019 15:43:40 +0000
treeherdermozilla-central@258af4e91151 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstomprince, jlorenzo
bugs1538278
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1538278 - Adds route for accessing geckoview releases r=tomprince,jlorenzo Differential Revision: https://phabricator.services.mozilla.com/D23928
mobile/android/geckoview/build.gradle
taskcluster/ci/build/android.yml
taskcluster/taskgraph/transforms/task.py
--- a/mobile/android/geckoview/build.gradle
+++ b/mobile/android/geckoview/build.gradle
@@ -17,16 +17,18 @@ def getAppVersionWithoutMilestone() {
 }
 
 // This converts MOZ_APP_VERSION into an integer
 // version code.
 //
 // We take something like 58.1.2a1 and come out with 5800102
 // This gives us 3 digits for the major number, and 2 digits
 // each for the minor and build number. Beta and Release
+//
+// This must be synchronized with _compute_gecko_version(...) in /taskcluster/taskgraph/transforms/task.py
 def computeVersionCode() {
     String appVersion = getAppVersionWithoutMilestone()
 
     // Split on the dot delimiter, e.g. 58.1.1a1 -> ["58, "1", "1a1"]
     String[] parts = appVersion.split('\\.')
 
     assert parts.size() == 2 || parts.size() == 3
 
--- a/taskcluster/ci/build/android.yml
+++ b/taskcluster/ci/build/android.yml
@@ -166,17 +166,17 @@ android-x86-nightly/opt:
     attributes:
         nightly: true
         enable-full-crashsymbols: true
     shipping-phase: build
     shipping-product: fennec
     index:
         product: mobile
         job-name: android-x86-opt
-        type: nightly
+        type: android-nightly
     treeherder:
         platform: android-4-2-x86/opt
         symbol: N
     worker-type: b-linux
     worker:
         docker-image: {in-tree: android-build}
         max-run-time: 7200
         env:
@@ -388,17 +388,17 @@ android-api-16-nightly/opt:
     attributes:
         nightly: true
         enable-full-crashsymbols: true
     shipping-phase: build
     shipping-product: fennec
     index:
         product: mobile
         job-name: android-api-16-opt
-        type: nightly-with-multi-l10n
+        type: android-nightly-with-multi-l10n
     treeherder:
         platform: android-4-0-armv7-api16/opt
         symbol: N
     worker-type: b-linux
     worker:
         docker-image: {in-tree: android-build}
         max-run-time: 7200
         env:
@@ -557,17 +557,17 @@ android-aarch64-nightly/opt:
     attributes:
         nightly: true
         enable-full-crashsymbols: true
     shipping-phase: build
     shipping-product: fennec
     index:
         product: mobile
         job-name: android-aarch64-opt
-        type: nightly
+        type: android-nightly
     treeherder:
         platform: android-5-0-aarch64/opt
         symbol: N
     worker-type: b-linux
     worker:
         docker-image: {in-tree: android-build}
         max-run-time: 7200
         env:
@@ -671,17 +671,17 @@ android-x86_64-nightly/opt:
     attributes:
         nightly: true
         enable-full-crashsymbols: true
     shipping-phase: build
     shipping-product: fennec
     index:
         product: mobile
         job-name: android-x86_64-opt
-        type: nightly
+        type: android-nightly
     treeherder:
         platform: android-5-0-x86_64/opt
         symbol: N
     worker-type: b-linux
     worker:
         docker-image: {in-tree: android-build}
         max-run-time: 7200
         env:
--- a/taskcluster/taskgraph/transforms/task.py
+++ b/taskcluster/taskgraph/transforms/task.py
@@ -45,16 +45,24 @@ RUN_TASK = os.path.join(GECKO, 'taskclus
 
 
 @memoize
 def _run_task_suffix():
     """String to append to cache names under control of run-task."""
     return hash_path(RUN_TASK)[0:20]
 
 
+def _compute_geckoview_version(app_version, moz_build_date):
+    """Geckoview version string that matches geckoview gradle configuration"""
+    # Must be synchronized with /mobile/android/geckoview/build.gradle computeVersionCode(...)
+    version_without_milestone = re.sub(r'a[0-9]', '', app_version, 1)
+    parts = version_without_milestone.split('.')
+    return "%s.%s.%s" % (parts[0], parts[1], moz_build_date)
+
+
 # A task description is a general description of a TaskCluster task
 task_description_schema = Schema({
     # the label for this task
     Required('label'): basestring,
 
     # description of the task (for metadata)
     Required('description'): basestring,
 
@@ -122,17 +130,18 @@ task_description_schema = Schema({
         # the name of the product this build produces
         'product': basestring,
 
         # 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', 'nightly-with-multi-l10n',
-                    'release', 'nightly-l10n', 'shippable', 'shippable-l10n'),
+                    'release', 'nightly-l10n', 'shippable', 'shippable-l10n',
+                    'android-nightly', 'android-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}
@@ -275,16 +284,20 @@ V2_SHIPPABLE_L10N_TEMPLATES = [
 
 V2_L10N_TEMPLATES = [
     "index.{trust-domain}.v2.{project}.revision.{branch_rev}.{product}-l10n.{job-name}.{locale}",
     "index.{trust-domain}.v2.{project}.pushdate.{build_date_long}.{product}-l10n.{job-name}.{locale}",  # noqa - too long
     "index.{trust-domain}.v2.{project}.pushlog-id.{pushlog_id}.{product}-l10n.{job-name}.{locale}",
     "index.{trust-domain}.v2.{project}.latest.{product}-l10n.{job-name}.{locale}",
 ]
 
+# This index is specifically for builds that include geckoview releases,
+# so we can hard-code the project to "geckoview"
+V2_GECKOVIEW_RELEASE = "index.{trust-domain}.v2.{project}.geckoview-version.{geckoview-version}.{product}.{job-name}"  # noqa - too long
+
 # the roots of the treeherder routes
 TREEHERDER_ROUTE_ROOT = 'tc-treeherder'
 
 
 def get_branch_rev(config):
     return config.params['{}head_rev'.format(
         config.graph_config['project-repo-param-prefix']
     )]
@@ -1627,16 +1640,52 @@ def add_nightly_l10n_index_routes(config
 
     for locale in locales:
         for tpl in V2_NIGHTLY_L10N_TEMPLATES:
             routes.append(tpl.format(locale=locale, **subs))
 
     return task
 
 
+def add_geckoview_index_routes(config, task):
+    index = task.get('index')
+    routes = task.setdefault('routes', [])
+    geckoview_version = _compute_geckoview_version(
+        config.params['app_version'],
+        config.params['moz_build_date']
+    )
+
+    subs = {
+        'geckoview-version': geckoview_version,
+        'job-name': index['job-name'],
+        'product': index['product'],
+        'project': config.params['project'],
+        'trust-domain': config.graph_config['trust-domain'],
+    }
+    routes.append(V2_GECKOVIEW_RELEASE.format(**subs))
+
+    return task
+
+
+@index_builder('android-nightly')
+def add_android_nightly_index_routes(config, task):
+    task = add_nightly_index_routes(config, task)
+    task = add_geckoview_index_routes(config, task)
+
+    return task
+
+
+@index_builder('android-nightly-with-multi-l10n')
+def add_android_nightly_multi_index_routes(config, task):
+    task = add_nightly_multi_index_routes(config, task)
+    task = add_geckoview_index_routes(config, task)
+
+    return task
+
+
 @transforms.add
 def add_index_routes(config, tasks):
     for task in tasks:
         index = task.get('index', {})
 
         # The default behavior is to rank tasks according to their tier
         extra_index = task.setdefault('extra', {}).setdefault('index', {})
         rank = index.get('rank', 'by-tier')