Commit Graph

1008 Commits

Author SHA1 Message Date
Xavier-Do
6107c0aefb [FIX] runbot: adapt widgets to owl
This is a first quick version to keep main functionalities, this will
need to be adapt and clean later.
2023-06-22 11:15:16 +02:00
Xavier-Do
70c468f821 [FIX] fix invalid t-att 2023-06-21 15:47:54 +02:00
Xavier-Do
614040720b [IMP] runbot: add useful indexes remaining from upgrade 2023-06-21 10:08:14 +02:00
Xavier-Do
8d724b157f [FIX] runbot: adapt frontend to 16.0
A first step to get more independant from web and website was done in
15.0 but some file were moved and it looks like the bootstrap version
changed breaking the frontend again. (4.3->5.1)

This commit simply copies the libs from odoo/15.0 to avoid losing time
fixing the frontend look and feel for the new bootstrap version for now.

A future refactoring could change the vendored version to addapt to 5.1
while modernizing the frontend style.
2023-06-20 14:15:26 +02:00
Xavier-Do
45104b635f [REL] adapt for 16.0 2023-06-20 12:34:32 +02:00
Xavier-Do
d3f998f88c [IMP] runbot: keep log create_date 2023-06-20 09:18:48 +02:00
Xavier-Do
a80dc25699 [FIX] runbot: only top parent is marked killable 2023-06-14 10:30:02 +02:00
Xavier-Do
9cf750119d [IMP] runbot: make search case insensitive 2023-06-02 17:11:54 +02:00
Xavier-Do
03667b703c [IMP] runbot: fallback on python step for upgrade step 2023-06-02 14:44:48 +02:00
Xavier-Do
ad4131789c [FIX] runbot: fix false positive message 2023-06-02 11:10:51 +02:00
Xavier-Do
7845a718b7 [IMP] runbot: add use_ssl to settings 2023-06-02 10:49:05 +02:00
Martin Trigaux
8153fdc4b2 [FIX] runbot: download over https
Firefox blocks downloads from http link if you are on an https page
Allow to deactivate via an ICP in case the runbot is configured over
HTTP (you shouldn't really)
2023-06-02 10:49:05 +02:00
Christophe Monniez
236554b588 [FIX] runbot: catch exceptions during db drop
When the runbot tries to drop a local database, if the that raises an
exception, it goes in a loop failure. It mays happen for example if
someone forgot to close a psql during an investigation :-)

With this commit, the exceptions are catched and at least the database
name is logged.
2023-06-01 16:16:06 +02:00
Xavier-Do
7523dc8000 [FIX] runbot: fix dockerfile choice order
Since all versions will have a defined dockerfile, the project one
will alway be ignored. The idea here is that for a project, we may
definea default dockerfile_id so that we don't have to set it on all
bundle to make it work.
2023-06-01 16:13:40 +02:00
Xavier-Do
db38794f9a [FIX] runbot: avoid sending sattus on running kill
The _kill method was called in multiple case, usually when something
wrong happen:
- exception initiating pending
- kill requested manually
- testing time exceeded
- exception running a job
- ...

But it will also be called when killing a running build.

It was usually not an issue since the status remains the same, but it is
not true if the same commit is used in two build, the new one is green,
the old one is red (enterprise commit remaining the same but community
commit changed as an example)

In this situation, the enterprise commit may receive the red ci from the
old build while the last one is green.

Since with the last version, the github status responsibility is left to
write method, this github status is not useful anymore, updating the
state and result is enough.

This commit also removes the commit since it is not always a god idea.
Most of the time the transaction will be comited quite fast after that
with the new scheduler.

Note that checking in github status if no status has a more recent build
may be a good idea. Only the most recent build using a commit could
sending a status? This would not alway be helpful Imagine a commit used
in 2 branches by mistake, the last build is not always the one we want
(usually fixed by rebuilding a subbuild of the good build)
2023-06-01 15:40:16 +02:00
Xavier-Do
64d3c59ed9 [FIX] runbot: limit max log size
In some case, a build can add a lot of info in a log, there
is already a limit to the number of entry but not to the size of an
entry. This will limit the database usage in case of mistake/abuse.
2023-06-01 15:33:47 +02:00
Xavier-Do
5a5e7693d4 [IMP] runbot: add an option on step to disable logdb 2023-06-01 15:13:01 +02:00
Christophe Monniez
f6eb23f896 [IMP] runbot: improve frontend search
When filtering bundles in the frontend, the user is not able to search
for its final trigram because of the `like`search.

With this commit, if the search contains a `%` symbol, the `=like`
operator is used permitting more accurate searches.
2023-06-01 15:03:13 +02:00
Christophe Monniez
2421a24f78 [IMP] runbot: add show builds the host form 2023-06-01 15:03:13 +02:00
Christophe Monniez
45fb4f8319 [IMP] runbot: add activities on runbot build errors 2023-06-01 15:03:13 +02:00
Christophe Monniez
86616ba88e [IMP] runbot: add a widget to go to runbot frontend
With this commit, a custom widget is added to go to the reunbot frontend
from a Char field. This allows to go from the bundle backend page to the
bundle frontend page wich is more useful in some situations.

e.g.: when creating a custom trigger with the wizard, this allows to
test the trigger with 2 clicks.
2023-06-01 15:03:13 +02:00
Christophe Monniez
e445ed27db [IMP] runbot: change fixing commit widget to url 2023-06-01 15:03:13 +02:00
Christophe Monniez
bdd98b07ec [IMP] runbot: rename active to active
Error is not fixed was too disturbing.
2023-06-01 15:03:13 +02:00
Christophe Monniez
6e145ff362 [IMP] runbot: improve build errors tabs
* show only the all builds tab
* hide linked errors tab when there is no linked errors
* hide error history tab when there is no history
* add some readonly
2023-06-01 15:03:13 +02:00
Christophe Monniez
ffe12182ab [IMP] runbot: open frontend_url in a new tab 2023-06-01 15:03:13 +02:00
Christophe Monniez
430a526b5c [FIX] runbot: limit triggers in additionnal_setup
When testing with a populated db, this assertion fails because of
additional repositories.
2023-06-01 15:03:13 +02:00
Christophe Monniez
82c6b22e77 [FIX] runbot: typo in test tag 2023-06-01 15:03:13 +02:00
Christophe Monniez
2e002c2dd7 [IMP] runbot: improve the build errors wizard
With this commit, the wizard now allows to set a fixing PR and/or a
commit text to multiple errors.
2023-06-01 15:03:13 +02:00
Christophe Monniez
388eeb377a [IMP] runbot: improve build errors views
* add a link to the fixing PR on github
* add a warning ribbon on test-tagged errors
* show different colors in tree view to spot fixed PR's
* add some search filters
2023-06-01 15:03:13 +02:00
Xavier-Do
231febab96 [FIX] runbot: fix stats.js 2023-05-08 13:26:07 +02:00
Xavier-Do
04760491a2 [FIX] runbot: hide wakeup action from public users
The initial idea to have a wakeup for public users stopped being viable
due to some abuse of the system, maybe unintentional crawling of
some build page but still, this feature will now be limited to internal
users only.
2023-05-02 13:32:43 +02:00
Xavier-Do
e3d87b5b5d [IMP] runbot: improve test-tags support
The current post_install build mecanism is using extra params to give
test-tags. Unfortunately this disables the support for auto tags
and this have to be done manually. This means that auto tags are in the
build extra-params and not dynamic at rebuild of a post_install.

Also, using extraparams in the post install creation was removing
extra_params comming from custom trigger.

With this commit, the test-tags can be given inside config_data
and will be combined with config step test-tags and auto-tags.

This was an opportunity to simplify the logic.

This commit also fixes the test_install_tags that was broken.
2023-04-06 11:33:01 +02:00
Xavier-Do
43d5cc9d7e [IMP] runbot: add some anchors in nginx 2023-04-04 10:43:58 +02:00
Xavier-Do
e88f679c87 [FIX] runbot: fix python step wakeup 2023-03-30 13:05:35 +02:00
Xavier-Do
8c2e7a5781 [FIX] runbot: manage case when there is no start
SInce the previous version the build end is written when going in any
done state. This means that when a build is skipped, it has a end
but no start.

Adapat the build dime to manage this use case.
2023-03-29 14:58:14 +02:00
Xavier-Do
9024594df2 [FIX] runbot: use request instead of self 2023-03-24 17:06:29 +01:00
Xavier-Do
f7d29f87a4 [FIX] runbot: fix build end
Previous fix was not enough because based on global_state, meaning
that the build if the build goes waiting, it need to update its end
anyway.
2023-03-24 13:09:19 +01:00
Xavier-Do
0edc0bce3a [FIX] limit /force route to advanced users
The force buttons were hidden because unfortunately miss used as a
rebuild in some case instead. The position of the button was to obvious
and used as a "magic fix" when the intended behavior was only for really
specific cases.

Unfortunately the routes were know and still used manually. This commit
blocs the access giving a message to ask for the group if needed.

Those feature would benefit for some documentation.
2023-03-24 11:30:13 +01:00
Xavier-Do
30c74e2434 [FIX] runbot: update build end 2023-03-24 10:26:20 +01:00
Xavier-Do
ee58a93e9a [IMP] runbot: avoid link to killed build
When a build is created, it will first check for another
build having the same params. It is usually a good idea to avoid
to much load. In some case, a build can be found, but a killed one.

This is not what we want:
The first scenario is to consecutive force push,
commit1 -> commit2 -> commit1

The build of commit1 may be killed because of commit2, then when
forcepushing commit1 again, it will be linked to a killed build.

A even more problematic problem was discovered because of a delay In
odoo/odoo repo hook. An odoo-dev/odoo 16.0-... branch was discovered
first using this commit, and a build was created.
Then, the branch was forcedpushed and the build was killed.
Finally, the 16.0 commit was discovered, and was linked to the killed
build. This was mainly an issue because the build was a template.

With this changes, the 16.0 would have created a new build, not linking
to a killed one.

Note that linking to a red build is not an error. Only a killed one.
2023-03-24 10:26:20 +01:00
Xavier-Do
3e5d5e88a1 [FIX] runbot: global_state not written in compute 2023-03-23 16:56:34 +01:00
Xavier-Do
0d29643d52 [IMP] runbot: add a separate pending count
The assigned build are in the same count of the pending build. This can
sometimes create a false queue, because you can have 1000 pending builds
on one host, this doesn't mean that a new standard build cannot be
immediatly taken by another host. This is mainly to hide the false queue
created by the full charge zfs build currently running and creating
~400 assigned build.
2023-03-23 16:33:24 +01:00
Xavier-Do
74f0c8e1ad [FIX] runbot: fix wakeup 2023-03-23 14:44:08 +01:00
Xavier-Do
2acca91a97 [FIX] runbot: fix missing return
This was missing to make python (and other non docker) steps really
blazing fast
2023-03-23 14:17:02 +01:00
Xavier-Do
b078275c94 [IMP] runbot: add commit_export_ids 2023-03-23 13:32:50 +01:00
Xavier-Do
2488228b7b [IMP] runbot: make params work in create multi
The main motivation is to allow to create params from data
the "new" method was called with a value list instead of a dict.

Also, makes it possible to update params when the registry is not laoded
2023-03-23 13:32:50 +01:00
Xavier-Do
d164d9a745 [IMP] runbot: host improvement 2023-03-23 13:32:50 +01:00
Xavier-Do
d2f9330043 [REF] runbot: various refactoring
The initial motivation is to remove the flush when a log_counter is
written. This flush was initially usefull when the limit was in a
psql trigger, but finally add a side effect to flush everything before
starting the docker. This was limiting concurrent update after starting
the docker, but we still have no garantee that the transaction is
commited after starting the docker. The use case where the docker is
started but the transaction is not commited was not handled well and was
leading to an infinite loop of trying to start a docker (while the
docker was already started)

This refactoring returns the docker to the scheduler so that the
schedulter can commit before starting the docker.

To achieve this, it is ideal to have only one method that could return
a callable in the _scheduler loop. This is done by removing the run_job
from the init_pending method. All satellite method like make result
are also modified and adapted to make direct write: the old way was
technical debt, useless optimization from pre-v13.

Other piece of code are moved arround to prepare for future changes,
mainly to make the last commit easier to revert if needed.

[FIX] runbot: adapt tests to previous refactoring
2023-03-23 13:32:50 +01:00
Xavier-Do
688900edb1 [FIX] runbot: remove hardcoded runbot_logs 2023-03-23 13:32:50 +01:00
Xavier-Do
44ec541e32 [IMP] runbot: docker failure management 2023-03-23 13:32:50 +01:00
Xavier-Do
0e14e6d922 [IMP] runbot: serealisation imps
Trying to log when the transaction is in error is useless and create
noise in the logs.

Flushing is also useless there now that we have the local logs,
and it makes the error confusing since the error does not come from the
log_counter update but from the update of the global state on the
parents global_results.
2023-03-23 13:32:50 +01:00
Xavier-Do
937747caec [IMP] runbot: remove dead code 2023-03-23 13:32:50 +01:00
Xavier-Do
c965c2c35a [IMP] runbot: add message queue
Message queue squeletton for future changes
2023-03-23 10:09:12 +01:00
Xavier-Do
2579a2d3fe [FIX] runbot: fix run step for no install config 2023-03-22 16:17:30 +01:00
Christophe Monniez
6fdd35ed50 [FIX] runbot: avoid empty negative test tags
When parenting a build error, if a test_tag is set on it, the tag is
transferred to the parent and cleared to an empty string.
In that case, a single `-` appears in the disabling tags and leads to an
apocalyptic situation ... the runbot builds don't not run any tests.

With this commit, the test_tags is set to `False`.
2023-02-28 12:16:07 +01:00
David James
1532bcab0f [FIX] fix typo in selection field value 2023-02-28 11:58:34 +01:00
David James
fa3808bf1e [FIX] runbot: fix dictionary changed size during iteration 2023-02-28 11:16:46 +01:00
Xavier-Do
f5caa87da1 [FIX] runbot: fix time related test 2023-02-28 10:59:47 +01:00
Xavier-Do
d3e3228921 [FIX] runbot: get_module remove prefix
Since removeprefix was not available in ubuntu 20.04, a easier alternative
using rebase was used.

The initial assumption was that the prefix would look like `odoo/addons/`
and won't be in the filename.

When the repo is enterprise, the prefix is `enterprise/` meaning that
module name ending with `enterprise` will be truncated

`repo._get_module('enterprise/mail_enterprise/static/src/widgets/form_renderer/form_renderer.js')`

will output

`mail_static`
2023-02-28 10:59:47 +01:00
Xavier-Do
f7a12c6359 [FIX] runbot: fix fetch tests 2023-02-06 10:16:07 +01:00
Xavier-Do
763b1af1a5 [FIX] runbot: disable host_default 2023-01-17 15:24:49 +01:00
Xavier-Do
27ac733df6 [IMP] runbot: automatic base master bundle
When adding a new project, if no branch matches a base name,
the created bundles won't have a version and it will fail.

A simple fix will be to add a master bundle for all projects.
2023-01-17 13:41:01 +01:00
Xavier-Do
9e0f0e6a75 [IMP] runbot: display errors for critical/warn 2023-01-13 15:57:25 +01:00
Christophe Monniez
1a108669ce [IMP] runbot: do not install wkhtml when value is empty 2023-01-13 15:33:05 +01:00
Xavier-Do
12c0a0edf6 [IMP] runbot: automatically transfer responsible
When an error is linked to another one, we don't expect it  to appear on
team and user dashboard. When adding a parent, this will transfer the
responsible from the child to the parent when applicable.
2023-01-13 15:32:17 +01:00
avs
6fffa0264a [IMP] runbot: make runbot.bundle::write() callable through xml-rpc
The XML-RPC implementation does not allow for receiving or sending
`None` values (both as query parameters and response).

Since the `write` method of `runbot.bundle` was overriden without
returning a value, an exception is raised when the method is called
through the external API.

This makes the `write` method return the value from its call
to `super()` which should be equal to `True` if all went well.
2023-01-13 15:32:01 +01:00
Xavier-Do
d011bb7f8c [IMP] runbot: make disable host configurable
The auto disable host is mainly usefull when there are a lot of host for
well configured repositories.

If for any reason a repo is corrupted on one host, this host will be
disabled until a manual intervention cleans the repo.

For other cases, where thjere are many repositories with not so many
host, it is most likely that a fetch will fail because of an invalid
repository configuration. Disabling the host in this case is not a good
idea.

With this commit, a settings allows to enable or disable this feature.
2023-01-13 14:46:02 +01:00
Xavier-Do
ecd105218c [IMP] runbot: parse warning and critical 2023-01-13 14:27:17 +01:00
Xavier-Do
2b8242cf42 [IMP] runbot: default empty value for result 2023-01-13 14:27:17 +01:00
Xavier-Do
6892546d94 [IMP] runbot: fail before contacting github if user cannot write on team 2023-01-13 14:27:17 +01:00
Xavier-Do
cd4c6b5e43 [IMP] runbot: better configure upgrade descriptions 2023-01-13 14:27:17 +01:00
Xavier-Do
37df18d54d [FIX] runbot: use params db_name when provided for upgrades 2023-01-12 11:54:53 +01:00
Xavier-Do
c9c64bccc7 [FIX] runbot: fetch member should be able to access token for users 2023-01-11 13:35:02 +01:00
Xavier-Do
06f9f62b1f [FIX] runbot: fix was alive 2023-01-11 12:41:39 +01:00
Xavier-Do
16fa0e1ad8 [IMP] runbot: add freeze list feature 2023-01-11 11:20:29 +01:00
Xavier-Do
788114776b [IMP] runbot: add python_code filter 2023-01-10 10:48:56 +01:00
Xavier-Do
fdb144a3af [IMP] runbot: allow to ignore forward-ports for a team 2023-01-10 10:47:59 +01:00
Christophe Monniez
1c49aaacf7 [IMP] runbot: add a test for _get_refs 2023-01-10 10:37:06 +01:00
Xavier-Do
56c08be631 [FIX] runbot: filter numerical branch names
Right now, a branch with a numerical name will be added to the database,
but it can conflict with pr since the name of a pr is a number.
This means that a unique (name, repo_id) constraints can be broken.
We could use the 'is_pr' in the unicity constraints to avoid this issue
but searching on branch name will give confusing result if some of them
can be numerical.

Moreover, a runbot branch name should start with the version name
meaning that a numerical branch name was a bad idea from the begining.
2022-12-27 10:37:30 +01:00
Xavier-Do
6d3663e9f6 [IMP] runbot: disable auto-tags from custom trigger 2022-12-26 12:31:09 +01:00
Xavier-Do
910843f06d [FIX]: fix codeowner
A corner case was discovered when a pr is open but the pr is not in the
codeowner commits.
2022-12-24 12:39:55 +01:00
Xavier-Do
ad573d64cf [FIX] runbot: manage falsy path_glob 2022-12-22 14:40:13 +01:00
Xavier-Do
5540f84667 [IMP] runbot: add priority queue for debuging
The main idea is to allow some build to use an extra slot from all host
if a bundle is in priority mode.

This is mainly for quick step debuging, mainly when modifying python
steps when the runbot is fully loaded.

This will also be usefull to concurrency test, by starting a build on
each host at the same time, even when some host are already fully loaded
2022-12-22 14:26:10 +01:00
Christophe Monniez
76cc74fcd9 [IMP] runbot: improve team form and build frontend page
* Hide useless pages on backend team form
* Add a team exceptions page on team form
* Show fixed errors as fixed on front build page
2022-12-22 14:21:59 +01:00
Xavier-Do
356843c680 [IMP] runbot: reduce concurrency
Right now, multiple build are read when managing build to schedule.

This is not usefull since the transaction is commited between each
of them. Moreover, the read build can be written from another host
adding another possibility to have a conccurent update.

Removing the prefetch_ids may help a little.
2022-12-22 11:25:04 +01:00
Xavier-Do
205d299c7d [IMP] runbot: add trigger list to team 2022-12-22 10:47:24 +01:00
Christophe Monniez
9ccf5a2c0e [IMP] runbot: add a reassign team wizard 2022-12-21 15:20:42 +01:00
Xavier-Do
c83f89fc23 [IMP] runbot: documentation and views imps
Add a small documentation for users, mainly about teams and codeowners.
Improves some views and hide some menu_items to keep interface easier
to navigate.
2022-12-21 13:00:42 +01:00
Xavier-Do
ada69222c9 [IMP] runbot: add an action to reassign team automaticaly 2022-12-21 10:58:30 +01:00
Xavier-Do
af7a0751fc [FIX] runbot: avoid recursion in create steps
Since the custom create was introduced, if a config is added in the
config data of a create step, the config can be dynamic. If the given
config contains a create step, this become recursive.

This is fixed in this commit by:
- Checking the parent_path depth in add_child. This will also work for
  python config.
- Consuming the params when adding the child
- Also cleanup the base custom multi config to use a specific step
2022-12-20 09:30:08 +01:00
Xavier-Do
92ed23c237 [FIX] runbot: manage team without github logins 2022-12-19 11:14:07 +01:00
Xavier-Do
25557e6116 [FIX] runbot: manage team without github logins 2022-12-19 11:09:15 +01:00
Xavier-Do
a67e51e600 [FIX] runbot: revert log_access and write in cache
Removing log_access has as side effect to add the foreign key to the
create_uid and write_uid fields. This is quite slow and will slow the
insert

Removing the fields is also not an good idea on such a large table

Puthing the value in cache and flushing should do the trick.
2022-12-16 16:59:59 +01:00
Xavier-Do
0d61f6c93b [IMP] runbot: add github login
This idea was postpone for a while since this was most a mergebot
responsability but having the github login of the user will help
for some team feature requests.

The main one is to only ping a team if the pr was not opened by a member
of the team. We want to let the team manager manage that as much as
possible so the team manager group will be able to write the user
github login (as well as the user himself) and add a list of non user
github_login to consider if not all user have a account on runbot.

This commit also improves the views for team managers.
2022-12-16 15:32:39 +01:00
Xavier-Do
3f2bf0112f [FIX] runbot: custom log_access fields shouldn't be automatic 2022-12-15 14:20:11 +01:00
Xavier-Do
02ed33c498 [FIX] runbot: keep log create date 2022-12-15 13:38:55 +01:00
Xavier-Do
0d6ec3e038 [FIX] runbot: fix invalid db_name log local
If the db_name does not stat with a build ind (or at least an int)
the query will fail because of 'local_pg_cursor'

Since a database can be create with an invalid name from the db manager
but still log in the runbot_logs, we need to manage all format.
Also add a limit to catchup if the db is full of logs, to avoid a Memory
error.
2022-12-15 12:54:50 +01:00
Xavier-Do
a6ce3dceb0 [IMP] runbot: add step description 2022-12-12 10:35:23 +01:00
Xavier-Do
2a82f3c1f7 [FIX] runbot: fw-bot codeowner fix 2022-12-01 11:29:25 +01:00
Xavier-Do
ee9b3b7570 [FIX] runbot: avoid excessive log_counter updates 2022-11-30 14:07:55 +01:00