Пример #1
0
def define_upstream_artifacts(config, jobs):
    partner_configs = get_partner_config_by_kind(config, config.kind)
    if not partner_configs:
        return

    for job in jobs:
        dep_job = job['primary-dependency']
        job['depname'] = dep_job.label
        job['attributes'] = copy_attributes_from_dependent_job(dep_job)

        repack_ids = job['extra']['repack_ids']
        artifacts_specifications = generate_specifications_of_artifacts_to_sign(
            config,
            job,
            keep_locale_template=True,
            kind=config.kind,
        )
        task_type = 'build'
        if 'notarization' in job['depname']:
            task_type = 'scriptworker'
        job['upstream-artifacts'] = [{
            'taskId': {'task-reference': '<{}>'.format(dep_job.kind)},
            'taskType': task_type,
            'paths': [
                path_template.format(locale=repack_id)
                for path_template in spec['artifacts']
                for repack_id in repack_ids
            ],
            'formats': spec['formats'],
        } for spec in artifacts_specifications]

        yield job
Пример #2
0
def define_upstream_artifacts(config, jobs):
    for job in jobs:
        dep_job = job['primary-dependency']
        upstream_artifact_task = job.pop('upstream-artifact-task', dep_job)

        job['attributes'] = copy_attributes_from_dependent_job(dep_job)

        artifacts_specifications = generate_specifications_of_artifacts_to_sign(
            config,
            job,
            keep_locale_template=False,
            kind=config.kind,
            dep_kind=upstream_artifact_task.kind)

        task_ref = '<{}>'.format(upstream_artifact_task.kind)
        task_type = 'build'
        if 'notarization' in upstream_artifact_task.kind:
            task_type = 'scriptworker'

        job['upstream-artifacts'] = [{
            'taskId': {
                'task-reference': task_ref
            },
            'taskType': task_type,
            'paths': spec['artifacts'],
            'formats': spec['formats'],
        } for spec in artifacts_specifications]

        yield job
Пример #3
0
def define_upstream_artifacts(config, jobs):
    for job in jobs:
        dep_job = job['dependent-task']

        locale_specifications = generate_specifications_of_artifacts_to_sign(
            dep_job,
            keep_locale_template=True,
        )

        upstream_artifacts = []
        for spec in locale_specifications:
            upstream_artifacts.append({
                'taskId': {
                    'task-reference': '<unsigned-repack>'
                },
                'taskType':
                'l10n',
                # Set paths based on artifacts in the specs (above) one per
                # locale present in the chunk this is signing stuff for.
                'paths': [
                    path_template.format(locale=locale)
                    for locale in dep_job.attributes.get('chunk_locales', [])
                    for path_template in spec['artifacts']
                ],
                'formats':
                spec['formats']
            })

        job['upstream-artifacts'] = upstream_artifacts

        yield job
Пример #4
0
def define_upstream_artifacts(config, jobs):
    for job in jobs:
        dep_job = job['primary-dependency']
        build_platform = dep_job.attributes.get('build_platform')

        job['attributes'] = copy_attributes_from_dependent_job(dep_job)

        artifacts_specifications = generate_specifications_of_artifacts_to_sign(
            config,
            job,
            keep_locale_template=False,
            kind=config.kind,
        )

        if 'android' in build_platform:
            # We're in the job that creates both multilocale and en-US APKs
            artifacts_specifications[0]['artifacts'].append(
                get_artifact_path(dep_job, 'en-US/target.apk'))

        job['upstream-artifacts'] = [{
            'taskId': {
                'task-reference': '<build>'
            },
            'taskType': 'build',
            'paths': spec['artifacts'],
            'formats': spec['formats'],
        } for spec in artifacts_specifications]

        yield job
Пример #5
0
def define_upstream_artifacts(config, jobs):
    partner_configs = get_partner_config_by_kind(config, config.kind)
    if not partner_configs:
        return

    for job in jobs:
        dep_job = job['primary-dependency']
        repack_ids = job['extra']['repack_ids']
        artifacts_specifications = generate_specifications_of_artifacts_to_sign(
            dep_job,
            keep_locale_template=True,
            kind=config.kind,
        )
        job['upstream-artifacts'] = [{
            'taskId': {
                'task-reference': '<{}>'.format(job['depname'])
            },
            'taskType':
            'build',
            'paths': [
                path_template.format(locale=repack_id)
                for path_template in spec['artifacts']
                for repack_id in repack_ids
            ],
            'formats':
            spec['formats'],
        } for spec in artifacts_specifications]

        yield job
Пример #6
0
def define_upstream_artifacts(config, jobs):
    for job in jobs:
        dep_job = job['dependent-task']

        locale_specifications = generate_specifications_of_artifacts_to_sign(
            dep_job.attributes.get('build_platform'),
            is_nightly=True,
            keep_locale_template=True
        )

        upstream_artifacts = []
        for spec in locale_specifications:
            upstream_artifacts.append({
                'taskId': {'task-reference': '<unsigned-repack>'},
                'taskType': 'l10n',
                # Set paths based on artifacts in the specs (above) one per
                # locale present in the chunk this is signing stuff for.
                'paths': [
                    path_template.format(locale=locale)
                    for locale in dep_job.attributes.get('chunk_locales', [])
                    for path_template in spec['artifacts']
                ],
                'formats': spec['formats']
            })

        job['upstream-artifacts'] = upstream_artifacts

        yield job
Пример #7
0
def define_upstream_artifacts(config, jobs):
    partner_configs = get_partner_config_by_kind(config, config.kind)
    if not partner_configs:
        return

    for job in jobs:
        dep_job = job['dependent-task']
        build_platform = dep_job.attributes.get('build_platform')

        repack_ids = []
        for partner, partner_config in partner_configs.iteritems():
            for sub_partner, cfg in partner_config.iteritems():
                if not cfg or build_platform not in cfg["platforms"]:
                    continue
                for locale in locales_per_build_platform(build_platform, cfg.get('locales', [])):
                    repack_ids.append("{}/{}/{}".format(partner, sub_partner, locale))

        artifacts_specifications = generate_specifications_of_artifacts_to_sign(
            dep_job,
            keep_locale_template=True,
            kind=config.kind,
        )
        job['upstream-artifacts'] = [{
            'taskId': {'task-reference': '<{}>'.format(job['depname'])},
            'taskType': 'build',
            'paths': [
                path_template.format(locale=repack_id)
                for repack_id in repack_ids
                for path_template in spec['artifacts']
            ],
            'formats': spec['formats'],
        } for spec in artifacts_specifications]

        yield job
Пример #8
0
def define_upstream_artifacts(config, jobs):
    for job in jobs:
        dep_job = job['dependent-task']
        build_platform = dep_job.attributes.get('build_platform')

        artifacts_specifications = generate_specifications_of_artifacts_to_sign(
            build_platform,
            dep_job.attributes.get('nightly'),
            keep_locale_template=False)

        if 'android' in build_platform:
            # We're in the job that creates both multilocale and en-US APKs
            artifacts_specifications[0]['artifacts'].append(
                'public/build/en-US/target.apk')

        job['upstream-artifacts'] = [{
            'taskId': {
                'task-reference': '<build>'
            },
            'taskType': 'build',
            'paths': spec['artifacts'],
            'formats': spec['formats'],
        } for spec in artifacts_specifications]

        yield job
Пример #9
0
def define_upstream_artifacts(config, jobs):
    for job in jobs:
        dep_job = job["primary-dependency"]
        upstream_artifact_task = job.pop("upstream-artifact-task", dep_job)

        job["attributes"] = copy_attributes_from_dependent_job(dep_job)

        artifacts_specifications = generate_specifications_of_artifacts_to_sign(
            config,
            job,
            keep_locale_template=False,
            kind=config.kind,
            dep_kind=upstream_artifact_task.kind,
        )

        task_ref = "<{}>".format(upstream_artifact_task.kind)
        task_type = "build"
        if "notarization" in upstream_artifact_task.kind:
            task_type = "scriptworker"

        job["upstream-artifacts"] = [{
            "taskId": {
                "task-reference": task_ref
            },
            "taskType": task_type,
            "paths": spec["artifacts"],
            "formats": spec["formats"],
        } for spec in artifacts_specifications]

        yield job
def define_upstream_artifacts(config, jobs):
    for job in jobs:
        dep_job = job["primary-dependency"]
        upstream_artifact_task = job.pop("upstream-artifact-task", dep_job)

        job["attributes"] = copy_attributes_from_dependent_job(dep_job)
        if dep_job.attributes.get("chunk_locales"):
            # Used for l10n attribute passthrough
            job["attributes"]["chunk_locales"] = dep_job.attributes.get(
                "chunk_locales")

        locale_specifications = generate_specifications_of_artifacts_to_sign(
            config,
            job,
            keep_locale_template=True,
            dep_kind=upstream_artifact_task.kind,
        )

        upstream_artifacts = []
        for spec in locale_specifications:
            task_type = "l10n"
            if "notarization" in upstream_artifact_task.kind:
                task_type = "scriptworker"
            upstream_artifacts.append({
                "taskId": {
                    "task-reference":
                    "<{}>".format(upstream_artifact_task.kind)
                },
                "taskType":
                task_type,
                # Set paths based on artifacts in the specs (above) one per
                # locale present in the chunk this is signing stuff for.
                # Pass paths through set and sorted() so we get a list back
                # and we remove any duplicates (e.g. hardcoded ja-JP-mac langpack)
                "paths":
                sorted(
                    set([
                        path_template.format(locale=locale)
                        for locale in upstream_artifact_task.attributes.get(
                            "chunk_locales", [])
                        for path_template in spec["artifacts"]
                    ])),
                "formats":
                spec["formats"],
            })

        job["upstream-artifacts"] = upstream_artifacts

        yield job
Пример #11
0
def define_upstream_artifacts(config, jobs):
    for job in jobs:
        dep_job = job['primary-dependency']

        job['attributes'] = copy_attributes_from_dependent_job(dep_job)
        if dep_job.attributes.get('chunk_locales'):
            # Used for l10n attribute passthrough
            job['attributes']['chunk_locales'] = dep_job.attributes.get(
                'chunk_locales')

        locale_specifications = generate_specifications_of_artifacts_to_sign(
            config,
            job,
            keep_locale_template=True,
        )

        upstream_artifacts = []
        for spec in locale_specifications:
            upstream_artifacts.append({
                'taskId': {
                    'task-reference': '<unsigned-repack>'
                },
                'taskType':
                'l10n',
                # Set paths based on artifacts in the specs (above) one per
                # locale present in the chunk this is signing stuff for.
                # Pass paths through set and sorted() so we get a list back
                # and we remove any duplicates (e.g. hardcoded ja-JP-mac langpack)
                'paths':
                sorted(
                    set([
                        path_template.format(locale=locale)
                        for locale in dep_job.attributes.get(
                            'chunk_locales', [])
                        for path_template in spec['artifacts']
                    ])),
                'formats':
                spec['formats']
            })

        job['upstream-artifacts'] = upstream_artifacts

        yield job
Пример #12
0
def define_upstream_artifacts(config, jobs):
    for job in jobs:
        dep_job = job['primary-dependency']

        job['attributes'] = copy_attributes_from_dependent_job(dep_job)

        artifacts_specifications = generate_specifications_of_artifacts_to_sign(
            config,
            job,
            keep_locale_template=False,
            kind=config.kind,
        )

        job['upstream-artifacts'] = [{
            'taskId': {
                'task-reference': '<build>'
            },
            'taskType': 'build',
            'paths': spec['artifacts'],
            'formats': spec['formats'],
        } for spec in artifacts_specifications]

        yield job
Пример #13
0
def define_upstream_artifacts(config, jobs):
    partner_configs = get_partner_config_by_kind(config, config.kind)
    if not partner_configs:
        return

    for job in jobs:
        dep_job = job["primary-dependency"]
        job["depname"] = dep_job.label
        job["attributes"] = copy_attributes_from_dependent_job(dep_job)

        repack_ids = job["extra"]["repack_ids"]
        artifacts_specifications = generate_specifications_of_artifacts_to_sign(
            config,
            job,
            keep_locale_template=True,
            kind=config.kind,
        )
        task_type = "build"
        if "notarization" in job["depname"]:
            task_type = "scriptworker"
        job["upstream-artifacts"] = [{
            "taskId": {
                "task-reference": "<{}>".format(dep_job.kind)
            },
            "taskType":
            task_type,
            "paths": [
                path_template.format(locale=repack_id)
                for path_template in spec["artifacts"]
                for repack_id in repack_ids
            ],
            "formats":
            spec["formats"],
        } for spec in artifacts_specifications]

        yield job
Пример #14
0
def define_upstream_artifacts(config, jobs):
    for job in jobs:
        dep_job = job['dependent-task']
        build_platform = dep_job.attributes.get('build_platform')

        artifacts_specifications = generate_specifications_of_artifacts_to_sign(
            build_platform,
            dep_job.attributes.get('nightly'),
            keep_locale_template=False,
            kind=config.kind,
        )

        if 'android' in build_platform:
            # We're in the job that creates both multilocale and en-US APKs
            artifacts_specifications[0]['artifacts'].append('public/build/en-US/target.apk')

        job['upstream-artifacts'] = [{
            'taskId': {'task-reference': '<build>'},
            'taskType': 'build',
            'paths': spec['artifacts'],
            'formats': spec['formats'],
        } for spec in artifacts_specifications]

        yield job