Skip to content

Commit 5a22646

Browse files
committed
[IMP] runbot: add kanban view and stages to build error page
Introduce a kanban view to the runbot build error records. Kanban cards show the most valuable field with relevant icons. The concept of "state" was also introduced for the build error model. Currently there is 3 states: 1. New: default state for any new error build 2. Solved: when the issue should be solved 3. Disabled: build error currently disabled (test-tags) States are expected to be used by the user. For instance after fixing an underteministic error the user can change the state from new -> solved so that the user knows that he's actively not working on it
1 parent 7896428 commit 5a22646

File tree

4 files changed

+82
-2
lines changed

4 files changed

+82
-2
lines changed

runbot/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
'author': "Odoo SA",
77
'website': "http://runbot.odoo.com",
88
'category': 'Website',
9-
'version': '5.10',
9+
'version': '5.11',
1010
'application': True,
1111
'depends': ['base', 'base_automation', 'website'],
1212
'data': [
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
def migrate(cr, version):
3+
# Build errors with test_tags are considered ignored
4+
cr.execute("""
5+
UPDATE runbot_build_error
6+
SET state = 'disabled'
7+
WHERE test_tags IS NOT NULL AND active IS TRUE
8+
""")
9+
# Archived build errors are considered solved
10+
# Note: archived records with test-tags are considered solved too
11+
cr.execute("""
12+
UPDATE runbot_build_error
13+
SET state = 'solved'
14+
WHERE active IS FALSE
15+
""")

runbot/models/build_error.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,15 @@ class BuildError(models.Model):
105105
error_count = fields.Integer("Error count", store=True, compute='_compute_count')
106106
previous_error_id = fields.Many2one('runbot.build.error', string="Already seen error")
107107

108+
state = fields.Selection([
109+
('new', 'New/Unsolved'),
110+
('solved', 'Solved'),
111+
('disabled', 'Disabled'),
112+
], default='new', tracking=True, group_expand=True,
113+
help="New: Error is new and not yet solved.\n"
114+
"Solved: Error should be solved.\n"
115+
"Disabled: Error is disabled (generally set with test tags).")
116+
)
108117
responsible = fields.Many2one('res.users', 'Assigned fixer', tracking=True)
109118
customer = fields.Many2one('res.users', 'Customer', tracking=True)
110119
team_id = fields.Many2one('runbot.team', 'Assigned team', tracking=True)

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="state" 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">
@@ -329,6 +332,59 @@
329332
<field name="binding_view_types">list</field>
330333
</record>
331334

335+
<record id="build_error_view_kanban" model="ir.ui.view">
336+
<field name="name">runbot.build.error.kanban</field>
337+
<field name="model">runbot.build.error</field>
338+
<field name="arch" type="xml">
339+
<kanban default_group_by="state" quick_create="false" default_order="last_seen_date desc">
340+
<templates>
341+
<t t-name="card">
342+
<widget name="web_ribbon" title="Test-tags" bg_color="bg-danger" invisible="not test_tags"/>
343+
<field name="name" class="fw-bold fs-5"/>
344+
<group>
345+
<div class="d-flex align-items-center">
346+
<i class="fa fa-clock-o me-2" title="Date interval from first seen to last seen"/>
347+
<field name="first_seen_date" widget="remaining_days"/>
348+
<i class="fa fa-long-arrow-right mx-2 oe_read_only" title="to"/>
349+
<field name="last_seen_date" widget="remaining_days"/>
350+
</div>
351+
352+
<div class="d-flex align-items-center gap-1">
353+
<i class="fa fa-repeat" title="Number of occurence"/>
354+
<field name="error_count"/>
355+
</div>
356+
357+
<div class="d-flex align-items-center gap-1">
358+
<i class="fa fa-code-fork" title="Concerned Odoo versions"/>
359+
<field name="version_ids" widget="many2many_tags"/>
360+
</div>
361+
<div class="d-flex align-items-center gap-1">
362+
<i class="fa fa-bullseye" title="Triggers"/>
363+
<field name="trigger_ids" widget="many2many_tags"/>
364+
</div>
365+
</group>
366+
367+
<footer>
368+
<div class="d-flex align-items-center gap-1">
369+
<field name="activity_ids" widget="kanban_activity"/>
370+
</div>
371+
<div class="d-flex align-items-center gap-1 ms-auto">
372+
<i class="fa fa-random text-danger" title="inconsistant" invisible="not random"/>
373+
<i class="fa fa-users" title="Responsible team"/>
374+
<field name="team_id"/> <i t-if="!record.team_id.raw_value">no team</i>
375+
<i class="fa fa-address-card" title="Investigator"/>
376+
<field name="customer" widget="many2one_avatar_user"/>
377+
<i class="fa fa-wrench" title="Solver"/>
378+
<field name="responsible" widget="many2one_avatar_user"/>
379+
<field name="fixing_pr_url" widget="url" text="PR" invisible="not fixing_pr_url"/>
380+
</div>
381+
</footer>
382+
</t>
383+
</templates>
384+
</kanban>
385+
</field>
386+
</record>
387+
332388
<record id="build_error_view_tree" model="ir.ui.view">
333389
<field name="name">runbot.build.error.list</field>
334390
<field name="model">runbot.build.error</field>
@@ -478,7 +534,7 @@
478534
<field name="name">Errors</field>
479535
<field name="res_model">runbot.build.error</field>
480536
<field name="path">error</field>
481-
<field name="view_mode">list,form</field>
537+
<field name="view_mode">list,kanban,form</field>
482538
<field name="context">{'search_default_not_fixed_errors': True, 'active_test': False}</field>
483539
</record>
484540

0 commit comments

Comments
 (0)