mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[FIX] runbot cla fixes
This commit is contained in:
parent
06fa4526ed
commit
a0f8d18586
@ -852,7 +852,9 @@ class runbot_build(osv.osv):
|
|||||||
'branch_id': build.branch_id.id,
|
'branch_id': build.branch_id.id,
|
||||||
'name': build.name,
|
'name': build.name,
|
||||||
'author': build.author,
|
'author': build.author,
|
||||||
|
'author_email': build.author_email,
|
||||||
'committer': build.committer,
|
'committer': build.committer,
|
||||||
|
'committer_email': build.committer_email,
|
||||||
'subject': build.subject,
|
'subject': build.subject,
|
||||||
'modules': build.modules,
|
'modules': build.modules,
|
||||||
}
|
}
|
||||||
|
@ -404,7 +404,7 @@
|
|||||||
</t>
|
</t>
|
||||||
<br/>
|
<br/>
|
||||||
</t>
|
</t>
|
||||||
<small><t t-esc="bu['dest']"/></small><br/>
|
<small><t t-esc="bu['dest']"/> on <t t-esc="bu['host']"/></small><br/>
|
||||||
<t t-call="runbot.build_name"/>
|
<t t-call="runbot.build_name"/>
|
||||||
</td>
|
</td>
|
||||||
</t>
|
</t>
|
||||||
|
@ -13,25 +13,27 @@ class runbot_build(openerp.models.Model):
|
|||||||
_inherit = "runbot.build"
|
_inherit = "runbot.build"
|
||||||
|
|
||||||
def job_15_check_cla(self, cr, uid, build, lock_path, log_path):
|
def job_15_check_cla(self, cr, uid, build, lock_path, log_path):
|
||||||
cla_glob = build.path("doc/cla/*/*.md")
|
cla_glob = glob.glob(build.path("doc/cla/*/*.md"))
|
||||||
if cla_glob:
|
if cla_glob:
|
||||||
cla = ''.join(open(f).read() for f in glob.glob(cla_glob))
|
cla = ''.join(open(f).read() for f in cla_glob)
|
||||||
cla = cla.lower()
|
cla = cla.lower()
|
||||||
|
cla = cla.decode('utf-8')
|
||||||
mo = re.search('[^ <@]+@[^ @>]+', build.author_email or '')
|
mo = re.search('[^ <@]+@[^ @>]+', build.author_email or '')
|
||||||
state = "failure"
|
state = "failure"
|
||||||
if mo:
|
if mo:
|
||||||
email = mo.group(0).lower()
|
email = mo.group(0).lower()
|
||||||
if re.match('.*(odoo|openerp|tinyerp).com$',email):
|
if re.match('.*(odoo|openerp|tinyerp).com$',email):
|
||||||
state = "success"
|
state = "success"
|
||||||
if cla.find(mo.group(0).lower()) != -1:
|
if cla.find(email) != -1:
|
||||||
state = "success"
|
state = "success"
|
||||||
|
_logger.info('CLA build:%s email:%s result:%s', build.dest, email, state)
|
||||||
status = {
|
status = {
|
||||||
"state": state,
|
"state": state,
|
||||||
"target_url": "http://www.odoo.com/sign-cla",
|
"target_url": "http://www.odoo.com/sign-cla",
|
||||||
"description": "%s Odoo CLA signature check" % build.author,
|
"description": "%s Odoo CLA signature check" % build.author,
|
||||||
"context": "legal/cla"
|
"context": "legal/cla"
|
||||||
}
|
}
|
||||||
build._log('check_cla', 'Check CLA %s' % state)
|
build._log('check_cla', 'CLA %s' % state)
|
||||||
build.repo_id.github('/repos/:owner/:repo/statuses/%s' % build.name, status, ignore_errors=True)
|
build.repo_id.github('/repos/:owner/:repo/statuses/%s' % build.name, status, ignore_errors=True)
|
||||||
# 0 is myself, -1 is everybody else, -2 nothing
|
# 0 is myself, -1 is everybody else, -2 nothing
|
||||||
return -2
|
return -2
|
||||||
|
Loading…
Reference in New Issue
Block a user