[FIX] runbot: update github status with correct state

Since d7c7e54 the github status is send in job_29. At this moment, the
state of the build is still 'testing'. For that reason, the github
status is set to 'pending'.

With this commit, once a result is available, the github status is
updated with the right value even if the build state is 'testing'.
This commit is contained in:
Christophe Monniez 2019-01-24 11:16:51 +01:00
parent d7c7e547d4
commit eb7f5de218

View File

@ -741,13 +741,13 @@ class runbot_build(models.Model):
state = 'pending'
elif build.state in ('running', 'done'):
state = 'error'
if build.result == 'ok':
state = 'success'
if build.result == 'ko':
state = 'failure'
desc += " (runtime %ss)" % (build.job_time,)
else:
continue
if build.result == 'ok':
state = 'success'
if build.result == 'ko':
state = 'failure'
status = {
"state": state,
"target_url": "http://%s/runbot/build/%s" % (runbot_domain, build.id),