Bug 1304487 - Make incompatible mozharness actions a no-op when try syntax includes '--artifact'; r=armenzg
authorMaja Frydrychowicz <mjzffr@gmail.com>
Fri, 30 Sep 2016 14:15:52 -0400
changeset 316122 61d4d0b943153ac5cb63d3c9952e2b4406271e7d
parent 316030 b0706e5d7ae3ca450ce1017dcc17cefdf0b0a08e
child 316123 a4c6bd0c3953f786b686efba8401cdd8f6ed3d9f
push id30762
push userphilringnalda@gmail.com
push dateSat, 01 Oct 2016 21:00:36 +0000
treeherdermozilla-central@d1fd56faaeb9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersarmenzg
bugs1304487
milestone52.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 1304487 - Make incompatible mozharness actions a no-op when try syntax includes '--artifact'; r=armenzg Rather than clearing actions in volatile_config, add in actions from the artifact config's default_actions. Incompatible actions are then skipped based on 'forced_artifact_build' config value. MozReview-Commit-ID: IZuDvxcQ7cN
testing/mozharness/mozharness/mozilla/building/buildbase.py
testing/mozharness/mozharness/mozilla/secrets.py
testing/mozharness/scripts/fx_desktop_build.py
--- a/testing/mozharness/mozharness/mozilla/building/buildbase.py
+++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py
@@ -1814,16 +1814,19 @@ or run without that action (ie: --no-{ac
         files = shlex.split(output)
         abs_files = [os.path.abspath(os.path.join(objdir, f)) for f in files]
         manifest_file = os.path.join(env["UPLOAD_PATH"],
                                      "signing_manifest.json")
         self.write_to_file(manifest_file,
                            self.generate_signing_manifest(abs_files))
 
     def check_test(self):
+        if self.config.get('forced_artifact_build'):
+            self.info('Skipping due to forced artifact build.')
+            return
         c = self.config
         dirs = self.query_abs_dirs()
 
         env = self.query_build_env()
         env.update(self.query_check_test_env())
 
         if c.get('enable_pymake'):  # e.g. windows
             pymake_path = os.path.join(dirs['abs_src_dir'], 'build',
@@ -1852,16 +1855,20 @@ or run without that action (ie: --no-{ac
 
     def generate_build_stats(self):
         """grab build stats following a compile.
 
         This action handles all statistics from a build: 'count_ctors'
         and then posts to graph server the results.
         We only post to graph server for non nightly build
         """
+        if self.config.get('forced_artifact_build'):
+            self.info('Skipping due to forced artifact build.')
+            return
+
         import tarfile
         import zipfile
         c = self.config
 
         if c.get('enable_count_ctors'):
             self.info("counting ctors...")
             self._count_ctors()
         else:
@@ -2043,16 +2050,19 @@ or run without that action (ie: --no-{ac
                                    branch=unittest_branch,
                                    sendchange_props=sendchange_props)
         else:
             self.fatal('type: "%s" is unknown for sendchange type. valid '
                        'strings are "unittest" or "talos"' % test_type)
 
     def update(self):
         """ submit balrog update steps. """
+        if self.config.get('forced_artifact_build'):
+            self.info('Skipping due to forced artifact build.')
+            return
         if not self.query_is_nightly():
             self.info("Not a nightly build, skipping balrog submission.")
             return
 
         # grab any props available from this or previous unclobbered runs
         self.generate_build_props(console_output=False,
                                   halt_on_failure=False)
 
--- a/testing/mozharness/mozharness/mozilla/secrets.py
+++ b/testing/mozharness/mozharness/mozilla/secrets.py
@@ -41,16 +41,20 @@ class SecretsMixin(object):
 
         The `filename` key in the dictionary gives the filename to which the
         secret should be written.
 
         The optional `min_scm_level` key gives a minimum SCM level at which this
         secret is required.  For lower levels, the value of the 'default` key
         is used, or no secret is written.
         """
+        if self.config.get('forced_artifact_build'):
+            self.info('Skipping due to forced artifact build.')
+            return
+
         secret_files = self.config.get('secret_files', [])
 
         scm_level = self.config.get('scm-level', 1)
         subst = {
             'scm-level': scm_level,
         }
 
         for sf in secret_files:
--- a/testing/mozharness/scripts/fx_desktop_build.py
+++ b/testing/mozharness/scripts/fx_desktop_build.py
@@ -147,20 +147,31 @@ class FxDesktopBuild(BuildScript, TryToo
         c.update({
             'build_variant': variant,
             'config_files': c['config_files'] + [variant_cfg_path]
         })
 
         self.info("Updating self.config with the following from {}:".format(variant_cfg_path))
         self.info(pprint.pformat(variant_cfg_dict))
         c.update(variant_cfg_dict)
+        c['forced_artifact_build'] = True
         # Bug 1231320 adds MOZHARNESS_ACTIONS in TaskCluster tasks to override default_actions
         # We don't want that when forcing an artifact build.
-        self.info("Clearing actions from volatile_config to use default_actions.")
-        rw_config.volatile_config['actions'] = None
+        if rw_config.volatile_config['actions']:
+            self.info("Updating volatile_config to include default_actions "
+                      "from {}.".format(variant_cfg_path))
+            # add default actions in correct order
+            combined_actions = []
+            for a in rw_config.all_actions:
+                if a in c['default_actions'] or a in rw_config.volatile_config['actions']:
+                    combined_actions.append(a)
+            rw_config.volatile_config['actions'] = combined_actions
+            self.info("Actions in volatile_config are now: {}".format(
+                rw_config.volatile_config['actions'])
+            )
         # replace rw_config as well to set actions as in BaseScript
         rw_config.set_config(c, overwrite=True)
         rw_config.update_actions()
         self.actions = tuple(rw_config.actions)
         self.all_actions = tuple(rw_config.all_actions)
 
 
     def query_abs_dirs(self):