Skip to content

Commit 43aa6bd

Browse files
committed
[IMP] runbot: add kanban view and stages to build error page
WIP
1 parent e44ac41 commit 43aa6bd

File tree

5 files changed

+97
-2
lines changed

5 files changed

+97
-2
lines changed

runbot/__manifest__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
'data': [
1313
'templates/dockerfile.xml',
1414
'data/dockerfile_data.xml',
15+
'data/build_error_stage.xml',
1516
'data/build_parse.xml',
1617
'data/error_link.xml',
1718
'data/runbot_build_config_data.xml',

runbot/data/build_error_stage.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<odoo>
2+
<record model="runbot.build.error.stage" id="build_error_stage_new">
3+
<field name="name">New/Unsolved</field>
4+
<field name="sequence">5</field>
5+
<field name="description">New build error detected by the runbot platform</field>
6+
</record>
7+
<record model="runbot.build.error.stage" id="build_error_stage_solved">
8+
<field name="name">Solved</field>
9+
<field name="sequence">10</field>
10+
<field name="description">Issue should be solved. Will automatically move to the Done state after some time</field>
11+
</record>
12+
<record model="runbot.build.error.stage" id="build_error_stage_ignored">
13+
<field name="name">Ignored</field>
14+
<field name="sequence">15</field>
15+
<field name="description">Issue can be ignored, but should eventually be solved (for instance, test-tags)</field>
16+
<field name="fold">True</field>
17+
</record>
18+
<record model="runbot.build.error.stage" id="build_error_stage_done">
19+
<field name="name">Done</field>
20+
<field name="sequence">20</field>
21+
<field name="description">Issue is solved or dissapeared</field>
22+
<field name="fold">True</field>
23+
</record>
24+
</odoo>

runbot/models/build_error.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,18 @@ def _search(self, operator, value):
7676
return [(f'error_content_ids.{field_name}', operator, value)]
7777
return _search
7878

79+
80+
class BuildErrorStage(models.Model):
81+
_name = 'runbot.build.error.stage'
82+
_description = 'Build Error Stage'
83+
_order = 'sequence'
84+
85+
name = fields.Char(string='Stage Name', required=True, translate=True)
86+
description = fields.Text(string='Stage description', translate=True)
87+
sequence = fields.Integer('Sequence', default=1)
88+
fold = fields.Boolean(string='Folded in Kanban', default=False)
89+
90+
7991
class BuildError(models.Model):
8092
_name = "runbot.build.error"
8193
_description = "Build error"
@@ -91,6 +103,7 @@ class BuildError(models.Model):
91103
error_count = fields.Integer("Error count", store=True, compute='_compute_count')
92104
previous_error_id = fields.Many2one('runbot.build.error', string="Already seen error")
93105

106+
stage_id = fields.Many2one('runbot.build.error.stage', required=True, tracking=True, group_expand='_read_group_expand_full', default=lambda self: self.env['runbot.build.error.stage'].search([], limit=1))
94107
responsible = fields.Many2one('res.users', 'Assigned fixer', tracking=True)
95108
customer = fields.Many2one('res.users', 'Customer', tracking=True)
96109
team_id = fields.Many2one('runbot.team', 'Assigned team', tracking=True)

runbot/security/ir.model.access.csv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,4 +151,5 @@ access_runbot_build_stat_regex_wizard,access_runbot_build_stat_regex_wizard,mode
151151

152152
access_runbot_host_message,access_runbot_host_message,runbot.model_runbot_host_message,runbot.group_runbot_admin,1,0,0,0
153153

154-
154+
access_runbot_build_error_stage_user,access_runbot_build_error_stage_user,runbot.model_runbot_build_error_stage,base.group_user,1,0,0,0
155+
access_runbot_build_error_stage_admin,access_runbot_build_error_stage_admin,runbot.model_runbot_build_error_stage,base.group_user,1,1,1,1

runbot/views/build_error_views.xml

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
<field name="model">runbot.build.error</field>
66
<field name="arch" type="xml">
77
<form>
8+
<header>
9+
<field name="stage_id" widget="statusbar" options="{'clickable': '1'}"/>
10+
</header>
811
<sheet>
912
<div name="button_box">
1013
<button class="oe_stat_button" type="object" icon="fa-exclamation-circle" name="action_get_build_link_record">
@@ -316,6 +319,59 @@
316319
<field name="binding_view_types">list</field>
317320
</record>
318321

322+
<record id="build_error_view_kanban" model="ir.ui.view">
323+
<field name="name">runbot.build.error.kanban</field>
324+
<field name="model">runbot.build.error</field>
325+
<field name="arch" type="xml">
326+
<kanban default_group_by="stage_id" quick_create="false" default_order="last_seen_date desc">
327+
<templates>
328+
<t t-name="card">
329+
<widget name="web_ribbon" title="Test-tags" bg_color="bg-danger" invisible="not test_tags"/>
330+
<field name="name" class="fw-bold fs-5"/>
331+
<group>
332+
<div style="display: flex; align-items: center;">
333+
<i class="fa fa-clock-o me-2" title="Date interval from first seen to last seen"/>
334+
<field name="first_seen_date" widget="remaining_days"/>
335+
<i class="fa fa-long-arrow-right mx-2 oe_read_only" title="to"/>
336+
<field name="last_seen_date" widget="remaining_days"/>
337+
</div>
338+
339+
<div class="d-flex align-items-center gap-1">
340+
<i class="fa fa-repeat" title="Number of occurence"/>
341+
<field name="error_count"/>
342+
</div>
343+
344+
<div class="d-flex align-items-center gap-1" style="display: flex; align-items: center;">
345+
<i class="fa fa-code-fork" title="Concerned Odoo versions"/>
346+
<field name="version_ids" widget="many2many_tags"/>
347+
</div>
348+
<div class="d-flex align-items-center gap-1" style="display: flex; align-items: center;">
349+
<i class="fa fa-bullseye" title="Triggers"/>
350+
<field name="trigger_ids" widget="many2many_tags"/>
351+
</div>
352+
</group>
353+
354+
<footer>
355+
<div class="d-flex align-items-center gap-1">
356+
<field name="activity_ids" widget="kanban_activity"/>
357+
</div>
358+
<div class="d-flex align-items-center gap-1 ms-auto">
359+
<i class="fa fa-random text-danger" title="inconsistant" invisible="not random"/>
360+
<i class="fa fa-users" title="Responsible team"/>
361+
<field name="team_id"/> <i t-if="!record.team_id.raw_value">no team</i>
362+
<i class="fa fa-address-card" title="Investigator"/>
363+
<field name="customer" widget="many2one_avatar_user"/>
364+
<i class="fa fa-wrench" title="Solver"/>
365+
<field name="responsible" widget="many2one_avatar_user"/>
366+
<field name="fixing_pr_url" widget="url" text="PR" invisible="not fixing_pr_url"/>
367+
</div>
368+
</footer>
369+
</t>
370+
</templates>
371+
</kanban>
372+
</field>
373+
</record>
374+
319375
<record id="build_error_view_tree" model="ir.ui.view">
320376
<field name="name">runbot.build.error.list</field>
321377
<field name="model">runbot.build.error</field>
@@ -460,7 +516,7 @@
460516
<field name="name">Errors</field>
461517
<field name="res_model">runbot.build.error</field>
462518
<field name="path">error</field>
463-
<field name="view_mode">list,form</field>
519+
<field name="view_mode">kanban,list,form</field>
464520
<field name="context">{'search_default_not_fixed_errors': True, 'active_test': False}</field>
465521
</record>
466522

0 commit comments

Comments
 (0)