Commit Graph

624 Commits

Author SHA1 Message Date
Xavier-Do
b76a523730 [IMP] runbot: faster batch prepare 2024-11-28 14:12:42 +01:00
Christophe Monniez
9d5b31fe18 [IMP] runbot: add a deduplicate server action
Duplicate error content should not happens ... but it does.
With this commit, a server actions allows to relink error contents and
thus removes error contents having the same fingerprint.
2024-11-28 13:43:40 +01:00
Christophe Monniez
3a485536fd [IMP] runbot: rename _merge method into _relink on error_content 2024-11-28 13:43:40 +01:00
Xavier-Do
0768d9c797 [IMP] runbot: optimize build error content merging 2024-11-28 13:43:40 +01:00
Christophe Monniez
96eb116ead [FIX] runbot: refactor error content merge 2024-11-28 13:43:40 +01:00
Christophe Monniez
60f7f195bf [IMP] runbot: find duplicate error contents 2024-11-28 13:43:40 +01:00
Christophe Monniez
a82a995397 [IMP] runbot: add a message when a build error is merged
When digging into deactivated build errors, one cannot easily find why
an error was deactivated and to which one it was merged.

With this commit, a message is added in the chatter to explain where it
is merged.
2024-11-28 13:43:40 +01:00
William Braeckman
57bd762d9c [IMP] runbot: make computable fields searchable
Adds search functions for all 'related' computed fields on
runbot.build.error.
2024-11-28 13:40:16 +01:00
William Braeckman
b8d39471cc [IMP] runbot: add tracking on config steps modules 2024-11-28 13:39:48 +01:00
William Braeckman
ab0c95dac2 [IMP] runbot: add mail.thread to upgrade exception
Makes it easier to track when to remove upgrade exceptions.
2024-11-28 13:39:48 +01:00
William Braeckman
833b4e29d0 [IMP] runbot: add configurable process delay
Adds a configurable process delay on projects.
It can be used to reduce or otherwise increase the time between a push
and a batch starting.
2024-11-27 11:18:16 +01:00
Christophe Monniez
22151d3566 [FIX] runbot: fix log args
Previous fix was not enough when one of the args is not a string.

Courtesy of xmo
2024-11-26 09:13:05 +01:00
William Braeckman
ec440e61f7 [FIX] runbot: prevent crash with invalid exception 2024-11-26 09:12:30 +01:00
Xavier-Do
08016333fe [FIX] runbot: fix displayed log linked error 2024-11-26 09:04:43 +01:00
Xavier-Do
113f87dee2 [FIX] runbot: avoid duplicate ouptut because of Download progress 2024-11-26 09:04:43 +01:00
Xavier-Do
e6605dfaef [IMP] runbot: get docker metadata after build
The docker metadata are currently computed only on
some images durring the nightly.

This aims to get metadata after each docker image build in order to be
able to rely on them when needed.
2024-11-26 09:04:43 +01:00
Xavier-Do
36b35b6711 [FIX] runbot: test upgrade for dev branches again 2024-11-20 08:32:18 +01:00
Xavier-Do
ada5a5beaa [FIX] runbot: fix reclean 2024-11-19 09:30:42 +01:00
Xavier-Do
77ba739836 [IMP] runbot: speedup parse_logs 2024-11-19 09:30:42 +01:00
Xavier-Do
34e18cf797 [FIX] runbt: runbot build error parse_log fixes 2024-11-19 09:30:42 +01:00
Christophe Monniez
9151c26232 [FIX] runbot: fix invalid field name 2024-11-14 09:33:44 +01:00
Christophe Monniez
2697a28e54 [IMP] runbot: allow override global docker registry on a host 2024-11-14 09:11:26 +01:00
Christophe Monniez
dc7eb66903 [IMP] runbot: add a display field to show error id in content tree 2024-11-14 08:43:06 +01:00
Christophe Monniez
23be10f75b [IMP] runbot: add a search panel on build error list view 2024-11-14 08:43:06 +01:00
Xavier-Do
56e242a660 [IMP] runbot: refactor build error models
The initial idea to link an error to another one was a quick solution
to group them if they where related, but this became challenging
to copute metada regarding errors.

- The displayed error message was not always consistent with the real
root cause/the error that lead here.
- The aggregates (lets says, linked buils ids) could be the one of the
error, or from all error messages. Same for the versions, first seen, ..
This is confusing to knwo what is the leist we are managing and what is
the expecte result to display

Main motivation:
on a standard error page (will be changed to "assignment"), we want to
have the list of error message that is related to this one. We want to
know for each message (a real build error) what is the version,
first seen, ...
This will give more flexibility on the display,

The assigned person/team/test-tags, ... are moved to this model
The appearance data remains on the build error but are aggregate on the
assignation.
2024-11-14 08:43:06 +01:00
Xavier-Do
d990b39258 [FIX] runbot: consider to_upgrade as to_upgrade_to 2024-11-12 14:01:05 +01:00
Xavier-Do
2b690de566 [IMP] runbot: allow to disable upgrade from a version 2024-11-12 08:33:14 +01:00
Christophe Monniez
ecd9681b65 [FIX] runbot: properly join log args
When a type error occurs when trying to format a message in a build log,
the suspicious are are joined with the message. But as the args may be a
tuple, an errors occurs when concatenating the message with the args
during the join.

With this commit, we ensure that the args are casted into a list.
2024-11-09 17:42:52 +01:00
Christophe Monniez
dda0170a89 [FIX] runbot: avoid trying to push unexisting image
When an image is build for the first time and the build fails, an
ImageNotfound Exception is raised when trying to push the image.

Whith this commit, a warning is emmited instead of crashing in such a
case.
2024-10-10 09:16:56 +02:00
Christophe Monniez
a8b3d6e205 [FIX] runbot: avoid copying always_pull field
This commit will prevent people acting like cowboys to break the whole
system by duplicating a Dockerfile without disabling the always_pull
field.
2024-10-10 07:41:04 +02:00
Xavier-Do
ad87096436 [IMP] runbot: allow to skip requirements from trigger 2024-10-08 10:47:48 +02:00
Xavier-Do
f8f435d468 [FIX] runbot: remove record iteration in onchange
A recent task introduced a record loop using self inside.

It doesn't respect an api multi classic loop but it isn't an issue
since onchange are always called on a single record.

Removing the loop on all onchange to clean it up.
2024-09-25 10:37:09 +02:00
odoo
0b5d7d0566 [IMP] add customer on runbot build tasks
Idea is to help runbot/QA team to monitor other peoples tasks
easier. This way we will have a responsible person for each task
that someone else has assigned.
The goal of pr is two-fold:
1) We need to be able to better monitor the progress of tasks that
are not our own.
2) It introduces another metric with which we can measure individual
progress, and this can become main measuring metric for future non-technical
employees whose main goal will be making sure that none of the tasks become
rotten(not have any visible progress for months).
2024-09-19 08:20:14 +02:00
Christophe Monniez
3ae3f6dff3 [IMP] runbot: pull docker image only when needed
When a lot of Docker images are updated at the same time, all runbot
hosts will try to pull them at the same moment.

With this commit, only the images marked as `always_pull` will be pulled
and if one of them takes too much time to be pulled, we let the host
make another loop turn before continuing the images pull.

Finally, if a host uses the Docker registry, it will pull the remote
image when running a step, that way the image will be pulled
automatically if needed.
2024-09-13 11:57:07 +02:00
Xavier-Do
b60d54d4ea [FIX] runbot: fix image build failure 2024-09-12 13:08:00 +02:00
Xavier-Do
b96b32e8b9 [IMP] runbot: better docker logging
The docker operation are called often and cannot be logged each time.
If a docker operation is slow, we log it at the end but waiting for this
output we have no idea what the process is doing.

This pr proposed to go a lower level and get the stream from the docker
operation to be able to log earlier if we started a potentially slow
operation.
2024-09-11 13:16:13 +02:00
Xavier-Do
14bac37438 [IMP] runbot: small change of docker_build api
returns now a dict instead of a tuple for easier extension
2024-09-11 13:16:13 +02:00
Christophe Monniez
e4b04a42d1 [FIX] runbot: remove leftover tuple in markdown log 2024-09-09 08:07:42 +02:00
Christophe Monniez
33452d27e7 [IMP] runbot: add the possibility to disable a test per version
When disabling tests on runbot by using the test_tags on a build error,
the tests are disabled on every tested version. This can be annoying
when a test only fails from one version up to another.

With this commit, a min and max version can be specified on a
build_error when the test_tags field is used.
If the min and max are not used, the test will be disabled cross
versions.
2024-09-06 11:09:40 +02:00
Xavier-Do
21d6c84b26 [FIX] runbot: fix markdown adding escape
A common error on runbot is to generate link containing a __init__.py
file

[/some/path/to/__init__.py](/some/path/to/__init__.py)

This would be rendered as

<a href="/some/path/to/<ins>init<ins>.py">/some/path/to/<ins>init<ins>.py</a>

Breaking the link, and the display of the name

By default markdown will not render links avoiding this issue, but it
will remain for the content of the a, needing to manage some kind of
escaping.

The way to escape markdown is to add a \ before any special character
This must be done upront before formating, adding the method
markdown_escape

Our implementation of markdown is not meant to meet the exact
specification of markdown but better suit our needs. One of the
requirements is to be able to use it to format message easily but adding
dynamic countent comming from the outside. One of the error than can
occur is also

'Some code `%s`' % code can also cause problem if code contains `

This issue could be solved using indented code block, but this would
need to complexify the generated string, have a dedicated method to
escape the code blocs, ...

Since we have the controll on the input, we can easily sanitize all
ynamic content to avoid such issues. For code block we introduce a way
to escape backtick (\`). It is non standard but will be easier to use.

Combine with that, the build._log method now allows to add args with the
values to format the string (similar to logging) but will escape
params by default. (cr.execute spirit)

name = '__init__.py'
url = 'path/to/__init__.py'
code = '# comment `for` something'
build._log('f', 'Some message [%s](%s) \n `%s`', name, url, code)

name, url and code will be escaped
2024-09-05 15:33:41 +02:00
Xavier-Do
2fd7f47e49 [IMP] runbot: make stats when build timeout
The stats are only kept when the build finishes, this makes sence to
avoid collecting stats of a manually killed build (or because of newer
build found), but the stats mays be interresting when the build timeouts.

Adding a manual collection of stats in this case.
2024-09-05 14:24:41 +02:00
Xavier-Do
bc8c2a4853 [IMP] runbot: faster fetch
Use 2 jobs to fetch multiple origin at the same time.
2024-09-05 14:20:06 +02:00
Xavier-Do
faef017a25 [FIX] runbot: local cleanup 2024-08-29 08:44:57 +02:00
Christophe Monniez
d722160247 [IMP] drunbot: docker registry
The current runbot infrastructure has 100+ machine that will each build
all docker images.

This is unpractical for multiple reasons:
- impotant load on all machine when the build could be done once
- possible differences for the same image depending on the moment the
base was pulled on the host. An extreme example was the version of
python (3.11 or 3.12) when building the noble docker image before it was
stabilized.
- increase the chance to have a docker build failure in case of network
problem. (random)

A centralized registry will help with that, and allow future devlopment
to generate more docker images. All docker images will be exactly the
same, the pull time is faster than build time, only one build per docker
image, ...
2024-08-29 08:44:57 +02:00
Christophe Monniez
8ac21fb60b [IMP] runbot: allow to archive dockerfile 2024-08-28 10:23:08 +02:00
Xavier-Do
eaadd7886d [FIX] runbot: fix host id 2024-08-08 15:39:13 +02:00
Xavier-Do
d051e68448 [IMP] runbot: official docker file route
This route was already existing on runbot using a website page.
Making it official
2024-08-08 15:11:34 +02:00
Xavier-Do
9c6124d645 [IMP] runbot: faster docker update after change 2024-08-08 15:11:34 +02:00
Xavier-Do
d2872f8e16 [IMP] runbot: rework dockerfile generation 2024-08-08 15:11:34 +02:00
Xavier-Do
e5ad7c6242 [IMP] runbot: store docker build output in a dedicated model
When a docker fails to build, the output is logged in the chatter
leading to a lot of noise and a not so readable output. Moreover, the
output tries to format markdown and don't render line break correctly.

This commit proposes to introduce a model to store this output, as well
as some other info like the image identifier, build time, ...

This will help to compare images versions between hosts and should be
useful later to have multiple version of the same image with variant
once the docker registry is introduced.
2024-08-08 15:11:34 +02:00