Bug 1445890 - Fennec: Fix bad FTP path on bouncer submission r=mtabara a=release
authorJohan Lorenzo <jlorenzo@mozilla.com>
Fri, 16 Mar 2018 09:36:59 +0100
changeset 462653 4fe0615c6be1744ad9cbdcb6c917fabfac094a88
parent 462652 95fbe555fe5ffa90f1f8073387261689e99d837d
child 462654 abee6012b2859779d2edcd771ef937deae643d56
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmtabara, release
bugs1445890
milestone60.0
Bug 1445890 - Fennec: Fix bad FTP path on bouncer submission r=mtabara a=release MozReview-Commit-ID: 2zfBA6ksoNT
taskcluster/taskgraph/transforms/bouncer_submission.py
--- a/taskcluster/taskgraph/transforms/bouncer_submission.py
+++ b/taskcluster/taskgraph/transforms/bouncer_submission.py
@@ -23,19 +23,19 @@ FTP_PLATFORMS_PER_BOUNCER_PLATFORM = {
     'linux': 'linux-i686',
     'linux64': 'linux-x86_64',
     'osx': 'mac',
     'win': 'win32',
     'win64': 'win64',
 }
 
 # :lang is interpolated by bouncer at runtime
-CANDIDATES_PATH_TEMPLATE = '/{product}/candidates/{version}-candidates/build{build_number}/\
+CANDIDATES_PATH_TEMPLATE = '/{ftp_product}/candidates/{version}-candidates/build{build_number}/\
 {update_folder}{ftp_platform}/:lang/{file}'
-RELEASES_PATH_TEMPLATE = '/{product}/releases/{version}/{update_folder}{ftp_platform}/:lang/{file}'
+RELEASES_PATH_TEMPLATE = '/{ftp_product}/releases/{version}/{update_folder}{ftp_platform}/:lang/{file}'
 
 
 CONFIG_PER_BOUNCER_PRODUCT = {
     'apk': {
         'path_template': RELEASES_PATH_TEMPLATE,
         'file_names': {
             'android': 'fennec-{version}.:lang.android-arm.apk',
             'android-x86': 'fennec-{version}.:lang.android-i386.apk',
@@ -162,51 +162,59 @@ partial-related entry for "{}"'.format(j
         for previous_version in previous_versions
     }
 
 
 def craft_paths_per_bouncer_platform(product, bouncer_product, bouncer_platforms, current_version,
                                      current_build_number, previous_version=None):
     paths_per_bouncer_platform = {}
     for bouncer_platform in bouncer_platforms:
-        ftp_platform = FTP_PLATFORMS_PER_BOUNCER_PLATFORM[bouncer_platform]
-
         file_names_per_platform = CONFIG_PER_BOUNCER_PRODUCT[bouncer_product]['file_names']
         file_name_template = file_names_per_platform.get(
             bouncer_platform, file_names_per_platform.get('default', None)
         )
         if not file_name_template:
             # Some bouncer product like stub-installer are only meant to be on Windows.
             # Thus no default value is defined there
             continue
 
         file_name = file_name_template.format(
             version=current_version, previous_version=strip_build_data(previous_version)
         )
 
-        # We currently have a sole win32 stub installer that is to be used
-        # in both windows platforms to toggle between full installers
-        if 'Installer.exe' in file_name and ftp_platform == 'win64':
-            ftp_platform = 'win32'
-
         path_template = CONFIG_PER_BOUNCER_PRODUCT[bouncer_product]['path_template']
         file_relative_location = path_template.format(
-            product=product.lower(),
+            ftp_product=_craft_ftp_product(product),
             version=current_version,
             build_number=current_build_number,
             update_folder='update/' if '-mar' in bouncer_product else '',
-            ftp_platform=ftp_platform,
+            ftp_platform=_craft_ftp_platform(bouncer_platform, file_name),
             file=file_name,
         )
 
         paths_per_bouncer_platform[bouncer_platform] = file_relative_location
 
     return paths_per_bouncer_platform
 
 
+def _craft_ftp_product(product):
+    return 'mobile' if product == 'fennec' else product.lower()
+
+
+def _craft_ftp_platform(bouncer_platform, file_name):
+    ftp_platform = FTP_PLATFORMS_PER_BOUNCER_PLATFORM[bouncer_platform]
+    # We currently have a sole win32 stub installer that is to be used
+    # in both windows platforms to toggle between full installers
+    if 'Installer.exe' in file_name and ftp_platform == 'win64':
+        return 'win32'
+
+    return ftp_platform
+
+
+
 def craft_bouncer_product_name(product, bouncer_product, current_version,
                                current_build_number=None, previous_version=None):
     if '-ssl' in bouncer_product:
         postfix = '-SSL'
     elif 'stub-' in bouncer_product:
         postfix = '-stub'
     elif 'complete-' in bouncer_product:
         postfix = '-Complete'