mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 15:35:46 +07:00
[FIX] runbot{,_cla}: really check CLA
c6ce286 moved cla check as first job (`05_check_cla`), but as the checkout of the working directory was done in `10_test_base`, the check was actually a no-op. Do the build environment init in `job_00_init`. Jobs that does not returning a pid to wait for are automatically rescheduled.
This commit is contained in:
parent
4e55f4f2f2
commit
a31109ffe7
@ -759,11 +759,15 @@ class runbot_build(osv.osv):
|
||||
_logger.debug("github updating status %s to %s", build.name, state)
|
||||
build.repo_id.github('/repos/:owner/:repo/statuses/%s' % build.name, status, ignore_errors=True)
|
||||
|
||||
def job_00_init(self, cr, uid, build, lock_path, log_path):
|
||||
build._log('init', 'Init build environment')
|
||||
# notify pending build - avoid confusing users by saying nothing
|
||||
build.github_status()
|
||||
build.checkout()
|
||||
return -2
|
||||
|
||||
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
|
||||
self.pg_createdb(cr, uid, "%s-base" % build.dest)
|
||||
cmd, mods = build.cmd()
|
||||
@ -911,6 +915,7 @@ class runbot_build(osv.osv):
|
||||
build.refresh()
|
||||
|
||||
# run job
|
||||
pid = None
|
||||
if build.state != 'done':
|
||||
build.logger('running %s', build.job)
|
||||
job_method = getattr(self,build.job)
|
||||
@ -921,6 +926,11 @@ class runbot_build(osv.osv):
|
||||
# needed to prevent losing pids if multiple jobs are started and one them raise an exception
|
||||
cr.commit()
|
||||
|
||||
if pid == -2:
|
||||
# no process to wait, directly call next job
|
||||
# FIXME find a better way that this recursive call
|
||||
build.schedule()
|
||||
|
||||
# cleanup only needed if it was not killed
|
||||
if build.state == 'done':
|
||||
build.cleanup()
|
||||
|
@ -12,8 +12,6 @@ class runbot_build(openerp.models.Model):
|
||||
_inherit = "runbot.build"
|
||||
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user