diff --git a/taskcluster/taskgraph/transforms/beetmover_repackage.py b/taskcluster/taskgraph/transforms/beetmover_repackage.py index 4289aeb72f43..66d99df7575c 100644 --- a/taskcluster/taskgraph/transforms/beetmover_repackage.py +++ b/taskcluster/taskgraph/transforms/beetmover_repackage.py @@ -334,8 +334,8 @@ def generate_partials_upstream_artifacts(job, artifacts, platform, locale=None): upstream_artifacts = [{ 'taskId': {'task-reference': ''}, 'taskType': 'signing', - 'paths': ["{}/{}".format(artifact_prefix, p) - for p in artifacts], + 'paths': ["{}/{}".format(artifact_prefix, path) + for path, _ in artifacts], 'locale': locale or 'en-US', }] diff --git a/taskcluster/taskgraph/transforms/partials_signing.py b/taskcluster/taskgraph/transforms/partials_signing.py index 4198a0ad938a..098b188139b0 100644 --- a/taskcluster/taskgraph/transforms/partials_signing.py +++ b/taskcluster/taskgraph/transforms/partials_signing.py @@ -33,14 +33,36 @@ def generate_upstream_artifacts(job, release_history, platform, locale=None): upstream_artifacts = [{ "taskId": {"task-reference": ''}, "taskType": 'partials', - "paths": ["{}/{}".format(artifact_prefix, p) - for p in artifacts], + "paths": [ + "{}/{}".format(artifact_prefix, path) + for path, version in artifacts + # TODO Use mozilla-version to avoid comparing strings. Otherwise Firefox 100 will be + # considered smaller than Firefox 56 + if version is None or version >= '56' + ], "formats": ["mar_sha384"], }] + old_mar_upstream_artifacts = { + "taskId": {"task-reference": ''}, + "taskType": 'partials', + "paths": [ + "{}/{}".format(artifact_prefix, path) + for path, version in artifacts + # TODO Use mozilla-version to avoid comparing strings. Otherwise Firefox 100 will be + # considered smaller than Firefox 56 + if version is not None and version < '56' + ], + "formats": ["mar"], + } + + if old_mar_upstream_artifacts["paths"]: + upstream_artifacts.append(old_mar_upstream_artifacts) + return upstream_artifacts + @transforms.add def make_task_description(config, jobs): for job in jobs: @@ -81,7 +103,11 @@ def make_task_description(config, jobs): signing_cert_scope = get_signing_cert_scope_per_platform( build_platform, is_nightly, config ) + scopes = [signing_cert_scope, 'project:releng:signing:format:mar_sha384'] + if any("mar" in upstream_details["formats"] for upstream_details in upstream_artifacts): + scopes.append('project:releng:signing:format:mar') + task = { 'label': label, 'description': "{} Partials".format( diff --git a/taskcluster/taskgraph/util/partials.py b/taskcluster/taskgraph/util/partials.py index 2c92fa5f641e..80f6cea5028a 100644 --- a/taskcluster/taskgraph/util/partials.py +++ b/taskcluster/taskgraph/util/partials.py @@ -91,7 +91,10 @@ def get_builds(release_history, platform, locale): def get_partials_artifacts(release_history, platform, locale): platform = _sanitize_platform(platform) - return release_history.get(platform, {}).get(locale, {}).keys() + return [ + (artifact, details.get('previousVersion', None)) + for artifact, details in release_history.get(platform, {}).get(locale, {}).items() + ] def get_partials_artifact_map(release_history, platform, locale):