mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[IMP] runbot: add similar errors page
Add a page on error content showing errors with similar qualifiers.
This commit is contained in:
parent
4bdd2e20b8
commit
65f2badd09
@ -353,6 +353,7 @@ class BuildErrorContent(models.Model):
|
|||||||
trigger_ids = fields.Many2many('runbot.trigger', compute='_compute_trigger_ids', string='Triggers', search='_search_trigger_ids')
|
trigger_ids = fields.Many2many('runbot.trigger', compute='_compute_trigger_ids', string='Triggers', search='_search_trigger_ids')
|
||||||
tag_ids = fields.Many2many('runbot.build.error.tag', string='Tags')
|
tag_ids = fields.Many2many('runbot.build.error.tag', string='Tags')
|
||||||
qualifiers = JsonDictField('Qualifiers', index=True)
|
qualifiers = JsonDictField('Qualifiers', index=True)
|
||||||
|
similar_ids = fields.One2many('runbot.build.error.content', compute='_compute_similar_ids')
|
||||||
|
|
||||||
responsible = fields.Many2one(related='error_id.responsible')
|
responsible = fields.Many2one(related='error_id.responsible')
|
||||||
customer = fields.Many2one(related='error_id.customer')
|
customer = fields.Many2one(related='error_id.customer')
|
||||||
@ -442,6 +443,22 @@ class BuildErrorContent(models.Model):
|
|||||||
for error_content in self:
|
for error_content in self:
|
||||||
error_content.error_display_id = error_content.error_id.id
|
error_content.error_display_id = error_content.error_id.id
|
||||||
|
|
||||||
|
@api.depends('qualifiers')
|
||||||
|
def _compute_similar_ids(self):
|
||||||
|
"""error contents having the exactly the same qualifiers"""
|
||||||
|
for record in self:
|
||||||
|
if record.qualifiers:
|
||||||
|
query = SQL(
|
||||||
|
r"""SELECT id FROM runbot_build_error_content WHERE id != %s AND qualifiers @> %s AND qualifiers <@ %s""",
|
||||||
|
record.id,
|
||||||
|
json.dumps(self.qualifiers.dict),
|
||||||
|
json.dumps(self.qualifiers.dict),
|
||||||
|
)
|
||||||
|
self.env.cr.execute(query)
|
||||||
|
record.similar_ids = self.env['runbot.build.error.content'].browse([rec[0] for rec in self.env.cr.fetchall()])
|
||||||
|
else:
|
||||||
|
record.similar_ids = False
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _digest(self, s):
|
def _digest(self, s):
|
||||||
"""
|
"""
|
||||||
@ -565,6 +582,7 @@ class BuildErrorContent(models.Model):
|
|||||||
self._qualify()
|
self._qualify()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class BuildErrorTag(models.Model):
|
class BuildErrorTag(models.Model):
|
||||||
|
|
||||||
_name = "runbot.build.error.tag"
|
_name = "runbot.build.error.tag"
|
||||||
|
@ -145,6 +145,21 @@
|
|||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</page>
|
</page>
|
||||||
|
<page string="Similary qualified">
|
||||||
|
<field name="similar_ids" widget="one2many" options="{'not_delete': True, 'no_create': True}" readonly="1">
|
||||||
|
<tree>
|
||||||
|
<field name="create_date"/>
|
||||||
|
<field name="module_name"/>
|
||||||
|
<field name="summary"/>
|
||||||
|
<field name="random"/>
|
||||||
|
<field name="build_count"/>
|
||||||
|
<field name="responsible"/>
|
||||||
|
<field name="fixing_commit"/>
|
||||||
|
<field name="id"/>
|
||||||
|
<button type="object" name="get_formview_action" icon="fa-arrow-right" title="View similar error"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</page>
|
||||||
<page string="Debug" groups="base.group_no_one">
|
<page string="Debug" groups="base.group_no_one">
|
||||||
<group name="build_error_group">
|
<group name="build_error_group">
|
||||||
<field name="fingerprint" readonly="1"/>
|
<field name="fingerprint" readonly="1"/>
|
||||||
|
Loading…
Reference in New Issue
Block a user