Skip to content

Commit 3cf9dd6

Browse files
Xavier-Dod-fence
authored andcommitted
[IMP] runbot: improve build list page
1 parent 3aeaa52 commit 3cf9dd6

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

runbot/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
import threading
1111
from odoo.http import request
1212

13+
# 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)
14+
# 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)
15+
from odoo.tools.view_validation import _validators
16+
_validators['list'] = []
17+
1318
class UserFilter(logging.Filter):
1419
def filter(self, record): # noqa: A003
1520
message_parts = record.msg.split(' ', 2)
@@ -28,3 +33,4 @@ def filter(self, record): # noqa: A003
2833

2934
def runbot_post_load():
3035
logging.getLogger('werkzeug').addFilter(UserFilter())
36+

runbot/models/build.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ class BuildResult(models.Model):
163163
config_id = fields.Many2one('runbot.build.config', related='params_id.config_id', store=True, index=True)
164164
trigger_id = fields.Many2one('runbot.trigger', related='params_id.trigger_id', store=True, index=True)
165165
create_batch_id = fields.Many2one('runbot.batch', related='params_id.create_batch_id', store=True, index=True)
166+
create_bundle_id = fields.Many2one('runbot.bundle', related='params_id.create_batch_id.bundle_id', index=True)
166167

167168
# state machine
168169
global_state = fields.Selection(make_selection(state_order), string='Status', compute='_compute_global_state', store=True, recursive=True)

runbot/views/build_views.xml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,22 @@
9292
<field name="model">runbot.build</field>
9393
<field name="arch" type="xml">
9494
<list string="Builds">
95-
<field name="dest"/>
95+
<field name="dest"
96+
decoration-bg-danger="global_result == 'ko'"
97+
decoration-bg-warning="global_result == 'warn'"
98+
decoration-bg-success="global_result == 'ok' and global_state == 'done'"
99+
decoration-bg-info="global_result == 'ok' and global_state != 'done'"
100+
/>
101+
<field name="create_bundle_id"/>
102+
<field name="global_result" optional="hide"/>
96103
<field name="global_state"/>
97-
<field name="global_result"/>
98-
<field name="job"/>
104+
<field name="trigger_id"/>
105+
<field name="config_id"/>
106+
<field name="job" string="Active_Step"/>
99107
<field name="host"/>
100108
<field name="build_time"/>
101109
<field name="build_age"/>
110+
<field name="build_url" widget="url"/>
102111
</list>
103112
</field>
104113
</record>
@@ -119,6 +128,7 @@
119128
<field name="id"/>
120129
<field name="global_state"/>
121130
<field name="dest"/>
131+
<field name="host" operator="="/>
122132
<filter string="Pending" name='pending' domain="[('global_state','=', 'pending')]"/>
123133
<filter string="Testing" name='testing' domain="[('global_state','in', ('testing', 'waiting'))]"/>
124134
<filter string="Running" name='running' domain="[('global_state','=', 'running')]"/>

0 commit comments

Comments
 (0)