From a692163f6eb46c91f34384f5f6513488c9554647 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 6 Jul 2023 14:23:09 +0200 Subject: [PATCH] [IMP] runbot_merge: add quick jump from stagings to PRs In the backend, the intermediate jump through batches is really not convenient (even if we kinda have to jump through batches *anyway*). Fixes #751 --- runbot_merge/models/pull_requests.py | 6 ++++++ runbot_merge/views/mergebot.xml | 16 ++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/runbot_merge/models/pull_requests.py b/runbot_merge/models/pull_requests.py index d9b63411..18294ea9 100644 --- a/runbot_merge/models/pull_requests.py +++ b/runbot_merge/models/pull_requests.py @@ -1758,6 +1758,7 @@ class Stagings(models.Model): 'runbot_merge.batch', 'staging_id', context={'active_test': False}, ) + pr_ids = fields.One2many('runbot_merge.pull_requests', compute='_compute_prs') state = fields.Selection([ ('success', 'Success'), ('failure', 'Failure'), @@ -1859,6 +1860,11 @@ class Stagings(models.Model): + datetime.timedelta(minutes=st.target.project_id.ci_timeout) ) + @api.depends('batch_ids.prs') + def _compute_prs(self): + for staging in self: + staging.pr_ids = staging.batch_ids.prs + def _validate(self): Commits = self.env['runbot_merge.commit'] for s in self: diff --git a/runbot_merge/views/mergebot.xml b/runbot_merge/views/mergebot.xml index 9cc3168b..ab5c8ee4 100644 --- a/runbot_merge/views/mergebot.xml +++ b/runbot_merge/views/mergebot.xml @@ -197,11 +197,19 @@ - - + + - + + + + + + + + + +