[IMP] runbot: improve build list page

This commit is contained in:
Xavier-Do 2025-03-14 12:31:33 +01:00
parent 9097aa4545
commit 8340a2d25f
3 changed files with 20 additions and 3 deletions

View File

@ -10,6 +10,11 @@ import logging
import threading
from odoo.http import request
# rng validators doesn't allow decoration-bg-attributes on list fields even if they work fine (as long as you don't have a widget)
# disabling rng validators for list as they have a low value (as long as we test the views manually witch is the case on runbot)
from odoo.tools.view_validation import _validators
_validators['list'] = []
class UserFilter(logging.Filter):
def filter(self, record): # noqa: A003
message_parts = record.msg.split(' ', 2)
@ -28,3 +33,4 @@ class UserFilter(logging.Filter):
def runbot_post_load():
logging.getLogger('werkzeug').addFilter(UserFilter())

View File

@ -163,6 +163,7 @@ class BuildResult(models.Model):
config_id = fields.Many2one('runbot.build.config', related='params_id.config_id', store=True, index=True)
trigger_id = fields.Many2one('runbot.trigger', related='params_id.trigger_id', store=True, index=True)
create_batch_id = fields.Many2one('runbot.batch', related='params_id.create_batch_id', store=True, index=True)
create_bundle_id = fields.Many2one('runbot.bundle', related='params_id.create_batch_id.bundle_id', index=True)
# state machine
global_state = fields.Selection(make_selection(state_order), string='Status', compute='_compute_global_state', store=True, recursive=True)

View File

@ -92,13 +92,22 @@
<field name="model">runbot.build</field>
<field name="arch" type="xml">
<list string="Builds">
<field name="dest"/>
<field name="dest"
decoration-bg-danger="global_result == 'ko'"
decoration-bg-warning="global_result == 'warn'"
decoration-bg-success="global_result == 'ok' and global_state == 'done'"
decoration-bg-info="global_result == 'ok' and global_state != 'done'"
/>
<field name="create_bundle_id"/>
<field name="global_result" optional="hide"/>
<field name="global_state"/>
<field name="global_result"/>
<field name="job"/>
<field name="trigger_id"/>
<field name="config_id"/>
<field name="job" string="Active_Step"/>
<field name="host"/>
<field name="build_time"/>
<field name="build_age"/>
<field name="build_url" widget="url"/>
</list>
</field>
</record>
@ -119,6 +128,7 @@
<field name="id"/>
<field name="global_state"/>
<field name="dest"/>
<field name="host" operator="="/>
<filter string="Pending" name='pending' domain="[('global_state','=', 'pending')]"/>
<filter string="Testing" name='testing' domain="[('global_state','in', ('testing', 'waiting'))]"/>
<filter string="Running" name='running' domain="[('global_state','=', 'running')]"/>