Bug 1277595 - Generate balrog properties as a taskcluster artifact, r=jlund
MozReview-Commit-ID: Bzx5yfVfZcw
--- a/testing/mozharness/mozharness/mozilla/building/buildbase.py
+++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py
@@ -2035,16 +2035,25 @@ or run without that action (ie: --no-{ac
""" submit balrog update steps. """
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)
+
+ # generate balrog props as artifacts
+ if self.config.get('taskcluster_nightly'):
+ env = self.query_mach_build_env(multiLocale=False)
+ props_path = os.path.join(env["UPLOAD_PATH"],
+ 'balrog_props.json')
+ self.generate_balrog_props(props_path)
+ return
+
if not self.config.get("balrog_servers"):
self.fatal("balrog_servers not set; skipping balrog submission.")
return
if self.submit_balrog_updates():
# set the build to orange so it is at least caught
self.return_code = self.worst_level(
EXIT_STATUS_DICT[TBPL_WARNING], self.return_code,
--- a/testing/mozharness/mozharness/mozilla/updates/balrog.py
+++ b/testing/mozharness/mozharness/mozilla/updates/balrog.py
@@ -9,16 +9,37 @@ class BalrogMixin(object):
@staticmethod
def _query_balrog_username(server_config, product=None):
username = server_config["balrog_usernames"].get(product)
if username:
return username
else:
raise KeyError("Couldn't find balrog username.")
+ def generate_balrog_props(self, props_path):
+ self.set_buildbot_property(
+ "hashType", self.config.get("hash_type", "sha512"), write_to_file=True
+ )
+
+ if self.buildbot_config and "properties" in self.buildbot_config:
+ buildbot_properties = self.buildbot_config["properties"].items()
+ else:
+ buildbot_properties = []
+
+ balrog_props = dict(properties=dict(chain(
+ buildbot_properties,
+ self.buildbot_properties.items(),
+ )))
+ if self.config.get('balrog_platform'):
+ balrog_props["properties"]["platform"] = self.config['balrog_platform']
+ if "branch" not in balrog_props["properties"]:
+ balrog_props["properties"]["branch"] = self.branch
+
+ self.dump_config(props_path, balrog_props)
+
def submit_balrog_updates(self, release_type="nightly", product=None):
c = self.config
dirs = self.query_abs_dirs()
if self.buildbot_config and "properties" in self.buildbot_config:
product = self.buildbot_config["properties"]["product"]
if product is None:
@@ -26,35 +47,19 @@ class BalrogMixin(object):
props_path = os.path.join(dirs["base_work_dir"], "balrog_props.json")
credentials_file = os.path.join(
dirs["base_work_dir"], c["balrog_credentials_file"]
)
submitter_script = os.path.join(
dirs["abs_tools_dir"], "scripts", "updates", "balrog-submitter.py"
)
- self.set_buildbot_property(
- "hashType", c.get("hash_type", "sha512"), write_to_file=True
- )
-
- if self.buildbot_config and "properties" in self.buildbot_config:
- buildbot_properties = self.buildbot_config["properties"].items()
- else:
- buildbot_properties = []
- balrog_props = dict(properties=dict(chain(
- buildbot_properties,
- self.buildbot_properties.items(),
- )))
- if self.config.get('balrog_platform'):
- balrog_props["properties"]["platform"] = self.config['balrog_platform']
- if "branch" not in balrog_props["properties"]:
- balrog_props["properties"]["branch"] = self.query_branch()
+ self.generate_balrog_props(props_path)
- self.dump_config(props_path, balrog_props)
cmd = [
self.query_exe("python"),
submitter_script,
"--build-properties", props_path,
"-t", release_type,
"--credentials-file", credentials_file,
]
if self._log_level_at_least(INFO):