--- a/taskcluster/taskgraph/util/scriptworker.py
+++ b/taskcluster/taskgraph/util/scriptworker.py
@@ -10,22 +10,24 @@ these scopes automatically by project; t
project branch, and merge day uplifts more user friendly.
In the future, we may adjust scopes by other settings as well, e.g. different
scopes for `push-to-candidates` rather than `push-to-releases`, even if both
happen on mozilla-beta and mozilla-release.
"""
from __future__ import absolute_import, print_function, unicode_literals
import functools
+import json
import os
# constants {{{1
GECKO = os.path.realpath(os.path.join(__file__, '..', '..', '..', '..'))
VERSION_PATH = os.path.join(GECKO, "browser", "config", "version_display.txt")
+APP_VERSION_PATH = os.path.join(GECKO, "browser", "config", "version.txt")
"""Map signing scope aliases to sets of projects.
Currently m-c and DevEdition on m-b use nightly signing; Beta on m-b and m-r
use release signing. These data structures aren't set-up to handle different
scopes on the same repo, so we use a different set of them for DevEdition, and
callers are responsible for using the correct one (by calling the appropriate
helper below). More context on this in https://bugzilla.mozilla.org/show_bug.cgi?id=1358601.
@@ -82,22 +84,29 @@ BEETMOVER_SCOPE_ALIAS_TO_PROJECT = [[
])
]]
"""The set of all beetmover release target tasks.
Used for both `BEETMOVER_SCOPE_ALIAS_TO_TARGET_TASK` and `get_release_build_number`
"""
BEETMOVER_CANDIDATES_TARGET_TASKS = set([
- 'candidates_fennec',
+ 'promote_fennec',
+ 'promote_firefox',
+ 'promote_devedition'
])
-BEETMOVER_PUBLISH_TARGET_TASKS = set([
- 'publish_fennec',
+BEETMOVER_PUSH_TARGET_TASKS = set([
+ 'push_fennec',
+ 'ship_fennec',
+ 'push_firefox',
+ 'ship_firefox',
+ 'push_devedition',
+ 'ship_devedition',
])
-BEETMOVER_RELEASE_TARGET_TASKS = BEETMOVER_CANDIDATES_TARGET_TASKS | BEETMOVER_PUBLISH_TARGET_TASKS
+BEETMOVER_RELEASE_TARGET_TASKS = BEETMOVER_CANDIDATES_TARGET_TASKS | BEETMOVER_PUSH_TARGET_TASKS
"""Map beetmover tasks aliases to sets of target task methods.
This is a list of list-pairs, for ordering.
"""
BEETMOVER_SCOPE_ALIAS_TO_TARGET_TASK = [[
'all-nightly-tasks', set([
'nightly_fennec',
@@ -107,43 +116,52 @@ BEETMOVER_SCOPE_ALIAS_TO_TARGET_TASK = [
'nightly_win64',
'nightly_desktop',
'mozilla_beta_tasks',
'mozilla_release_tasks',
])
], [
'all-candidates-tasks', BEETMOVER_CANDIDATES_TARGET_TASKS
], [
- 'all-publish-tasks', BEETMOVER_PUBLISH_TARGET_TASKS
+ 'all-push-tasks', BEETMOVER_PUSH_TARGET_TASKS
]]
"""Map the beetmover scope aliases to the actual scopes.
"""
BEETMOVER_BUCKET_SCOPES = {
'all-candidates-tasks': {
'all-release-branches': 'project:releng:beetmover:bucket:release',
},
- 'all-publish-tasks': {
+ 'all-push-tasks': {
'all-release-branches': 'project:releng:beetmover:bucket:release',
},
'all-nightly-tasks': {
'all-nightly-branches': 'project:releng:beetmover:bucket:nightly',
},
'default': 'project:releng:beetmover:bucket:dep',
}
"""Map the beetmover tasks aliases to the actual action scopes.
"""
BEETMOVER_ACTION_SCOPES = {
'all-candidates-tasks': 'project:releng:beetmover:action:push-to-candidates',
- 'all-publish-tasks': 'project:releng:beetmover:action:push-to-releases',
+ 'all-push-tasks': 'project:releng:beetmover:action:push-to-releases',
'all-nightly-tasks': 'project:releng:beetmover:action:push-to-nightly',
'default': 'project:releng:beetmover:action:push-to-staging',
}
+
+"""Map the beetmover tasks aliases to phases.
+"""
+PHASES = {
+ 'all-candidates-tasks': 'promote',
+ 'all-push-tasks': 'push',
+ 'default': None,
+}
+
"""Map balrog scope aliases to sets of projects.
This is a list of list-pairs, for ordering.
"""
BALROG_SCOPE_ALIAS_TO_PROJECT = [[
'nightly', set([
'mozilla-central',
])
@@ -357,16 +375,22 @@ get_beetmover_bucket_scope = functools.p
)
get_beetmover_action_scope = functools.partial(
get_scope_from_target_method,
BEETMOVER_SCOPE_ALIAS_TO_TARGET_TASK,
BEETMOVER_ACTION_SCOPES
)
+get_phase = functools.partial(
+ get_scope_from_target_method,
+ BEETMOVER_SCOPE_ALIAS_TO_TARGET_TASK,
+ PHASES
+)
+
get_balrog_server_scope = functools.partial(
get_scope_from_project,
BALROG_SCOPE_ALIAS_TO_PROJECT,
BALROG_SERVER_SCOPES
)
get_balrog_channel_scopes = functools.partial(
get_scope_from_project,
@@ -401,35 +425,60 @@ get_push_apk_commit_option = functools.p
get_push_apk_rollout_percentage = functools.partial(
get_scope_from_project,
PUSH_APK_SCOPE_ALIAS_TO_PROJECT,
PUSH_APK_ROLLOUT_PERCENTAGE
)
# release_config {{{1
-def get_release_config(config, force=False):
+def get_release_config(config):
"""Get the build number and version for a release task.
Currently only applies to beetmover tasks.
Args:
config (dict): the task config that defines the target task method.
Returns:
dict: containing both `build_number` and `version`. This can be used to
update `task.payload`.
"""
release_config = {}
- if force or config.params['target_tasks_method'] in BEETMOVER_RELEASE_TARGET_TASKS:
- release_config['next_version'] = str(config.params['next_version'])
- release_config['build_number'] = int(config.params['build_number'])
- with open(VERSION_PATH, "r") as fh:
- version = fh.readline().rstrip()
- release_config['version'] = version
+
+ partial_updates = os.environ.get("PARTIAL_UPDATES", "")
+ if partial_updates != "" and config.kind in ('release-bouncer-sub',
+ 'release-uptake-monitoring',
+ 'release-updates-builder',
+ ):
+ partial_updates = json.loads(partial_updates)
+ release_config['partial_versions'] = ', '.join([
+ '{}build{}'.format(v, info['buildNumber'])
+ for v, info in partial_updates.items()
+ ])
+ if release_config['partial_versions'] == "{}":
+ del release_config['partial_versions']
+
+ uptake_monitoring_platforms = os.environ.get("UPTAKE_MONITORING_PLATFORMS", "[]")
+ if uptake_monitoring_platforms != "[]" and \
+ config.kind in ('release-uptake-monitoring',):
+ uptake_monitoring_platforms = json.loads(uptake_monitoring_platforms)
+ release_config['platforms'] = ', '.join(uptake_monitoring_platforms)
+ if release_config['platforms'] == "[]":
+ del release_config['platforms']
+
+ with open(VERSION_PATH, "r") as fh:
+ version = fh.readline().rstrip()
+ release_config['version'] = version
+ with open(APP_VERSION_PATH, "r") as fh:
+ appVersion = fh.readline().rstrip()
+ release_config['appVersion'] = appVersion
+
+ release_config['next_version'] = str(config.params['next_version'])
+ release_config['build_number'] = config.params['build_number']
return release_config
def get_signing_cert_scope_per_platform(build_platform, is_nightly, config):
if build_platform in (
'linux-devedition-nightly', 'linux64-devedition-nightly',
'macosx64-devedition-nightly',
'win32-devedition-nightly', 'win64-devedition-nightly',