Bug 1538995 - adjust repackage jobs to create partner stub installers, r=aki
authorNick Thomas <nthomas@mozilla.com>
Thu, 20 Jun 2019 22:17:55 +0000
changeset 543122 93f413cf1457adcf6f0a4e28c54fab5f95be7073
parent 543121 20de5a5e5c55c7286cc4e303a12459b30a21eaa3
child 543123 8b151e2777fb7d07e06be8e8fe223d9a4fc5c6a6
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaki
bugs1538995
milestone69.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 1538995 - adjust repackage jobs to create partner stub installers, r=aki On win32, where repack_stub_installer is enabled, extend the inputs to the partner repackage task so that it donwloads the upstream artifacts and creates the stub installer. Differential Revision: https://phabricator.services.mozilla.com/D34946
taskcluster/taskgraph/transforms/repackage_partner.py
--- a/taskcluster/taskgraph/transforms/repackage_partner.py
+++ b/taskcluster/taskgraph/transforms/repackage_partner.py
@@ -12,28 +12,34 @@ import copy
 from taskgraph.loader.single_dep import schema
 from taskgraph.transforms.base import TransformSequence
 from taskgraph.util.attributes import copy_attributes_from_dependent_job
 from taskgraph.util.schema import (
     optionally_keyed_by,
     resolve_keyed_by,
 )
 from taskgraph.util.taskcluster import get_artifact_prefix
-from taskgraph.util.partners import check_if_partners_enabled
+from taskgraph.util.partners import check_if_partners_enabled, get_partner_config_by_kind
 from taskgraph.util.platforms import archive_format, executable_extension
 from taskgraph.util.workertypes import worker_type_implementation
 from taskgraph.transforms.task import task_description_schema
-from taskgraph.transforms.repackage import PACKAGE_FORMATS
+from taskgraph.transforms.repackage import PACKAGE_FORMATS as PACKAGE_FORMATS_VANILLA
 from voluptuous import Required, Optional
 
 
 def _by_platform(arg):
     return optionally_keyed_by('build-platform', arg)
 
 
+# When repacking the stub installer we need to pass a zip file and package name to the
+# repackage task. This is not needed for vanilla stub but analogous to the full installer.
+PACKAGE_FORMATS = copy.deepcopy(PACKAGE_FORMATS_VANILLA)
+PACKAGE_FORMATS['installer-stub']['inputs']['package'] = 'target-stub{archive_format}'
+PACKAGE_FORMATS['installer-stub']['args'].extend(["--package-name", "{package-name}"])
+
 packaging_description_schema = schema.extend({
     # depname is used in taskref's to identify the taskID of the signed things
     Required('depname', default='build'): basestring,
 
     # unique label to describe this repackaging task
     Optional('label'): basestring,
 
     # Routes specific to this task, if defined
@@ -125,16 +131,22 @@ def make_job_description(config, jobs):
                 signing_task = dependency
             elif build_platform.startswith('win') and dependency.endswith('repack'):
                 signing_task = dependency
 
         attributes['repackage_type'] = 'repackage'
 
         repack_id = job['extra']['repack_id']
 
+        partner_config = get_partner_config_by_kind(config, config.kind)
+        partner, subpartner, _ = repack_id.split('/')
+        repack_stub_installer = partner_config[partner][subpartner].get('repack_stub_installer')
+        if build_platform.startswith('win32') and repack_stub_installer:
+            job['package-formats'].append('installer-stub')
+
         repackage_config = []
         for format in job.get('package-formats'):
             command = copy.deepcopy(PACKAGE_FORMATS[format])
             substs = {
                 'archive_format': archive_format(build_platform),
                 'executable_extension': executable_extension(build_platform),
             }
             command['inputs'] = {
@@ -203,51 +215,59 @@ def make_job_description(config, jobs):
             'scopes': ['queue:get-artifact:releng/partner/*'],
             'run-on-projects': dep_job.attributes.get('run_on_projects'),
             'routes': job.get('routes', []),
             'extra': job.get('extra', {}),
             'worker': worker,
             'run': run,
             'fetches': _generate_download_config(dep_job, build_platform,
                                                  signing_task, partner=repack_id,
-                                                 project=config.params["project"]),
+                                                 project=config.params["project"],
+                                                 repack_stub_installer=repack_stub_installer),
         }
 
         if build_platform.startswith('macosx'):
             task['toolchains'] = [
                 'linux64-libdmg',
                 'linux64-hfsplus',
                 'linux64-node',
             ]
         yield task
 
 
 def _generate_download_config(task, build_platform, signing_task, partner=None,
-                              project=None):
+                              project=None, repack_stub_installer=False):
     locale_path = '{}/'.format(partner) if partner else ''
 
     if build_platform.startswith('macosx'):
         return {
             signing_task: [
                 {
                     'artifact': '{}target.tar.gz'.format(locale_path),
                     'extract': False,
                 },
             ],
         }
     elif build_platform.startswith('win'):
-        return {
-            signing_task: [
+        download_config = [
+            {
+                'artifact': '{}target.zip'.format(locale_path),
+                'extract': False,
+            },
+            '{}setup.exe'.format(locale_path),
+        ]
+        if build_platform.startswith('win32') and repack_stub_installer:
+            download_config.extend([
                 {
-                    'artifact': '{}target.zip'.format(locale_path),
+                    'artifact': '{}target-stub.zip'.format(locale_path),
                     'extract': False,
                 },
-                '{}setup.exe'.format(locale_path),
-            ],
-        }
+                '{}setup-stub.exe'.format(locale_path),
+            ])
+        return {signing_task: download_config}
 
     raise NotImplementedError('Unsupported build_platform: "{}"'.format(build_platform))
 
 
 def _generate_task_output_files(task, worker_implementation, repackage_config, partner):
     """We carefully generate an explicit list here, but there's an artifacts directory
     too, courtesy of generic_worker_add_artifacts() (windows) or docker_worker_add_artifacts().
     Any errors here are likely masked by that.