Bug 1608794 - pass proper version in automated Fennec betas. r=jlund, a=RyanVM
authorMihai Tabara <mtabara@mozilla.com>
Tue, 14 Jan 2020 13:55:41 +0000
changeset 524411 84675375273f70a0aa28742bca1c8426bd8ff24e
parent 524410 fc0535f00855a29c4c9c1ffb25a6fe51ba66e618
child 524412 49285dbee11ec29eb08508485714b6230f233d9e
push id764
push userryanvm@gmail.com
push dateTue, 14 Jan 2020 15:51:46 +0000
treeherdermozilla-esr68@49285dbee11e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlund, RyanVM
bugs1608794
milestone68.5.0
Bug 1608794 - pass proper version in automated Fennec betas. r=jlund, a=RyanVM Test Plan: via taskgraph diff Differential Revision: https://phabricator.services.mozilla.com/D59857
taskcluster/taskgraph/transforms/task.py
--- a/taskcluster/taskgraph/transforms/task.py
+++ b/taskcluster/taskgraph/transforms/task.py
@@ -33,16 +33,17 @@ from taskgraph.util.schema import (
 from taskgraph.util.partners import get_partners_to_be_published
 from taskgraph.util.scriptworker import (
     BALROG_ACTIONS,
     get_release_config,
 )
 from taskgraph.util.signed_artifacts import get_signed_artifacts
 from voluptuous import Any, Required, Optional, Extra, Match
 from taskgraph import GECKO, MAX_DEPENDENCIES
+from taskgraph.parameters import get_version
 from ..util import docker as dockerutil
 from ..util.workertypes import get_worker_type
 
 RUN_TASK = os.path.join(GECKO, 'taskcluster', 'scripts', 'run-task')
 
 
 @memoize
 def _run_task_suffix():
@@ -1212,35 +1213,36 @@ def build_ship_it_shipped_payload(config
 
     task_def['payload'] = {
         'release_name': worker['release-name']
     }
 
 
 @payload_builder('shipit-maybe-release', schema={
     Required('phase'): basestring,
-    Optional('product-key'): basestring,
+    Required('product-key'): basestring,
 })
 def build_ship_it_maybe_release_payload(config, task, task_def):
     # expect branch name, including path
     branch = config.params['head_repository'][len('https://hg.mozilla.org/'):]
-    # 'version' is e.g. '71.0b13' (app_version doesn't have beta number)
-    version = config.params['version']
+
+    # maybe-release task runs outside of release promotion context so it
+    # doesn't have useful data in `release_config()`, hence we're reading that
+    # value directly from in-tree
+    version = get_version(version_dir='mobile/android/config/version-files/beta')
 
     task_def['payload'] = {
         'product': task['shipping-product'],
         'branch': branch,
         'phase': task['worker']['phase'],
         'version': version,
         'cron_revision': config.params['head_rev'],
+        'product_key': task['worker']['product-key'],
     }
 
-    if 'product-key' in task['worker']:
-        task_def['payload'].update({'product_key': task['worker']['product-key']})
-
 
 @payload_builder('sign-and-push-addons', schema={
     Required('channel'): Any('listed', 'unlisted'),
     Required('upstream-artifacts'): [{
         Required('taskId'): taskref_or_string,
         Required('taskType'): basestring,
         Required('paths'): [basestring],
     }],