taskcluster/comm_taskgraph/__init__.py
author Gijs Kruitbosch <gijskruitbosch@gmail.com>
Thu, 06 Aug 2020 12:31:53 +0000
changeset 40124 f645a932dd65505d9215d13a57a79f46844da5ca
parent 39761 34cb186497fc7d425f0e62c11c2f1be91e34cbdd
permissions -rw-r--r--
Bug 1654548 - fix printing in compose, view source, mail viewer, address book and attempt to improve state for calendar r=mkmelin a=wsmwk Differential Revision: https://phabricator.services.mozilla.com/D86013

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from __future__ import absolute_import, print_function, unicode_literals

import os
import logging
from importlib import import_module

from taskgraph import GECKO
from taskgraph.util.partials import populate_release_history

logger = logging.getLogger(__name__)

COMM = os.path.join(GECKO, 'comm')
COMM_SCRIPTS = os.path.join(COMM, 'taskcluster', 'scripts')

BALROG_PRODUCT = 'Thunderbird'


def register(graph_config):
    """
    Import all modules that are siblings of this one, triggering decorators in
    the process.
    """
    logger.info("{} path registered".format(__name__))
    _import_modules(['documentation', 'actions', 'target_tasks', 'transforms.job.toolchain'])


def _import_modules(modules):
    for module in modules:
        import_module(".{}".format(module), package=__name__)


def get_decision_parameters(graph_config, parameters):
    logger.info("{}.get_decision_parameters called".format(__name__))
    # If the target method is nightly, we should build partials. This means
    # knowing what has been released previously.
    # An empty release_history is fine, it just means no partials will be built
    project = parameters['project']

    parameters.setdefault('release_history', dict())
    if 'nightly' in parameters.get('target_tasks_method', ''):
        parameters['release_history'] = populate_release_history(BALROG_PRODUCT, project)