[IMP] runbot: send status earlier when the build fails

When a user checks the runbot frontend, the guess_result field is used
to change the color of the build state. But github is not notified of
this guessed result.

As a consequence, the runbot_merge is not aware the build is failed and
will continue to wait.

With this commit, as soon as the guess_result detects a failure, the
status is sent to github, that way, runbot_merge will stop waiting
sooner.
This commit is contained in:
Christophe Monniez 2019-02-19 15:41:49 +01:00
parent 2c7feffd5e
commit 602298330a

View File

@ -423,6 +423,11 @@ class runbot_build(models.Model):
build._logger('%s time exceded (%ss)', build.job, build.job_time)
build.write({'job_end': now()})
build._kill(result='killed')
else:
# failfast
if not build.result and build.guess_result in ('ko', 'warn'):
build.result = build.guess_result
build._github_status()
continue
build._logger('%s finished', build.job)
# schedule