diff --git a/runbot/controllers/frontend.py b/runbot/controllers/frontend.py index 601f98d8..8969be69 100644 --- a/runbot/controllers/frontend.py +++ b/runbot/controllers/frontend.py @@ -105,7 +105,7 @@ class Runbot(Controller): '/runbot', '/runbot/', '/runbot//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') diff --git a/runbot/models/branch.py b/runbot/models/branch.py index 66205ea8..d8d130d0 100644 --- a/runbot/models/branch.py +++ b/runbot/models/branch.py @@ -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() diff --git a/runbot/models/bundle.py b/runbot/models/bundle.py index 07767a20..f8e5ceaf 100644 --- a/runbot/models/bundle.py +++ b/runbot/models/bundle.py @@ -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 diff --git a/runbot/views/bundle_views.xml b/runbot/views/bundle_views.xml index 95aa886b..a0adf3d2 100644 --- a/runbot/views/bundle_views.xml +++ b/runbot/views/bundle_views.xml @@ -56,6 +56,7 @@ +