From d846b4e3824828bcb60fa32c0d8031b38bfbd1fe Mon Sep 17 00:00:00 2001 From: lse-odoo Date: Fri, 28 Feb 2025 18:12:02 +0100 Subject: [PATCH] [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 --- runbot/__manifest__.py | 2 +- runbot/migrations/18.0.5.11/post-migration.py | 15 ++++++ runbot/models/build_error.py | 9 ++++ runbot/views/build_error_views.xml | 54 ++++++++++++++++++- 4 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 runbot/migrations/18.0.5.11/post-migration.py diff --git a/runbot/__manifest__.py b/runbot/__manifest__.py index 84d15e5d..ebccf5ce 100644 --- a/runbot/__manifest__.py +++ b/runbot/__manifest__.py @@ -6,7 +6,7 @@ 'author': "Odoo SA", 'website': "http://runbot.odoo.com", 'category': 'Website', - 'version': '5.10', + 'version': '5.11', 'application': True, 'depends': ['base', 'base_automation', 'website'], 'data': [ diff --git a/runbot/migrations/18.0.5.11/post-migration.py b/runbot/migrations/18.0.5.11/post-migration.py new file mode 100644 index 00000000..1d34c846 --- /dev/null +++ b/runbot/migrations/18.0.5.11/post-migration.py @@ -0,0 +1,15 @@ + +def migrate(cr, version): + # Build errors with test_tags are considered disabled + cr.execute(""" + UPDATE runbot_build_error + SET state = 'disabled' + WHERE test_tags IS NOT NULL AND active IS TRUE + """) + # Archived build errors are considered solved + # Note: archived records with test-tags are considered solved too + cr.execute(""" + UPDATE runbot_build_error + SET state = 'solved' + WHERE active IS FALSE + """) diff --git a/runbot/models/build_error.py b/runbot/models/build_error.py index c2eccda4..35bf6727 100644 --- a/runbot/models/build_error.py +++ b/runbot/models/build_error.py @@ -105,6 +105,15 @@ class BuildError(models.Model): error_count = fields.Integer("Error count", store=True, compute='_compute_count') previous_error_id = fields.Many2one('runbot.build.error', string="Already seen error") + state = fields.Selection([ + ('new', 'New/Unsolved'), + ('solved', 'Solved'), + ('disabled', 'Disabled'), + ], default='new', tracking=True, group_expand=True, + help="New: Error is new and not yet solved.\n" + "Solved: Error should be solved.\n" + "Disabled: Error is disabled (generally set with test tags).") + ) responsible = fields.Many2one('res.users', 'Assigned fixer', tracking=True) customer = fields.Many2one('res.users', 'Customer', tracking=True) team_id = fields.Many2one('runbot.team', 'Assigned team', tracking=True) diff --git a/runbot/views/build_error_views.xml b/runbot/views/build_error_views.xml index b1c30c92..5e20f1f6 100644 --- a/runbot/views/build_error_views.xml +++ b/runbot/views/build_error_views.xml @@ -5,6 +5,9 @@ runbot.build.error
+
+ +