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 408511 4ba64495f393028e504d1203805b0dedad04cd69
parent 408510 777cffb761a26a740f11fb5a810970afb8856386
child 408512 27d65d2c59095a8a37b8a5ada20b90429a7d5553
push id33645
push userrgurzau@mozilla.com
push dateFri, 16 Mar 2018 17:49:51 +0000
treeherdermozilla-central@3b10b50a72d7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmtabara, release
bugs1445890
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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,20 @@ 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 +163,58 @@ 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'