Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1491907 - Get comm/ version from comm/mail/*version.txt r=dustin
Browse files Browse the repository at this point in the history
The release-update-verify-config task requires that the versions passed
to it match up with what's been released. The version of Thunderbird
does not necessarily match the Gecko version it's based on.

Depends on D6509

Differential Revision: https://phabricator.services.mozilla.com/D6510
  • Loading branch information
jfx2006 committed Sep 29, 2018
1 parent 03506d0 commit 4b9e5e8
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
1 change: 1 addition & 0 deletions taskcluster/ci/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
trust-domain: gecko
project-repo-param-prefix: ''
product-dir: 'browser'
treeherder:
group-names:
'cram': 'Cram tests'
Expand Down
3 changes: 0 additions & 3 deletions taskcluster/taskgraph/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

GECKO = os.path.realpath(os.path.join(__file__, '..', '..', '..'))

APP_VERSION_PATH = os.path.join(GECKO, "browser", "config", "version.txt")
VERSION_PATH = os.path.join(GECKO, "browser", "config", "version_display.txt")

# Maximum number of dependencies a single task can have
# https://docs.taskcluster.net/reference/platform/taskcluster-queue/references/api#createTask
# specifies 100, but we also optionally add the decision task id as a dep in
Expand Down
5 changes: 4 additions & 1 deletion taskcluster/taskgraph/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@
# (See http://firefox-source-docs.mozilla.org/taskcluster/taskcluster/parameters.html#push-information # noqa
# and http://firefox-source-docs.mozilla.org/taskcluster/taskcluster/parameters.html#comm-push-information) # noqa
Required('project-repo-param-prefix'): basestring,
# This specifies the top level directory of the application being built.
# ie. "browser/" for Firefox, "comm/mail/" for Thunderbird.
Required('product-dir'): basestring,
Required('treeherder'): {
# Mapping of treeherder group symbols to descriptive names
Required('group-names'): {basestring: basestring}
},
Required('index'): {
Required('products'): [basestring],
Required('products'): [basestring]
},
Required('try'): {
# We have a few platforms for which we want to do some "extra" builds, or at
Expand Down
10 changes: 8 additions & 2 deletions taskcluster/taskgraph/decision.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from .actions import render_actions_json
from taskgraph.util.partials import populate_release_history
from taskgraph.util.yaml import load_yaml
from taskgraph.config import load_graph_config


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -186,6 +187,11 @@ def get_decision_parameters(options):
This also applies per-project parameters, based on the given project.
"""
# --root is not passed to mach when building Firefox
root = options.get('root') or 'taskcluster/ci'
_config = load_graph_config(root)
product_dir = _config['product-dir']

parameters = {n: options[n] for n in [
'base_repository',
'head_repository',
Expand Down Expand Up @@ -218,8 +224,8 @@ def get_decision_parameters(options):
parameters['existing_tasks'] = {}
parameters['do_not_optimize'] = []
parameters['build_number'] = 1
parameters['version'] = get_version()
parameters['app_version'] = get_app_version()
parameters['version'] = get_version(product_dir)
parameters['app_version'] = get_app_version(product_dir)
parameters['next_version'] = None
parameters['release_type'] = 'nightly'
parameters['release_eta'] = ''
Expand Down
16 changes: 12 additions & 4 deletions taskcluster/taskgraph/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from __future__ import absolute_import, print_function, unicode_literals

import functools
import os.path
import json
import time
import yaml
Expand All @@ -15,7 +15,7 @@
from mozbuild.util import ReadOnlyDict, memoize
from mozversioncontrol import get_repository_object

from . import APP_VERSION_PATH, GECKO, VERSION_PATH
from . import GECKO
from .util.attributes import RELEASE_PROJECTS


Expand All @@ -34,8 +34,16 @@ def get_contents(path):
return contents


get_version = functools.partial(get_contents, VERSION_PATH)
get_app_version = functools.partial(get_contents, APP_VERSION_PATH)
def get_version(product_dir='browser'):
version_path = os.path.join(GECKO, product_dir, 'config',
'version_display.txt')
return get_contents(version_path)


def get_app_version(product_dir='browser'):
app_version_path = os.path.join(GECKO, product_dir, 'config',
'version.txt')
return get_contents(app_version_path)


# Please keep this list sorted and in sync with taskcluster/docs/parameters.rst
Expand Down

0 comments on commit 4b9e5e8

Please sign in to comment.