Skip to content

Commit e72d4df

Browse files
committed
[IMP] runbot: use batch date for first seen date
The log date can be useful to identify a pattern in apparition (alway arround midnight, ...) but it is usually less relevant for apparition when when usually focus on the "commit" so the batch date Moreover the log date can be misleading when the build ran in faketime. Even if it is not always the case, it is possible to have log_dates in the future.
1 parent 21683fc commit e72d4df

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

runbot/models/build_error.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ class BuildErrorLink(models.Model):
3939
build_id = fields.Many2one('runbot.build', required=True, index=True)
4040
error_content_id = fields.Many2one('runbot.build.error.content', required=True, index=True, ondelete='cascade')
4141
log_date = fields.Datetime(string='Log date')
42+
batch_id = fields.Many2one('runbot.batch', related='build_id.create_batch_id', string='Batch', store=True, readonly=True)
43+
batch_date = fields.Datetime(related='batch_id.create_date', string='Batch date', store=True, readonly=True)
4244
host = fields.Char(related='build_id.host')
4345
dest = fields.Char(related='build_id.dest')
4446
version_id = fields.Many2one(related='build_id.version_id')
@@ -75,8 +77,8 @@ def _compute_seen(self):
7577
if error_link_ids:
7678
first_error_link = error_link_ids[0]
7779
last_error_link = error_link_ids[-1]
78-
record.first_seen_date = first_error_link.log_date
79-
record.last_seen_date = last_error_link.log_date
80+
record.first_seen_date = first_error_link.batch_date
81+
record.last_seen_date = last_error_link.batch_date
8082
record.first_seen_build_id = first_error_link.build_id
8183
record.last_seen_build_id = last_error_link.build_id
8284
record.build_count = len(error_link_ids.build_id)

runbot/views/build_error_views.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<field name="team_id"/>
4141
<field name="fixing_pr_id"/>
4242
<field name="fixing_pr_url" widget="pull_request_url" invisible="not fixing_pr_id"/>
43-
<field name="fixing_bundle_url" invisible="not fixing_pr_id"/>
43+
<field name="fixing_bundle_url" invisible="not fixing_pr_id" widget="url"/>
4444
<field name="active"/>
4545
</group>
4646
<group name="appearance_info" string="Appearance" col="2">

0 commit comments

Comments
 (0)