mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 15:35:46 +07:00
[FIX] make the 'rebuild' functionality work
if it is a skipped build, it will be put back in pending state, with a high sequence number. if it is a complete build, it will be duplicated
This commit is contained in:
parent
b8b782b831
commit
93e875ed20
@ -388,7 +388,7 @@ class runbot_branch(osv.osv):
|
||||
|
||||
class runbot_build(osv.osv):
|
||||
_name = "runbot.build"
|
||||
_order = 'sequence desc'
|
||||
_order = 'id desc'
|
||||
|
||||
def _get_dest(self, cr, uid, ids, field_name, arg, context=None):
|
||||
r = {}
|
||||
@ -705,8 +705,8 @@ class runbot_build(osv.osv):
|
||||
for build in self.browse(cr, uid, ids, context=context):
|
||||
max_id = self.search(cr, uid, [('repo_id','=',build.repo_id.id)], order='id desc', limit=1)[0]
|
||||
# Force it now
|
||||
if build.state in ['pending']:
|
||||
build.write({ 'sequence':max_id })
|
||||
if build.state == 'done' and build.result == 'skipped':
|
||||
build.write({'state': 'pending', 'sequence':max_id, 'result': '' })
|
||||
# or duplicate it
|
||||
elif build.state in ['running','done']:
|
||||
d = {
|
||||
|
@ -222,8 +222,8 @@
|
||||
<a t-attf-href="https://#{bu.repo_id.base}/commit/#{bu.name}" class="btn btn-default"><i class="fa fa-github"/></a>
|
||||
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-cog"/><span class="caret"></span></button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li t-if="bu.state=='pending'">
|
||||
<a t-attf-href="/runbot/build/{{bu.id}}/force">Build now <i class="fa fa-level-up"> </i></a>
|
||||
<li t-if="bu.result=='skipped'">
|
||||
<a t-attf-href="/runbot/build/{{bu.id}}/force">Force Build<i class="fa fa-level-up"> </i></a>
|
||||
</li>
|
||||
<t t-if="bu.state=='running'">
|
||||
<li><a t-attf-href="http://{{bu.domain}}/?db={{bu.dest}}-all">Connect all <i class="fa fa-sign-in"></i></a></li>
|
||||
@ -233,11 +233,11 @@
|
||||
<li t-if="bu.state in ['done','running'] and bu_index==0">
|
||||
<a t-attf-href="/runbot/build/#{bu.id}/force">Rebuild <i class="fa fa-refresh"/></a>
|
||||
</li>
|
||||
<li t-if="bu.state!='testing'" class="divider"></li>
|
||||
<li t-if="bu.state!='testing' and bu.state!='pending'" class="divider"></li>
|
||||
<li><a t-attf-href="/runbot/build/{{bu.id}}">Logs <i class="fa fa-file-text-o"/></a></li>
|
||||
<li><a t-attf-href="/runbot/static/build/#{bu.dest}/logs/job_10_test_base.txt">Full base logs <i class="fa fa-file-text-o"/></a></li>
|
||||
<li><a t-attf-href="/runbot/static/build/#{bu.dest}/logs/job_20_test_all.txt">Full all logs <i class="fa fa-file-text-o"/></a></li>
|
||||
<li class="divider"></li>
|
||||
<li t-if="bu.state!='pending'" class="divider"></li>
|
||||
<li><a t-attf-href="{{bu.branch_id.branch_url}}">Branch or pull <i class="fa fa-github"/></a></li>
|
||||
<li><a t-attf-href="https://{{bu.repo_id.base}}/commit/{{bu.name}}">Commit <i class="fa fa-github"/></a></li>
|
||||
<li><a t-attf-href="https://{{bu.repo_id.base}}/compare/{{bu.branch_id.branch_name}}">Compare <i class="fa fa-github"/></a></li>
|
||||
|
Loading…
Reference in New Issue
Block a user