Bug 1260415 - Schedule "partner repacks" builder r=coop a=release DONTBUILD
authorRail Aliiev <rail@mozilla.com>
Wed, 30 Mar 2016 10:51:29 -0400
changeset 291428 9e20e943e58b36cf8a63235a7ac3047be2318843
parent 291427 0b4e95151cc44d9dc3912a3027abe34e825567a4
child 291429 a57dc2f4a6f6441be0f7538edefb071ed55ffcf5
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscoop, release
bugs1260415
milestone48.0a1
Bug 1260415 - Schedule "partner repacks" builder r=coop a=release DONTBUILD Allow passing version and build_number via buildbot properties. This will allow us add buildbot builders without hardcoded parameters depending on release configs. MozReview-Commit-ID: 3zGiCJ5z36X
testing/mozharness/scripts/desktop_partner_repacks.py
--- a/testing/mozharness/scripts/desktop_partner_repacks.py
+++ b/testing/mozharness/scripts/desktop_partner_repacks.py
@@ -16,21 +16,16 @@ sys.path.insert(1, os.path.dirname(sys.p
 
 from mozharness.base.script import BaseScript
 from mozharness.mozilla.buildbot import BuildbotMixin
 from mozharness.mozilla.purge import PurgeMixin
 from mozharness.mozilla.release import ReleaseMixin
 from mozharness.base.python import VirtualenvMixin
 from mozharness.base.log import FATAL
 
-try:
-    import simplejson as json
-    assert json
-except ImportError:
-    import json
 
 # DesktopPartnerRepacks {{{1
 class DesktopPartnerRepacks(ReleaseMixin, BuildbotMixin, PurgeMixin,
                             BaseScript, VirtualenvMixin):
     """Manages desktop partner repacks"""
     actions = [
                 "clobber",
                 "create-virtualenv",
@@ -40,17 +35,17 @@ class DesktopPartnerRepacks(ReleaseMixin
                 "summary",
               ]
     config_options = [
         [["--version", "-v"], {
           "dest": "version",
           "help": "Version of Firefox to repack",
           }],
         [["--build-number", "-n"], {
-          "dest": "buildnumber",
+          "dest": "build_number",
           "help": "Build number of Firefox to repack",
           }],
         [["--platform"], {
           "dest": "platform",
           "help": "Platform to repack (e.g. linux64, macosx64, ...)",
           }],
         [["--partner", "-p"], {
           "dest": "partner",
@@ -98,36 +93,46 @@ class DesktopPartnerRepacks(ReleaseMixin
         #
 
         BaseScript.__init__(
             self,
             config_options=self.config_options,
             **buildscript_kwargs
         )
 
-        if 'version' not in self.config:
-            self.fatal("Version (-v) not supplied.")
-        if 'buildnumber' not in self.config:
-            self.fatal("Build number (-n) not supplied.")
         if 'repo_file' not in self.config:
             self.fatal("repo_file not supplied.")
         if 'repack_manifests_url' not in self.config:
             self.fatal("repack_manifests_url not supplied.")
 
     def _pre_config_lock(self, rw_config):
+        self.read_buildbot_config()
+        if not self.buildbot_config:
+            self.warning("Skipping buildbot properties overrides")
+        else:
+            props = self.buildbot_config["properties"]
+            for prop in ['version', 'build_number']:
+                if props.get(prop):
+                    self.info("Overriding %s with %s" % (prop, props[prop]))
+                    self.config[prop] = props.get(prop)
+
         if self.config.get('require_buildprops', False) is True:
-            self.read_buildbot_config()
             if not self.buildbot_config:
                 self.fatal("Unable to load properties from file: %s" % self.config.get('buildbot_json_path'))
             buildbot_props = self.buildbot_config.get('properties', {})
             partner = buildbot_props.get('partner')
             if not partner:
                 self.fatal("No partner specified in buildprops.json.")
             self.config['partner'] = partner
 
+        if 'version' not in self.config:
+            self.fatal("Version (-v) not supplied.")
+        if 'build_number' not in self.config:
+            self.fatal("Build number (-n) not supplied.")
+
     def query_abs_dirs(self):
         if self.abs_dirs:
             return self.abs_dirs
         abs_dirs = super(DesktopPartnerRepacks, self).query_abs_dirs()
         for directory in abs_dirs:
             value = abs_dirs[directory]
             abs_dirs[directory] = value
         dirs = {}
@@ -171,17 +176,17 @@ class DesktopPartnerRepacks(ReleaseMixin
                    good_statuses=[0],
                    sleeptime=5)
 
     def repack(self):
         """creates the repacks"""
         python = self.query_exe("python2.7")
         repack_cmd = [python, "partner-repacks.py",
                       "-v", self.config['version'],
-                      "-n", self.config['buildnumber']]
+                      "-n", self.config['build_number']]
         if self.config.get('platform'):
             repack_cmd.extend(["--platform", self.config['platform']])
         if self.config.get('partner'):
             repack_cmd.extend(["--partner", self.config['partner']])
         if self.config.get('s3cfg'):
             repack_cmd.extend(["--s3cfg", self.config['s3cfg']])
         if self.config.get('hgroot'):
             repack_cmd.extend(["--hgroot", self.config['hgroot']])