Bug 1548864 - part 2: Let should_use_artifact_map() not depend on the project anymore r=tomprince a=release
authorJohan Lorenzo <jlorenzo@mozilla.com>
Mon, 20 May 2019 01:32:38 +0000
changeset 536416 bf2b338d006a89b15dfe76868dc10a29f6e91243
parent 536415 65f7c0babe096a07dc01456c09fad7632888d6f4
child 536417 f58c24f5f8543fde39d341ac43ed18ea5e87c7f2
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstomprince, release
bugs1548864
milestone68.0
Bug 1548864 - part 2: Let should_use_artifact_map() not depend on the project anymore r=tomprince a=release Differential Revision: https://phabricator.services.mozilla.com/D31492
taskcluster/taskgraph/transforms/beetmover.py
taskcluster/taskgraph/transforms/beetmover_checksums.py
taskcluster/taskgraph/transforms/beetmover_langpack_checksums.py
taskcluster/taskgraph/transforms/beetmover_repackage.py
taskcluster/taskgraph/transforms/beetmover_source_checksums.py
taskcluster/taskgraph/transforms/release_beetmover_signed_addons.py
taskcluster/taskgraph/transforms/release_generate_checksums_beetmover.py
taskcluster/taskgraph/util/scriptworker.py
--- a/taskcluster/taskgraph/transforms/beetmover.py
+++ b/taskcluster/taskgraph/transforms/beetmover.py
@@ -310,31 +310,31 @@ def make_task_worker(config, jobs):
             if 'signing' in dependency:
                 signing_task = dependency
             else:
                 build_task = dependency
 
         signing_task_ref = "<" + str(signing_task) + ">"
         build_task_ref = "<" + str(build_task) + ">"
 
-        if should_use_artifact_map(platform, config.params['project']):
+        if should_use_artifact_map(platform):
             upstream_artifacts = generate_beetmover_upstream_artifacts(
                 config, job, platform, locale
             )
         else:
             upstream_artifacts = generate_upstream_artifacts(
                 job, signing_task_ref, build_task_ref, platform, locale
             )
         worker = {
             'implementation': 'beetmover',
             'release-properties': craft_release_properties(config, job),
             'upstream-artifacts': upstream_artifacts,
         }
 
-        if should_use_artifact_map(platform, config.params['project']):
+        if should_use_artifact_map(platform):
             worker['artifact-map'] = generate_beetmover_artifact_map(
                 config, job, platform=platform, locale=locale)
 
         if locale:
             worker["locale"] = locale
         job["worker"] = worker
 
         yield job
--- a/taskcluster/taskgraph/transforms/beetmover_checksums.py
+++ b/taskcluster/taskgraph/transforms/beetmover_checksums.py
@@ -140,17 +140,17 @@ def make_beetmover_checksums_worker(conf
             "signing": "<checksums-signing>",
         }
 
         worker = {
             'implementation': 'beetmover',
             'release-properties': craft_release_properties(config, job),
         }
 
-        if should_use_artifact_map(platform, config.params['project']):
+        if should_use_artifact_map(platform):
             upstream_artifacts = generate_beetmover_upstream_artifacts(
                 config, job, platform, locale
             )
             worker['artifact-map'] = generate_beetmover_artifact_map(
                 config, job, platform=platform, locale=locale)
         else:
             upstream_artifacts = generate_upstream_artifacts(
                 refs, platform, locale
--- a/taskcluster/taskgraph/transforms/beetmover_langpack_checksums.py
+++ b/taskcluster/taskgraph/transforms/beetmover_langpack_checksums.py
@@ -133,17 +133,17 @@ def make_beetmover_checksums_worker(conf
             raise NotImplementedError(
                 "Beetmover checksums must have a beetmover dependency!")
 
         worker = {
             'implementation': 'beetmover',
             'release-properties': craft_release_properties(config, job),
         }
 
-        if should_use_artifact_map(platform, config.params['project']):
+        if should_use_artifact_map(platform):
             upstream_artifacts = generate_beetmover_upstream_artifacts(
                 config, job, platform, locales
             )
             worker['artifact-map'] = generate_beetmover_artifact_map(
                 config, job, platform=platform, locale=locales)
         else:
             upstream_artifacts = generate_upstream_artifacts(
                 refs, platform, locales
--- a/taskcluster/taskgraph/transforms/beetmover_repackage.py
+++ b/taskcluster/taskgraph/transforms/beetmover_repackage.py
@@ -353,32 +353,32 @@ least 2 regular expressions. First match
 
 
 @transforms.add
 def make_task_worker(config, jobs):
     for job in jobs:
         locale = job["attributes"].get("locale")
         platform = job["attributes"]["build_platform"]
 
-        if should_use_artifact_map(platform, config.params['project']):
+        if should_use_artifact_map(platform):
             upstream_artifacts = generate_beetmover_upstream_artifacts(
                 config, job, platform, locale)
         else:
             upstream_artifacts = generate_upstream_artifacts(
                 config, job, job['dependencies'], platform, locale,
                 project=config.params['project']
             )
 
         worker = {
             'implementation': 'beetmover',
             'release-properties': craft_release_properties(config, job),
             'upstream-artifacts': upstream_artifacts,
         }
 
-        if should_use_artifact_map(platform, config.params['project']):
+        if should_use_artifact_map(platform):
             worker['artifact-map'] = generate_beetmover_artifact_map(
                 config, job, platform=platform, locale=locale)
 
         if locale:
             worker["locale"] = locale
         job["worker"] = worker
 
         yield job
@@ -407,17 +407,17 @@ def make_partials_artifacts(config, jobs
 
         job['worker']['upstream-artifacts'].extend(upstream_artifacts)
 
         extra = list()
 
         partials_info = get_partials_info_from_params(
             config.params.get('release_history'), balrog_platform, locale)
 
-        if should_use_artifact_map(platform, config.params['project']):
+        if should_use_artifact_map(platform):
             job['worker']['artifact-map'].extend(
                 generate_beetmover_partials_artifact_map(
                     config, job, partials_info, platform=platform, locale=locale))
 
         for artifact in partials_info:
             artifact_extra = {
                 'locale': locale,
                 'artifact_name': artifact,
--- a/taskcluster/taskgraph/transforms/beetmover_source_checksums.py
+++ b/taskcluster/taskgraph/transforms/beetmover_source_checksums.py
@@ -132,29 +132,29 @@ def make_beetmover_checksums_worker(conf
             if dependency.startswith("beetmover"):
                 refs['beetmover'] = "<{}>".format(dependency)
             else:
                 refs['signing'] = "<{}>".format(dependency)
         if None in refs.values():
             raise NotImplementedError(
                 "Beetmover checksums must have a beetmover and signing dependency!")
 
-        if should_use_artifact_map(platform, config.params['project']):
+        if should_use_artifact_map(platform):
             upstream_artifacts = generate_beetmover_upstream_artifacts(config,
                                                                        job, platform, locale)
         else:
             upstream_artifacts = generate_upstream_artifacts(refs, platform, locale)
 
         worker = {
             'implementation': 'beetmover',
             'release-properties': craft_release_properties(config, job),
             'upstream-artifacts': upstream_artifacts,
         }
 
-        if should_use_artifact_map(platform, config.params['project']):
+        if should_use_artifact_map(platform):
             worker['artifact-map'] = generate_beetmover_artifact_map(
                 config, job, platform=platform)
 
         if locale:
             worker["locale"] = locale
         job["worker"] = worker
 
         yield job
--- a/taskcluster/taskgraph/transforms/release_beetmover_signed_addons.py
+++ b/taskcluster/taskgraph/transforms/release_beetmover_signed_addons.py
@@ -120,31 +120,31 @@ def make_task_description(config, jobs):
 def make_task_worker(config, jobs):
     for job in jobs:
         signing_task_ref = get_upstream_task_ref(
             job, expected_kinds=('release-sign-and-push-langpacks',)
         )
 
         platform = job["attributes"]["build_platform"]
         locale = job["attributes"]["chunk_locales"]
-        if should_use_artifact_map(platform, config.params['project']):
+        if should_use_artifact_map(platform):
             upstream_artifacts = generate_beetmover_upstream_artifacts(
                 config, job, platform, locale,
             )
         else:
             upstream_artifacts = generate_upstream_artifacts(
                 signing_task_ref, job['attributes']['chunk_locales']
             )
         job['worker'] = {
             'implementation': 'beetmover',
             'release-properties': craft_release_properties(config, job),
             'upstream-artifacts': upstream_artifacts,
         }
 
-        if should_use_artifact_map(platform, config.params['project']):
+        if should_use_artifact_map(platform):
             job['worker']['artifact-map'] = generate_beetmover_artifact_map(
                 config, job, platform=platform, locale=locale)
 
         yield job
 
 
 def generate_upstream_artifacts(upstream_task_ref, locales):
     return [{
@@ -227,17 +227,17 @@ def _change_platform_data(config, platfo
     platform_job['label'] = platform_job['label'].replace(orig_platform, platform)
     platform_job['description'] = platform_job['description'].replace(orig_platform, platform)
     platform_job['treeherder']['platform'] = platform_job['treeherder']['platform'].replace(
         orig_platform, platform
     )
     platform_job['worker']['release-properties']['platform'] = platform
 
     # amend artifactMap entries as well
-    if should_use_artifact_map(backup_platform, config.params['project']):
+    if should_use_artifact_map(backup_platform):
         platform_mapping = {
             'linux64': 'linux-x86_64',
             'linux': 'linux-i686',
             'macosx64': 'mac',
             'win32': 'win32',
             'win64': 'win64',
         }
         orig_platform = platform_mapping.get(orig_platform, orig_platform)
--- a/taskcluster/taskgraph/transforms/release_generate_checksums_beetmover.py
+++ b/taskcluster/taskgraph/transforms/release_generate_checksums_beetmover.py
@@ -151,27 +151,27 @@ def make_task_worker(config, jobs):
 
         worker = {
             'implementation': 'beetmover',
             'release-properties': craft_release_properties(config, job),
         }
 
         platform = job["attributes"]["build_platform"]
         # Works with Firefox/Devedition. Commented for migration.
-        if should_use_artifact_map(platform, config.params['project']):
+        if should_use_artifact_map(platform):
             upstream_artifacts = generate_beetmover_upstream_artifacts(
                 config, job, platform=None, locale=None
             )
         else:
             upstream_artifacts = generate_upstream_artifacts(
                 job, signing_task_ref, build_task_ref
             )
 
         worker['upstream-artifacts'] = upstream_artifacts
 
         # Works with Firefox/Devedition. Commented for migration.
-        if should_use_artifact_map(platform, config.params['project']):
+        if should_use_artifact_map(platform):
             worker['artifact-map'] = generate_beetmover_artifact_map(
                 config, job, platform=platform)
 
         job["worker"] = worker
 
         yield job
--- a/taskcluster/taskgraph/util/scriptworker.py
+++ b/taskcluster/taskgraph/util/scriptworker.py
@@ -806,53 +806,15 @@ def generate_beetmover_partials_artifact
             'taskId': {'task-reference': "<{}>".format(dep)},
             'locale': locale,
             'paths': paths,
         })
 
     return artifacts
 
 
-# should_use_artifact_map {{{
-def should_use_artifact_map(platform, project):
+def should_use_artifact_map(platform):
     """Return True if this task uses the beetmover artifact map.
 
     This function exists solely for the beetmover artifact map
     migration.
     """
-    if 'linux64-snap-shippable' in platform:
-        # Snap has never been implemented outside of declarative artifacts. We need to use
-        # declarative artifacts no matter the branch we're on
-        return True
-
-    # FIXME: once we're ready to switch fully to declarative artifacts on other
-    # branches, we can expand this; for now, Fennec is rolled-out to all
-    # release branches, while Firefox only to mozilla-central
-    platforms = [
-        'android',
-        'fennec'
-    ]
-    projects = ['mozilla-central', 'mozilla-beta', 'mozilla-release']
-    if any([pl in platform for pl in platforms]) and any([pj == project for pj in projects]):
-        return True
-
-    platforms = [
-        'linux',    # needed for beetmover-langpacks-checksums
-        'linux64',  # which inherit amended platform from their beetmover counterpart
-        'win32',
-        'win64',
-        'macosx64',
-        'linux-shippable',
-        'linux64-shippable',
-        'macosx64-shippable',
-        'win32-shippable',
-        'win64-shippable',
-        'win64-aarch64-shippable',
-        'win64-asan-reporter-nightly',
-        'linux64-asan-reporter-nightly',
-        'firefox-source',
-        'firefox-release',
-    ]
-    projects = ['mozilla-central', 'mozilla-beta', 'mozilla-release']
-    if any([pl == platform for pl in platforms]) and any([pj == project for pj in projects]):
-        return True
-
-    return False
+    return 'devedition' not in platform