Backed out 2 changesets (bug 1278698) for build bustage a=backout CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Fri, 09 Sep 2016 12:38:11 -0700
changeset 354694 54d81bfbd90190c7e65361d53369c2ca78971bef
parent 354693 4468d50fd021a9f98ae4cd48da62be2d53246dcf
child 354695 bd82d664a18cc6b4a2a8f1e8b31409c986558371
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1278698
milestone51.0a1
backs out4468d50fd021a9f98ae4cd48da62be2d53246dcf
f770a12324d77e69b830234da9392b91892600f7
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
Backed out 2 changesets (bug 1278698) for build bustage a=backout CLOSED TREE Backed out changeset 4468d50fd021 (bug 1278698) Backed out changeset f770a12324d7 (bug 1278698)
testing/mozharness/mozharness/base/config.py
testing/mozharness/mozharness/mozilla/building/buildbase.py
testing/mozharness/mozharness/mozilla/testing/try_tools.py
testing/mozharness/scripts/fx_desktop_build.py
--- a/testing/mozharness/mozharness/base/config.py
+++ b/testing/mozharness/mozharness/base/config.py
@@ -511,29 +511,17 @@ class BaseConfig(object):
         # The idea behind the volatile_config is we don't want to save this
         # info over multiple runs.  This defaults to the action-specific
         # config options, but can be anything.
         for key in self.volatile_config.keys():
             if self._config.get(key) is not None:
                 self.volatile_config[key] = self._config[key]
                 del(self._config[key])
 
-        self.update_actions()
-        if options.list_actions:
-            self.list_actions()
-
-        # Keep? This is for saving the volatile config in the dump_config
-        self._config['volatile_config'] = self.volatile_config
-
-        self.options = options
-        self.args = args
-        return (self.options, self.args)
-
-    def update_actions(self):
-        """ Update actions after reading in config.
+        """Actions.
 
         Seems a little complex, but the logic goes:
 
         First, if default_actions is specified in the config, set our
         default actions even if the script specifies other default actions.
 
         Without any other action-specific options, run with default actions.
 
@@ -545,25 +533,34 @@ class BaseConfig(object):
 
         Finally, if we specify --no-ACTION, remove that from the list of
         actions to perform.
         """
         if self._config.get('default_actions'):
             default_actions = self.verify_actions(self._config['default_actions'])
             self.default_actions = default_actions
         self.verify_actions_order(self.default_actions)
+        if options.list_actions:
+            self.list_actions()
         self.actions = self.default_actions[:]
         if self.volatile_config['actions']:
             actions = self.verify_actions(self.volatile_config['actions'])
             self.actions = actions
         elif self.volatile_config['add_actions']:
             actions = self.verify_actions(self.volatile_config['add_actions'])
             self.actions.extend(actions)
         if self.volatile_config['no_actions']:
             actions = self.verify_actions(self.volatile_config['no_actions'])
             for action in actions:
                 if action in self.actions:
                     self.actions.remove(action)
 
+        # Keep? This is for saving the volatile config in the dump_config
+        self._config['volatile_config'] = self.volatile_config
+
+        self.options = options
+        self.args = args
+        return (self.options, self.args)
+
 
 # __main__ {{{1
 if __name__ == '__main__':
     pass
--- a/testing/mozharness/mozharness/mozilla/building/buildbase.py
+++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py
@@ -361,18 +361,17 @@ class BuildOptionParser(object):
         'api-15': 'builds/releng_sub_%s_configs/%s_api_15.py',
         'api-15-debug': 'builds/releng_sub_%s_configs/%s_api_15_debug.py',
         'api-15-gradle': 'builds/releng_sub_%s_configs/%s_api_15_gradle.py',
         'x86': 'builds/releng_sub_%s_configs/%s_x86.py',
         'api-15-partner-sample1': 'builds/releng_sub_%s_configs/%s_api_15_partner_sample1.py',
         'android-test': 'builds/releng_sub_%s_configs/%s_test.py',
         'android-checkstyle': 'builds/releng_sub_%s_configs/%s_checkstyle.py',
         'android-lint': 'builds/releng_sub_%s_configs/%s_lint.py',
-        'valgrind' : 'builds/releng_sub_%s_configs/%s_valgrind.py',
-        'artifact': 'builds/releng_sub_%s_configs/%s_artifact.py',
+        'valgrind' : 'builds/releng_sub_%s_configs/%s_valgrind.py'
     }
     build_pool_cfg_file = 'builds/build_pool_specifics.py'
     branch_cfg_file = 'builds/branch_specifics.py'
 
     @classmethod
     def _query_pltfrm_and_bits(cls, target_option, options):
         """ determine platform and bits
 
@@ -418,17 +417,23 @@ class BuildOptionParser(object):
                     cls.platform = 'android'
                     break
             else:
                 sys.exit(error_msg % (target_option, 'platform', '--platform',
                                       '"linux", "windows", "mac", or "android"'))
         return cls.bits, cls.platform
 
     @classmethod
-    def find_variant_cfg_path(cls, opt, value, parser):
+    def set_build_variant(cls, option, opt, value, parser):
+        """ sets an extra config file.
+
+        This is done by either taking an existing filepath or by taking a valid
+        shortname coupled with known platform/bits.
+        """
+
         valid_variant_cfg_path = None
         # first let's see if we were given a valid short-name
         if cls.build_variants.get(value):
             bits, pltfrm = cls._query_pltfrm_and_bits(opt, parser.values)
             prospective_cfg_path = cls.build_variants[value] % (pltfrm, bits)
         else:
             # this is either an incomplete path or an invalid key in
             # build_variants
@@ -441,27 +446,16 @@ class BuildOptionParser(object):
             # let's take our prospective_cfg_path and see if we can
             # determine an existing file
             for path in cls.config_file_search_path:
                 if os.path.exists(os.path.join(path, prospective_cfg_path)):
                     # success! we found a config file
                     valid_variant_cfg_path = os.path.join(path,
                                                           prospective_cfg_path)
                     break
-        return valid_variant_cfg_path, prospective_cfg_path
-
-    @classmethod
-    def set_build_variant(cls, option, opt, value, parser):
-        """ sets an extra config file.
-
-        This is done by either taking an existing filepath or by taking a valid
-        shortname coupled with known platform/bits.
-        """
-        valid_variant_cfg_path, prospective_cfg_path = cls.find_variant_cfg_path(
-            '--custom-build-variant-cfg', value, parser)
 
         if not valid_variant_cfg_path:
             # either the value was an indeterminable path or an invalid short
             # name
             sys.exit("Whoops!\n'--custom-build-variant' was passed but an "
                      "appropriate config file could not be determined. Tried "
                      "using: '%s' but it was either not:\n\t-- a valid "
                      "shortname: %s \n\t-- a valid path in %s \n\t-- a "
@@ -881,21 +875,16 @@ or run without that action (ie: --no-{ac
                 moz_sign_cmd = subprocess.list2cmdline(
                     self.query_moz_sign_cmd(formats=None)
                 )
                 # windows fix. This is passed to mach build env and we call that
                 # with python, not with bash so we need to fix the slashes here
                 env['MOZ_SIGN_CMD'] = moz_sign_cmd.replace('\\', '\\\\\\\\')
             else:
                 self.warning("signing disabled because MOZ_SIGNING_SERVERS is not set")
-        elif 'MOZ_SIGN_CMD' in env:
-            # Ensure that signing is truly disabled
-            # MOZ_SIGN_CMD may be defined by default in buildbot (see MozillaBuildFactory)
-            self.warning("Clearing MOZ_SIGN_CMD because we don't have config['enable_signing']")
-            del env['MOZ_SIGN_CMD']
 
         # to activate the right behaviour in mozonfigs while we transition
         if c.get('enable_release_promotion'):
             env['ENABLE_RELEASE_PROMOTION'] = "1"
             update_channel = c.get('update_channel', self.branch)
             self.info("Release promotion update channel: %s"
                       % (update_channel,))
             env["MOZ_UPDATE_CHANNEL"] = update_channel
--- a/testing/mozharness/mozharness/mozilla/testing/try_tools.py
+++ b/testing/mozharness/mozharness/mozilla/testing/try_tools.py
@@ -78,102 +78,68 @@ class TryToolsMixin(TransferMixin):
         msg = None
         if "try_message" in self.config and self.config["try_message"]:
             msg = self.config["try_message"]
         else:
             if self.buildbot_config['sourcestamp']['changes']:
                 msg = self.buildbot_config['sourcestamp']['changes'][-1]['comments']
 
             if msg is None or len(msg) == 1024:
-                # This commit message was potentially truncated or not available in
-                # buildbot_config (e.g. if running in TaskCluster), get the full message
+                # This commit message was potentially truncated, get the full message
                 # from hg.
                 props = self.buildbot_config['properties']
-                repo_url = 'https://hg.mozilla.org/%s/'
-                if 'revision' in props and 'repo_path' in props:
-                    rev = props['revision']
-                    repo_path = props['repo_path']
-                else:
-                    # In TaskCluster we have no buildbot props, rely on env vars instead
-                    rev = os.environ.get('GECKO_HEAD_REV')
-                    repo_path = self.config.get('branch')
-                if repo_path:
-                    repo_url = repo_url % repo_path
-                else:
-                    repo_url = os.environ.get('GECKO_HEAD_REPOSITORY',
-                                              repo_url % 'try')
-                if not repo_url.endswith('/'):
-                    repo_url += '/'
-
-                url = '{}json-pushes?changeset={}&full=1'.format(repo_url, rev)
+                rev = props['revision']
+                repo = props['repo_path']
+                url = 'https://hg.mozilla.org/%s/json-pushes?changeset=%s&full=1' % (repo, rev)
 
                 pushinfo = self.load_json_from_url(url)
                 for k, v in pushinfo.items():
                     if isinstance(v, dict) and 'changesets' in v:
                         msg = v['changesets'][-1]['desc']
 
             if not msg and 'try_syntax' in self.buildbot_config['properties']:
                 # If we don't find try syntax in the usual place, check for it in an
                 # alternate property available to tools using self-serve.
                 msg = self.buildbot_config['properties']['try_syntax']
-        if not msg:
-            self.warning('Try message not found.')
+
         return msg
 
-    def _extract_try_args(self, msg):
-        """ Returns a list of args from a try message, for parsing """
-        if not msg:
-            return None
-        all_try_args = None
-        for line in msg.splitlines():
-            if 'try: ' in line:
-                # Autoland adds quotes to try strings that will confuse our
-                # args later on.
-                if line.startswith('"') and line.endswith('"'):
-                    line = line[1:-1]
-                # Allow spaces inside of [filter expressions]
-                try_message = line.strip().split('try: ', 1)
-                all_try_args = re.findall(r'(?:\[.*?\]|\S)+', try_message[1])
-                break
-        if not all_try_args:
-            self.warning('Try syntax not found in: %s.' % msg )
-        return all_try_args
-
-    def try_message_has_flag(self, flag, message=None):
-        """
-        Returns True if --`flag` is present in message.
-        """
-        parser = argparse.ArgumentParser()
-        parser.add_argument('--' + flag, action='store_true')
-        message = message or self._extract_try_message()
-        if not message:
-            return False
-        msg_list = self._extract_try_args(message)
-        args, _ = parser.parse_known_args(msg_list)
-        return getattr(args, flag, False)
-
     @PostScriptAction('download-and-extract')
     def set_extra_try_arguments(self, action, success=None):
         """Finds a commit message and parses it for extra arguments to pass to the test
         harness command line and test paths used to filter manifests.
 
         Extracting arguments from a commit message taken directly from the try_parser.
         """
         if (not self.buildbot_config or 'properties' not in self.buildbot_config or
                 self.buildbot_config['properties'].get('branch') != 'try'):
             return
 
         msg = self._extract_try_message()
         if not msg:
             return
 
-        all_try_args = self._extract_try_args(msg)
+        all_try_args = None
+        for line in msg.splitlines():
+            if 'try: ' in line:
+                # Autoland adds quotes to try strings that will confuse our
+                # args later on.
+                if line.startswith('"') and line.endswith('"'):
+                    line = line[1:-1]
+                # Allow spaces inside of [filter expressions]
+                try_message = line.strip().split('try: ', 1)
+                all_try_args = re.findall(r'(?:\[.*?\]|\S)+', try_message[1])
+                break
+
         if not all_try_args:
+            self.warning('Try syntax not found in buildbot config, unable to append '
+                         'arguments from try.')
             return
 
+
         parser = argparse.ArgumentParser(
             description=('Parse an additional subset of arguments passed to try syntax'
                          ' and forward them to the underlying test harness command.'))
 
         label_dict = {}
         def label_from_val(val):
             if val in label_dict:
                 return label_dict[val]
--- a/testing/mozharness/scripts/fx_desktop_build.py
+++ b/testing/mozharness/scripts/fx_desktop_build.py
@@ -8,34 +8,30 @@
 
 script harness to build nightly firefox within Mozilla's build environment
 and developer machines alike
 
 author: Jordan Lund
 
 """
 
-import copy
-import pprint
 import sys
 import os
 
 # load modules from parent dir
 sys.path.insert(1, os.path.dirname(sys.path[0]))
 
 from mozharness.mozilla.building.buildbase import BUILD_BASE_CONFIG_OPTIONS, \
-    BuildingConfig, BuildOptionParser, BuildScript
-from mozharness.base.config import parse_config_file
-from mozharness.mozilla.testing.try_tools import TryToolsMixin, try_config_options
+    BuildingConfig, BuildScript
 
 
-class FxDesktopBuild(BuildScript, TryToolsMixin, object):
+class FxDesktopBuild(BuildScript, object):
     def __init__(self):
         buildscript_kwargs = {
-            'config_options': BUILD_BASE_CONFIG_OPTIONS + copy.deepcopy(try_config_options),
+            'config_options': BUILD_BASE_CONFIG_OPTIONS,
             'all_actions': [
                 'get-secrets',
                 'clobber',
                 'clone-tools',
                 'checkout-sources',
                 'setup-mock',
                 'build',
                 'upload-files',  # upload from BB to TC
@@ -119,54 +115,18 @@ class FxDesktopBuild(BuildScript, TryToo
                     platform_for_log_url += '-pgo'
                 # postrun.py uses stage_platform buildbot prop as part of the log url
                 self.set_buildbot_property('stage_platform',
                                            platform_for_log_url,
                                            write_to_file=True)
             else:
                 self.fatal("'stage_platform' not determined and is required in your config")
 
-            if self.try_message_has_flag('artifact'):
-                self.info('Artifact build requested in try syntax.')
-                self._update_build_variant(rw_config)
 
     # helpers
-    def _update_build_variant(self, rw_config, variant='artifact'):
-        """ Intended for use in _pre_config_lock """
-        c = self.config
-        variant_cfg_path, _ = BuildOptionParser.find_variant_cfg_path(
-            '--custom-build-variant-cfg',
-            variant,
-            rw_config.config_parser
-        )
-        if not variant_cfg_path:
-            self.fatal('Could not find appropriate config file for variant %s' % variant)
-        # Update other parts of config to keep dump-config accurate
-        # Only dump-config is affected because most config info is set during
-        # initial parsing
-        variant_cfg_dict = parse_config_file(variant_cfg_path)
-        rw_config.all_cfg_files_and_dicts.append((variant_cfg_path, variant_cfg_dict))
-        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)
-        # 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
-        # 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):
         if self.abs_dirs:
             return self.abs_dirs
         c = self.config
         abs_dirs = super(FxDesktopBuild, self).query_abs_dirs()
         if not c.get('app_ini_path'):
             self.fatal('"app_ini_path" is needed in your config for this '
@@ -198,15 +158,12 @@ class FxDesktopBuild(BuildScript, TryToo
 
         # Actions {{{2
         # read_buildbot_config in BuildingMixin
         # clobber in BuildingMixin -> PurgeMixin
         # if Linux config:
         # reset_mock in BuildingMixing -> MockMixin
         # setup_mock in BuildingMixing (overrides MockMixin.mock_setup)
 
-    def set_extra_try_arguments(self, action, success=None):
-        """ Override unneeded method from TryToolsMixin """
-        pass
 
 if __name__ == '__main__':
     fx_desktop_build = FxDesktopBuild()
     fx_desktop_build.run_and_exit()