runbot/runbot/__manifest__.py
Christophe Monniez 360e31ade4 [IMP] runbot: add a build stat model
When a build is done, various numerical informations could be extracted
from log files.  e.g.: global query count or tests query count ...

The extraction regular expression could be hard-coded in a custom step
but there is no place holder where to store the retrieved information.
In order to compare results, we need to store it.

With this commit, a new model `runbot.build.stat` is used to store
key/values pair linked to a build/config_step.  That way, extracted
values can be stored.

Also, another `runbot.build.stat.regex` is used to store regular
expressions that can be used to grep log files and extract values.

The regular expression must contain a named group like this:
`(?P<value>.+)`
The text catched by this group MUST be castable into a float.

Optionally, another named group can be used in the regular expresion
like this:
`(?P<key>.+)`
This `key` group will then be used to augment the key name in the
database.

Example:
    Consider a log line like this one:
    `odoo.addons.website_blog.tests.test_ui tested in 10.35s`

    A regular expression like this, named `test_duration`:
    `odoo.addons.(?P<key>.+) tested in (?P<value>\d+\.\d+)s`

    Should store the following key:value:
    `{
        'key': 'test_duration.website_blog.tests.test_ui',
        'value': 10.35
    }`

A `generic` boolean field is present on the build.stat.regex object,
meaning that when no regex are linked to a make_stats config step, then,
all the generic regex will be applied.

A wizard is added to help the creation the regular expressions, allowing
to test if they work against a user provided example.

A _make_stats method is added to the ConfigStep model which is called
during the _schedule of a build, just before calling the next step.
The regex search is only apllied in steps that have the `make_stats`
boolean field set to true. Also, the build branch have to be flagged
`make_stats` too or the build can have a key `make_stats` in its
config_data field.

The `make_stats` field on the branch is a compute stored field.
That way, sticky branches are automaticaly set `make_stats' true.

Finally, an SQL view is used to facilitate the stats visualisation.
2020-03-20 11:11:03 +01:00

41 lines
1.2 KiB
Python

# -*- coding: utf-8 -*-
{
'name': "runbot",
'summary': "Runbot",
'description': "Runbot for Odoo 11.0",
'author': "Odoo SA",
'website': "http://runbot.odoo.com",
'category': 'Website',
'version': '4.10',
'depends': ['website', 'base'],
'data': [
'security/runbot_security.xml',
'security/ir.model.access.csv',
'security/ir.rule.csv',
'views/assets.xml',
'views/repo_views.xml',
'views/branch_views.xml',
'views/build_views.xml',
'views/host_views.xml',
'views/build_error_views.xml',
'views/error_log_views.xml',
'views/config_views.xml',
'views/res_config_settings_views.xml',
'views/stat_views.xml',
'wizards/mutli_build_wizard_views.xml',
'wizards/stat_regex_wizard_views.xml',
'templates/frontend.xml',
'templates/build.xml',
'templates/assets.xml',
'templates/dashboard.xml',
'templates/nginx.xml',
'templates/badge.xml',
'templates/branch.xml',
'data/runbot_build_config_data.xml',
'data/build_parse.xml',
'data/runbot_error_regex_data.xml',
'data/error_link.xml',
'data/website_data.xml',
],
}