in sync/landing.py [0:0]
def push(landing: LandingSync) -> None:
"""Push from git_work_gecko to inbound."""
success = False
landing_tree = env.config["gecko"]["landing"]
old_head = None
err = None
assert landing.bug is not None
while not success:
try:
logger.info("Rebasing onto %s" % landing.gecko_integration_branch())
landing.gecko_rebase(landing.gecko_integration_branch())
except AbortError as e:
logger.error(e)
env.bz.comment(landing.bug, str(e))
raise e
if old_head == landing.gecko_commits.head.sha1:
err = ("Landing push failed and rebase didn't change head:%s" %
("\n%s" % err if err else ""))
logger.error(err)
env.bz.comment(landing.bug, err)
raise AbortError(err)
old_head = landing.gecko_commits.head.sha1
if not tree.is_open(landing_tree):
logger.info("%s is closed" % landing_tree)
raise RetryableError(AbortError("Tree is closed"))
try:
logger.info("Pushing landing")
push_info = landing.git_gecko.remotes.mozilla.push(
"{}:{}".format(landing.branch_name,
landing.gecko_integration_branch().split("/", 1)[1])
)
for item in push_info:
if item.flags & item.ERROR:
raise AbortError(item.summary)
except git.GitCommandError as e:
changes = landing.git_gecko.remotes.mozilla.fetch()
err = "Pushing update to remote failed:\n%s" % e
if not changes:
logger.error(err)
env.bz.comment(landing.bug, err)
raise AbortError(err)
else:
success = True