mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[IMP] runbot_merge: show heads on stagings
Stagings have a "statuses" field which was shown but useless (as it's a binary), they also have a "heads" field which only provides a mapping of repository names to commits. This change provides the staging heads as a commits m2m. Fixes #178
This commit is contained in:
parent
1981bd68e6
commit
e40e814b90
@ -1265,6 +1265,7 @@ class Stagings(models.Model):
|
|||||||
|
|
||||||
# seems simpler than adding yet another indirection through a model
|
# seems simpler than adding yet another indirection through a model
|
||||||
heads = fields.Char(required=True, help="JSON-encoded map of heads, one per repo in the project")
|
heads = fields.Char(required=True, help="JSON-encoded map of heads, one per repo in the project")
|
||||||
|
head_ids = fields.Many2many('runbot_merge.commit', compute='_compute_statuses')
|
||||||
|
|
||||||
statuses = fields.Binary(compute='_compute_statuses')
|
statuses = fields.Binary(compute='_compute_statuses')
|
||||||
|
|
||||||
@ -1279,7 +1280,7 @@ class Stagings(models.Model):
|
|||||||
head: repo for repo, head in json.loads(st.heads).items()
|
head: repo for repo, head in json.loads(st.heads).items()
|
||||||
if not repo.endswith('^')
|
if not repo.endswith('^')
|
||||||
}
|
}
|
||||||
commits = Commits.search([('sha', 'in', list(heads.keys()))])
|
commits = st.head_ids = Commits.search([('sha', 'in', list(heads.keys()))])
|
||||||
st.statuses = [
|
st.statuses = [
|
||||||
(
|
(
|
||||||
heads[commit.sha],
|
heads[commit.sha],
|
||||||
|
@ -201,11 +201,18 @@
|
|||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field name="staged_at"/>
|
<field name="staged_at"/>
|
||||||
<field name="statuses"/>
|
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group string="Heads">
|
||||||
<field name="batch_ids" colspan="4">
|
<field name="head_ids" colspan="4" nolabel="1">
|
||||||
|
<tree>
|
||||||
|
<field name="sha"/>
|
||||||
|
<field name="statuses"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</group>
|
||||||
|
<group string="Batches">
|
||||||
|
<field name="batch_ids" colspan="4" nolabel="1">
|
||||||
<tree>
|
<tree>
|
||||||
<field name="prs"/>
|
<field name="prs"/>
|
||||||
</tree>
|
</tree>
|
||||||
|
Loading…
Reference in New Issue
Block a user