[FIX] notifies github for duplicate builds

This commit is contained in:
Gery Debongnie 2014-07-18 13:52:17 +02:00
parent 7c5e2c8c68
commit a63fa03dd2

View File

@ -630,15 +630,18 @@ class runbot_build(osv.osv):
def github_status(self, cr, uid, ids, context=None): def github_status(self, cr, uid, ids, context=None):
"""Notify github of failed/successful builds""" """Notify github of failed/successful builds"""
for build in self.browse(cr, uid, ids, context=context): for build in self.browse(cr, uid, ids, context=context):
if build.state != 'duplicate' and build.duplicate_id:
self.github_status(cr, uid, [build.duplicate_id.id], context=context)
desc = "runbot build %s" % (build.dest,) desc = "runbot build %s" % (build.dest,)
if build.state == 'testing': real_build = build.duplicate_id if build.state == 'duplicate' else build
if real_build.state == 'testing':
state = 'pending' state = 'pending'
elif build.state in ('running', 'done'): elif real_build.state in ('running', 'done'):
state = { state = {
'ok': 'success', 'ok': 'success',
'killed': 'error', 'killed': 'error',
}.get(build.result, 'failure') }.get(real_build.result, 'failure')
desc += " (runtime %ss)" % (build.job_time,) desc += " (runtime %ss)" % (real_build.job_time,)
else: else:
continue continue
@ -1115,18 +1118,12 @@ LABELS = {
# kill ` ps faux | grep ./static | awk '{print $2}' ` # kill ` ps faux | grep ./static | awk '{print $2}' `
# ps faux| grep Cron | grep -- '-all' | awk '{print $2}' | xargs kill # ps faux| grep Cron | grep -- '-all' | awk '{print $2}' | xargs kill
# psql -l | grep " 000" | awk '{print $1}' | xargs -n1 dropdb # psql -l | grep " 000" | awk '{print $1}' | xargs -n1 dropdb
# TODO
# - cannibal branch
# - commit/pull more info # - commit/pull more info
# - v6 support # - v6 support
# - host field in build # - host field in build
# - unlink build to remove ir_logging entires # ondelete=cascade # - unlink build to remove ir_logging entires # ondelete=cascade
# - gc either build or only old ir_logging # - gc either build or only old ir_logging
# - if nginx server logfiles via each virtual server or map /runbot/static to root # - if nginx server logfiles via each virtual server or map /runbot/static to root
# list process group pids
# vim: # vim: