From 3c3100adfe8e8269936bf5589ac57c059766e1bc Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 25 Apr 2024 12:04:26 +0200 Subject: [PATCH] [IMP] runbot_merge: cleanup PR backend Shove a bunch of stuff in notebook tabs, add a few affordances (e.g. github and frontend links, links from m2m), surface a few missing fields. Hopefully makes the backend form both easier to navigate and easier to administrate from. --- runbot_merge/models/pull_requests.py | 6 ++ runbot_merge/views/batch.xml | 3 + runbot_merge/views/mergebot.xml | 149 ++++++++++++++++++--------- 3 files changed, 108 insertions(+), 50 deletions(-) diff --git a/runbot_merge/models/pull_requests.py b/runbot_merge/models/pull_requests.py index 3e706268..90da29f6 100644 --- a/runbot_merge/models/pull_requests.py +++ b/runbot_merge/models/pull_requests.py @@ -393,12 +393,18 @@ class PullRequests(models.Model): batch_id = fields.Many2one('runbot_merge.batch', index=True) staging_id = fields.Many2one('runbot_merge.stagings', compute='_compute_staging', store=True) + staging_ids = fields.Many2many('runbot_merge.stagings', string="Stagings", compute='_compute_stagings', context={"active_test": False}) @api.depends('batch_id.staging_ids.active') def _compute_staging(self): for p in self: p.staging_id = p.batch_id.staging_ids.filtered('active') + @api.depends('batch_id.staging_ids') + def _compute_stagings(self): + for p in self: + p.staging_ids = p.batch_id.staging_ids + commits_map = fields.Char(help="JSON-encoded mapping of PR commits to actually integrated commits. The integration head (either a merge commit or the PR's topmost) is mapped from the 'empty' pr commit (the key is an empty string, because you can't put a null key in json maps).", default='{}') link_warned = fields.Boolean( diff --git a/runbot_merge/views/batch.xml b/runbot_merge/views/batch.xml index 89fc3902..7d87d94f 100644 --- a/runbot_merge/views/batch.xml +++ b/runbot_merge/views/batch.xml @@ -23,6 +23,7 @@ +