Bug 1330668 - Generate balrog_props.json for l10n repacks. r=aki

Needed to support beetmover and balrog.

ToDo: attribute this cset to changes on date.

MozReview-Commit-ID: 430QCIe7tM7

--HG--
extra : rebase_source : c23b9311f0b897884aac7aafa9a84463655957c5
This commit is contained in:
Justin Wood 2017-01-12 17:14:25 -05:00
parent 141214294c
commit 59509b566a
3 changed files with 59 additions and 30 deletions

View File

@ -1,4 +1,5 @@
config = {
"stage_platform": "android-api-15",
"locales_file": "src/mobile/android/locales/all-locales",
"tools_repo": "https://hg.mozilla.org/build/tools",
"mozconfig": "src/mobile/android/config/mozconfigs/android-api-15/l10n-nightly",

View File

@ -922,9 +922,6 @@ class DesktopSingleLocale(LocalesMixin, ReleaseMixin, MockMixin, BuildbotMixin,
def submit_to_balrog(self):
"""submit to balrog"""
if not self.config.get("balrog_servers"):
self.info("balrog_servers not set; skipping balrog submission.")
return
self.info("Reading buildbot build properties...")
self.read_buildbot_config()
# get platform, appName and hashType from configuration
@ -944,9 +941,23 @@ class DesktopSingleLocale(LocalesMixin, ReleaseMixin, MockMixin, BuildbotMixin,
self.set_buildbot_property("buildid", self._query_buildid())
self.set_buildbot_property("appVersion", self.query_version())
# submit complete mar to balrog
# clean up buildbot_properties
self._map(self.submit_repack_to_balrog, self.query_locales())
# YAY
def balrog_props_wrapper(locale):
env = self._query_upload_env()
props_path = os.path.join(env["UPLOAD_PATH"], locale,
'balrog_props.json')
self.generate_balrog_props(props_path)
return SUCCESS
if self.config.get('taskcluster_nightly'):
self._map(balrog_props_wrapper, self.query_locales())
else:
if not self.config.get("balrog_servers"):
self.info("balrog_servers not set; skipping balrog submission.")
return
# submit complete mar to balrog
# clean up buildbot_properties
self._map(self.submit_repack_to_balrog, self.query_locales())
def submit_repack_to_balrog(self, locale):
"""submit a single locale to balrog"""

View File

@ -718,27 +718,39 @@ class MobileSingleLocale(MockMixin, LocalesMixin, ReleaseMixin,
self.info("Not a nightly or release build, skipping balrog submission.")
return
if not self.config.get("balrog_servers"):
self.info("balrog_servers not set; skipping balrog submission.")
return
self.checkout_tools()
dirs = self.query_abs_dirs()
locales = self.query_locales()
balrogReady = True
for locale in locales:
apk_url = self.query_upload_url(locale)
if not apk_url:
self.add_failure(locale, message="Failed to detect %s url in make upload!" % (locale))
balrogReady = False
continue
if not balrogReady:
return self.fatal(message="Not all repacks successful, abort without submitting to balrog")
if not self.config.get('taskcluster_nightly'):
balrogReady = True
for locale in locales:
apk_url = self.query_upload_url(locale)
if not apk_url:
self.add_failure(locale, message="Failed to detect %s url in make upload!" % (locale))
balrogReady = False
continue
if not balrogReady:
return self.fatal(message="Not all repacks successful, abort without submitting to balrog")
env = self.query_upload_env()
for locale in locales:
apkfile = self.query_apkfile_path(locale)
apk_url = self.query_upload_url(locale)
if self.config.get('taskcluster_nightly'):
# Taskcluster needs stage_platform
self.set_buildbot_property("stage_platform",
self.config.get("stage_platform"))
self.set_buildbot_property("branch", self.config.get("branch"))
else:
apk_url = self.query_upload_url(locale)
self.set_buildbot_property("completeMarUrl", apk_url)
# The Balrog submitter translates this platform into a build target
# via https://github.com/mozilla/build-tools/blob/master/lib/python/release/platforms.py#L23
self.set_buildbot_property(
"platform",
self.buildbot_config["properties"]["platform"])
#TODO: Is there a better way to get this?
# Set other necessary properties for Balrog submission. None need to
# be passed back to buildbot, so we won't write them to the properties
@ -746,26 +758,31 @@ class MobileSingleLocale(MockMixin, LocalesMixin, ReleaseMixin,
self.set_buildbot_property("locale", locale)
self.set_buildbot_property("appVersion", self.query_version())
# The Balrog submitter translates this platform into a build target
# via https://github.com/mozilla/build-tools/blob/master/lib/python/release/platforms.py#L23
self.set_buildbot_property("platform", self.buildbot_config["properties"]["platform"])
#TODO: Is there a better way to get this?
self.set_buildbot_property("appName", "Fennec")
# TODO: don't hardcode
self.set_buildbot_property("hashType", "sha512")
self.set_buildbot_property("completeMarSize", self.query_filesize(apkfile))
self.set_buildbot_property("completeMarHash", self.query_sha512sum(apkfile))
self.set_buildbot_property("completeMarUrl", apk_url)
self.set_buildbot_property("isOSUpdate", False)
self.set_buildbot_property("buildid", self.query_buildid())
if self.query_is_nightly():
self.submit_balrog_updates(release_type="nightly")
if self.config.get('taskcluster_nightly'):
props_path = os.path.join(env["UPLOAD_PATH"], locale,
'balrog_props.json')
self.generate_balrog_props(props_path)
else:
self.submit_balrog_updates(release_type="release")
if not self.query_is_nightly():
self.submit_balrog_release_pusher(dirs)
if not self.config.get("balrog_servers"):
self.info("balrog_servers not set; skipping balrog submission.")
return
if self.query_is_nightly():
self.submit_balrog_updates(release_type="nightly")
else:
self.submit_balrog_updates(release_type="release")
if not self.query_is_nightly():
self.submit_balrog_release_pusher(dirs)
# main {{{1
if __name__ == '__main__':