[FIX] runbot, runbot_cla: clearly notify pending builds

Avoids confusing users with an all-green CLA mark for a build
that is only starting.

+ Do CLA check as first step, no need to wait
This commit is contained in:
Olivier Dony 2015-02-11 13:21:30 +01:00
parent d65b59f47b
commit 2486921a60
2 changed files with 7 additions and 3 deletions

View File

@ -739,7 +739,9 @@ class runbot_build(osv.osv):
runbot_domain = self.pool['runbot.repo'].domain(cr, uid)
for build in self.browse(cr, uid, ids, context=context):
desc = "runbot build %s" % (build.dest,)
if build.state in ('running', 'done'):
if build.state == 'testing':
state = 'pending'
elif build.state in ('running', 'done'):
state = 'error'
if build.result == 'ok':
state = 'success'
@ -759,6 +761,7 @@ class runbot_build(osv.osv):
def job_10_test_base(self, cr, uid, build, lock_path, log_path):
build._log('test_base', 'Start test base module')
build.github_status()
# checkout source
build.checkout()
# run base test

View File

@ -2,7 +2,6 @@
import glob
import logging
import os
import re
import openerp
@ -12,7 +11,9 @@ _logger = logging.getLogger(__name__)
class runbot_build(openerp.models.Model):
_inherit = "runbot.build"
def job_15_check_cla(self, cr, uid, build, lock_path, log_path):
def job_05_check_cla(self, cr, uid, build, lock_path, log_path):
# notify pending build - avoid confusing users by saying it's all green
build.github_status()
cla_glob = glob.glob(build.path("doc/cla/*/*.md"))
if cla_glob:
cla = ''.join(open(f).read() for f in cla_glob)