mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[IMP] runbot: add freeze list feature
This commit is contained in:
parent
788114776b
commit
16fa0e1ad8
@ -105,7 +105,7 @@ class Runbot(Controller):
|
||||
'/runbot',
|
||||
'/runbot/<model("runbot.project"):project>',
|
||||
'/runbot/<model("runbot.project"):project>/search/<search>'], website=True, auth='public', type='http')
|
||||
def bundles(self, project=None, search='', projects=False, refresh=False, **kwargs):
|
||||
def bundles(self, project=None, search='', projects=False, refresh=False, for_next_freeze=False, limit=40, **kwargs):
|
||||
search = search if len(search) < 60 else search[:60]
|
||||
env = request.env
|
||||
categories = env['runbot.category'].search([])
|
||||
@ -131,6 +131,9 @@ class Runbot(Controller):
|
||||
elif filter_mode == 'nosticky':
|
||||
domain.append(('sticky', '=', False))
|
||||
|
||||
if for_next_freeze:
|
||||
domain.append(('for_next_freeze', '=', True))
|
||||
|
||||
if search:
|
||||
search_domains = []
|
||||
pr_numbers = []
|
||||
@ -152,7 +155,7 @@ class Runbot(Controller):
|
||||
case when "runbot_bundle".sticky then "runbot_bundle".version_number end collate "C" desc,
|
||||
"runbot_bundle".last_batch desc
|
||||
"""
|
||||
query.limit=40
|
||||
query.limit = min(limit, 200)
|
||||
bundles = env['runbot.bundle'].browse(query)
|
||||
|
||||
category_id = int(request.httprequest.cookies.get('category') or 0) or request.env['ir.model.data']._xmlid_to_res_id('runbot.default_category')
|
||||
|
@ -234,6 +234,10 @@ class Branch(models.Model):
|
||||
if self.draft:
|
||||
self.reviewers = '' # reset reviewers on draft
|
||||
|
||||
if self.was_alive and not self.alive and self.bundle_id.for_next_freeze:
|
||||
if not any(branch.alive and branch.is_pr for branch in self.bundle_id.branch_ids):
|
||||
self.bundle_id.for_next_freeze = False
|
||||
|
||||
if (not self.draft and was_draft) or (self.alive and not was_alive) or (self.target_branch_name != init_target_branch_name and self.alive):
|
||||
self.bundle_id._force()
|
||||
|
||||
|
@ -52,6 +52,10 @@ class Bundle(models.Model):
|
||||
file_limit = fields.Integer("File limit")
|
||||
disable_codeowner = fields.Boolean("Disable codeowners", tracking=True)
|
||||
|
||||
# extra_info
|
||||
for_next_freeze = fields.Boolean('Should be in next freeze')
|
||||
|
||||
|
||||
@api.depends('name')
|
||||
def _compute_host_id(self):
|
||||
assigned_only = None
|
||||
|
@ -56,6 +56,7 @@
|
||||
<field name="commit_limit"/>
|
||||
<field name="file_limit"/>
|
||||
<field name="disable_codeowner"/>
|
||||
<field name="for_next_freeze"/>
|
||||
<field name="branch_ids">
|
||||
<tree>
|
||||
<field name="dname"/>
|
||||
|
Loading…
Reference in New Issue
Block a user