Bug 1538278 - Adds route for accessing geckoview releases r=tomprince,jlorenzo

Differential Revision: https://phabricator.services.mozilla.com/D23928

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mitchell Hentges 2019-04-16 09:46:07 +00:00
Родитель 7ea1596799
Коммит 18f3187053
3 изменённых файлов: 56 добавлений и 5 удалений

Просмотреть файл

@ -22,6 +22,8 @@ def getAppVersionWithoutMilestone() {
// We take something like 58.1.2a1 and come out with 5800102 // We take something like 58.1.2a1 and come out with 5800102
// This gives us 3 digits for the major number, and 2 digits // This gives us 3 digits for the major number, and 2 digits
// each for the minor and build number. Beta and Release // 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() { def computeVersionCode() {
String appVersion = getAppVersionWithoutMilestone() String appVersion = getAppVersionWithoutMilestone()

Просмотреть файл

@ -171,7 +171,7 @@ android-x86-nightly/opt:
index: index:
product: mobile product: mobile
job-name: android-x86-opt job-name: android-x86-opt
type: nightly type: android-nightly
treeherder: treeherder:
platform: android-4-2-x86/opt platform: android-4-2-x86/opt
symbol: N symbol: N
@ -393,7 +393,7 @@ android-api-16-nightly/opt:
index: index:
product: mobile product: mobile
job-name: android-api-16-opt job-name: android-api-16-opt
type: nightly-with-multi-l10n type: android-nightly-with-multi-l10n
treeherder: treeherder:
platform: android-4-0-armv7-api16/opt platform: android-4-0-armv7-api16/opt
symbol: N symbol: N
@ -562,7 +562,7 @@ android-aarch64-nightly/opt:
index: index:
product: mobile product: mobile
job-name: android-aarch64-opt job-name: android-aarch64-opt
type: nightly type: android-nightly
treeherder: treeherder:
platform: android-5-0-aarch64/opt platform: android-5-0-aarch64/opt
symbol: N symbol: N
@ -676,7 +676,7 @@ android-x86_64-nightly/opt:
index: index:
product: mobile product: mobile
job-name: android-x86_64-opt job-name: android-x86_64-opt
type: nightly type: android-nightly
treeherder: treeherder:
platform: android-5-0-x86_64/opt platform: android-5-0-x86_64/opt
symbol: N symbol: N

Просмотреть файл

@ -50,6 +50,14 @@ def _run_task_suffix():
return hash_path(RUN_TASK)[0:20] 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 # A task description is a general description of a TaskCluster task
task_description_schema = Schema({ task_description_schema = Schema({
# the label for this task # the label for this task
@ -127,7 +135,8 @@ task_description_schema = Schema({
# Type of gecko v2 index to use # Type of gecko v2 index to use
'type': Any('generic', 'nightly', 'l10n', 'nightly-with-multi-l10n', '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 # The rank that the task will receive in the TaskCluster
# index. A newly completed task supercedes the currently # index. A newly completed task supercedes the currently
@ -280,6 +289,10 @@ V2_L10N_TEMPLATES = [
"index.{trust-domain}.v2.{project}.latest.{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 # the roots of the treeherder routes
TREEHERDER_ROUTE_ROOT = 'tc-treeherder' TREEHERDER_ROUTE_ROOT = 'tc-treeherder'
@ -1632,6 +1645,42 @@ def add_nightly_l10n_index_routes(config, task, force_locale=None):
return task 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 @transforms.add
def add_index_routes(config, tasks): def add_index_routes(config, tasks):
for task in tasks: for task in tasks: