Commit Graph

1315 Commits

Author SHA1 Message Date
Xavier-Do
92f8c093bd [IMP] runbot: add childs stats to build stats 2021-08-12 11:27:29 +02:00
Xavier-Do
eb111002ed [IMP] runbot: make stagings automatically build all 2021-08-12 11:27:29 +02:00
Xavier-Do
2b8e5c5a91 [IMP] runbot: remove _log_access on build_stat
_log_access is not usefull, and increase disk space used by stats.
2021-08-04 10:46:59 +02:00
Xavier-Do
39eeb73f71 [FIX] runbot: fix keep_running
Keep running was broken for since 5.0.
This commit fixes the broken logic and adds an index
2021-08-04 10:46:59 +02:00
Christophe Monniez
b7a5dc3d8c [IMP] runbot: add an error manager group 2021-08-04 10:42:34 +02:00
Christophe Monniez
01371c5270 [REM] runbot: remove dead code 2021-08-04 10:40:13 +02:00
Andrii Skrypka
5b9c20877e [FIX] runbot: correctly get number type value from icp 2021-08-03 09:47:11 +02:00
Xavier-Do
b843fee8d9 [FIX] runbot: adapt routes and licenses 2021-07-27 16:11:49 +02:00
Xavier-Do
726c7ba423 [IMP] runbot: add static_run button to slots buttons. 2021-07-20 13:43:02 +02:00
Xavier-Do
de927d89e7 [IMP] runbot: cleanup and improve hook
When getting pull info, the alive state can be determined easily,
meaning that this field can join the "_compute_branch_infos" familly

Hook was catching some changes made on pr and was conditionnaly updating some fields
and triggering some other operations conditionaly depending on the action flag.
All of the information needed to update the pull info should always be present in the
 payload body, meaning that all fields can be updated at once in case some hook was missed,
 and additionnal operation can be triggered based on fields changes.
2021-07-20 13:24:01 +02:00
Xavier-Do
d9a09806e2 [IMP] runbot: add a static run link for documentation builds 2021-07-20 13:22:57 +02:00
Christophe Monniez
847622552f [IMP] runbot: limit memory usage of containers
In some conditions, it appears that a containerized build can eat up
all memory of the container host. This leads to disturbance of other
builds as the kernel OOM killer enters the dance.

With this commit, the docker ability to limit memory usage of a
container is used. The OOM killer will choose its victim among the
container processes.

The containers memory limit has to be set in the runbot settings. If not
set, no memory limit is used.
2021-07-15 11:15:38 +02:00
Christophe Monniez
4b16e889eb [FIX] runbot: update matplotlib to focal version
Matplotlib 3.0.2 cannot be `pip installed` on Focal.
2021-07-15 11:05:08 +02:00
Christophe Monniez
363c488c10 [IMP] runbot: add a reviewers field 2021-07-07 11:05:51 +02:00
Xavier-Do
87214a82a6 [IMP] info: log level debug to info
runbot servers are running with a log-level debug in order to have usefull
debug information, but this also causes some noise comming from odoo.

This pr changes most debug to info.
2021-07-02 15:05:42 +02:00
Xavier-Do
011bdc00e2 [IMP] add draft pr management + multiple custom fields
- Add draft pr management to avoid to trigger code owner on draft pr.
- Add check on falsy config on trigger id (avoid crash, usefull to disable trigger)
- Add extra params on custom trigger to avoid to write specific config every time.
- Trigger a new batch automaticaly when updating target/draft
2021-06-29 10:13:34 +02:00
Christophe Monniez
6e5d722882 [IMP] runbot: add a Dockerfile on project
Some projects may use a totally different Dockerfile. In order to avoid
new branches of those projects to automatically build with the generic
default Dockerfile, this commit adds the possibility to configure a
Default Dockerfile on a project.
2021-06-29 09:22:41 +02:00
Christophe Monniez
b015ec6840 [IMP] runbot: show bundles that use a Dockerfile
Before manipulating a Dockerfile, it can be useful to know which bundle
is using it.
2021-06-29 09:22:41 +02:00
Christophe Monniez
67d020a8b3 [IMP] runbot: update docker default for focal
Since Odoo 14.0, the recommended Ubuntu LTS release is Focal, the
default Docker should be updated accordingly.

A custom template with bionic have to be manually created on runbot
instances that still build Odoo < 14.0.

* A small change is made in the templates logic that builds the
  Dockerfile: a `runbot_pip` dict entry now exists in order to install the
  python libs required by the runbot. On the other hand, `additional_pip`
  should only be used to install optional python libs for Odoo.

* Upgrade Chrome version to 90.0.4430.93-1 as this one is currently in
  use on our current runbot instance. Just keep in mind that the Odoo
  screencast feature does not work anymore since Chrome 88.

* gsfont is added because of a bug [0] that affects python-reportlab in
  Focal.

* pyCrypto package is removed. It was used in an Odoo addon that
  disappeared in odoo/odoo@2738341c21

* dbfread, websocket-client are now installed as a deb package as they exists in Bionic and
  Focal

* pdfminer.six is now removed because a deb package exists in Focal but
  not in Bionic. It means that it has to be added in deb_packages_python
  in Dockerfiles for odoo > 13.0 and in additional_pip for odoo <= 13.0

[0]: https://bugs.launchpad.net/ubuntu/+source/python-reportlab/+bug/1918107
2021-06-29 09:22:41 +02:00
Xavier-Do
e65ebb570d [IMP] runbot: change ahead/behind visibility 2021-05-19 11:45:06 +02:00
Alexandre Fayolle
3c760870b5 [FIX] runbot: bug in duplicate module detection
The test in the original code will never fire because the value searched
for is not in the keys of the dictionary, but in one of the lists which
are in the values. Work around this by maintaining a reverse dictionary
module name -> commit and use this for the test.
2021-05-18 12:37:42 +02:00
Xavier-Do
0a37ff2f90 [FIX] runbot: don't log twice 2021-05-17 14:43:48 +02:00
Xavier-Do
6d4efcb470 [FIX] runbot: avoid failure for duplicate warnings 2021-05-17 14:23:18 +02:00
Christophe Monniez
b14a73b1d4 [IMP] runbot: enhance dockerfile tree view
When a dockerfile to_build field is False for any reason and a new
runbot is setup, it's easy to miss the point and builds that involves
this particular Dockerfile will fail on the new runbot.

With this commit, the Dockerfiles tree view is improved to easily spot
those kind of problems:

- to_build field is visible and the Falsy lines are in yellow (warning)
- the empty Dockerfile's are in red (danger)
- versions are now visible in the tree view too
2021-05-17 14:11:34 +02:00
Christophe Monniez
642844fdb5 [IMP] runbot: show red slots in batch tile
When a build slot is hidden in the batch tile but is responsible of the
batch failure, the failure reason may not be obvious for the user.

With this commit, an hidden slot appears if the slot build is in
failure.
2021-05-17 14:11:03 +02:00
Xavier-Do
5d3a2de698 [FIX] runbot: don't fail all branch discovery if one pull info fails.
Sometimes a pr pull info can fail.
- Most of the time it is only temporary and it will be successfull on next try.
- In some rare case the pr will always fail (github inconsistency) The pr exist in git but not on github api.
For this rare case, we store the pr in memory in order to unstuck other pr/branches update.
We consider that this error should not remain, in this case github needs to fix the inconsistency.
This is why the runbot model don't handle such a case for now.
Another solution would be to create the pr with fake pull info. This idea is not the best one
since we want to avoid to have many pr with fake pull_info in case of temporary failure of giothub services.
With this solution, the pr will be retried once every cron loop.
We dont except to have pr with this kind of persistent failure more than every few mounths/years.
2021-05-17 14:07:55 +02:00
Xavier-Do
514de022f4 [FIX] runbot: fix markdown code
When code blocks were containing markdown like text, the inside of the code
block was also formated.

This commit removes the code blocks before applying other formating and
place them back at the end.

closes #481
2021-05-10 15:11:21 +02:00
Xavier-Do
6279dfa442 [IMP] runbot: imp stat display:
- Adds a complete legend enabelling to display a custom subset of modules.
This is mainly to enable a vertical scroll on list since chart-js default
legend will be displayed on multiple column.

- Adds a "Noisy" order mode to find non-deterministic modules.

- Changes the build selection mode to a center one to easylly center
build of interrest and add a forward button.

- Small ui tweaks/fix to match new selection logic.
2021-04-13 10:35:30 +02:00
Xavier-Do
8e53dbd0db [FIX] runbot: hide testing builds from stats views. 2021-04-13 10:35:30 +02:00
Xavier-Do
84d9425bdc [FIX] runbot: various view fixes
- fix missing batch references on builds
- fix group on action buttons
2021-04-09 14:58:17 +02:00
Christophe Monniez
57bd00672d [IMP] runbot: add a chart page for build stats
Since 360e31ade4, it's possible to add statistics values to build
results but there was no practical way to analyze them.

With this commit, there is a new button on the bundle page that leads to
a chart page that displays those values.

The default reference build is last known good build of the bundle.
Values are filtered by key and only the most significant values are
displayed. The user can then refine the chart by changing the reference
build or the key and a few other options.

Co-author: Xavier-Do <xdo@odoo.com>
2021-04-09 14:10:37 +02:00
David James
19c312d92c [IMP] runbot: add an option to exclude paths from coverage report 2021-04-07 15:47:11 +02:00
Christophe Monniez
785a7796fb [IMP] runbot: allow conditional pip requirements
Before this commit, the `requirements.txt` from a specified odoo branch
(master by default) was always installed in the Dockerfile's.

We now allow to disable this feature to test Odoo with vanilla
distributions.
2021-04-07 11:35:33 +02:00
Christophe Monniez
6bd74c07c4 [IMP] runbot: allow to install Chrome from google
When choosing to install Chrome in a Dockerfile, the chrome version is
downloaded from Odoo nightly server. This make it difficult to test
with different versions of Chrome.

With this commit, we allow to install from Google in Docker files.

By default, the install remains from Odoo Nightly server but if the key
`custom_values['chrome_source']` is set to 'google' in a Dockerfile,
the specified version will be downloaded from Google servers when the
Docker image is built.
2021-04-07 11:35:33 +02:00
Christophe Monniez
50f803ec31 [FIX] runbot: allow larger upload on runbot odoo instances 2021-04-07 11:01:35 +02:00
Andrius Laukavičius
5337ecd11f [FIX] runbot: _compute_host_id
If you try to manually create bundle, Odoo will crash, because it will
try to use `name` value that is not set yet. For that we start computing
host_id once `name` is entered.
2021-04-07 11:00:55 +02:00
Xavier-Do
0ed4728518 [IMP] runbot: use last step in wakeup when possible 2021-04-07 10:31:05 +02:00
Christophe Monniez
0f4610c8bc [FIX] runbot: remove forgotten print 2021-03-16 10:45:47 +01:00
Xavier-Do
46269ada70 [FIX] runbot: fix logged message 2021-03-15 13:12:48 +01:00
Xavier Morel
318803d7bb [IMP] runbot_merge: tag PRs with a pseudo-branch on merge to master
If a PR got merged to master (or whatever the current development
branch is), there's no easy way to know what maintenance branch it
ended up landing in, except by asking git which branches contain the
commit (which can be rather slow).

Add a special case on merge which labels the PR with a pseudo-branch
patterned after the second-to-last branch of the project:

* if the branch ends with a number, increment the number by one
  e.g. 2.0 -> 2.1, 5 -> 5.1
* otherwise, just prefix with `post-` e.g. "maint" ->
  "post-maint" (that one doesn't sound very helpful, but I guess it's
  nice for the weirdoes who call their branches "natty narwhal" and
  shit)

Fixes #450
2021-03-02 14:28:32 +01:00
Xavier Morel
60af69b69f [FIX] runbot_merge: dashboard title should link to github
Currently links to self, which is not useful (the viewer is already
there).

Fixes #452
2021-03-02 14:28:32 +01:00
Xavier Morel
4e4e4303f6 [IMP] runbot_merge: add name_search override to PRs
Should allow filtering PRs by source or parent.

Fixes #458
2021-03-02 14:28:32 +01:00
Xavier Morel
0b1e33da7c [IMP] forwardport: mitigate cat-file not finding commit on updates
Fix #457 hopefully: I didn't manage to repro / create a test for.

It looks like in some cases during the update process the PR ref lags
behind the branch itself. This means `forwardport.updates` creates a
new commit, pushes it, then on the next iteration updates the local
cache, tries to find the commit we just pushed... and that fails.

I can only assume this is because when there's enough load on the
github side the update to the `info/refs` pseudo-file can fall
behind (it's now 4MB and holding nearly 65k refs).

So cheat: take the commit we just pushed to the dev remote
and... immediately push it to the local cache under a dummy branch,
which we delete. Since we only gc "1 day ago" this should not vacuum.
2021-03-02 14:28:32 +01:00
Xavier Morel
8a924fb4b7 [FIX] forwardport: duplicates forwardport on edition
On edition of an intermediate PR in a chain, merging the PR would lead
to *it* being forward-ported, duplicating the PRs already created
from *its* source.

Add a check for PRs in the target branch with the same source,
suppresses the forward-porting of the newly merged PR.

Fixes #451 (hopefully)
2021-03-02 14:28:32 +01:00
Xavier Morel
952dafa45c [IMP] forwardport: feedback on conflict
append `git status` data to stderr, should be somewhat more
informative especially when a conflict is a DU (where the file has
been deleted on one side, so there is no conflict marker anywhere).

Fixes #461
2021-03-02 14:28:32 +01:00
Xavier Morel
a5f2d14707 [CHG] forwardport: try to create PRs in draft mode
Fall back to creating in not-draft mode if that doesn't work: draft
pull requests on private repositories requires the Team plan.

Closes #459
2021-03-02 14:28:32 +01:00
Xavier Morel
9c1585383a [IMP] forwardport: git commands logging
- When updating the local repo cache, always capture both stdout and
  stderr and log them out rather than having them in journalctl hard
  to relate to the main log.
- In the git layer, capture stderr by default and log it automatically
  on command failure.
2021-03-02 14:28:32 +01:00
Xavier Morel
2aeecb68b9 [FIX] forwardport: completely update PR data when forwarding updates
The process did properly update the state, but not the squash state.

It's somewhat unclear whether the state should be fully reset and
require reapproval though. Maybe only the validation should be reset?
The CI will eventually run and either succeed (re-validating) or
fail (devalidating, hopefully) but I'm not entirely sure this is
correct.
2021-03-02 14:28:32 +01:00
Xavier Morel
a541781ee0 [FIX] test proxy recordset union / concatenation
Apparently I wrote this when I was a dumbshit and did not think that
Python sets are implemented completely separately from dicts
and *remain unordered*.

As a result, the simplistic set union would not properly conserve
record order, which it should.
2021-03-02 14:28:32 +01:00
Xavier Morel
2b64f7feb3 [REM] duplicate method in test proxy
Probably a duplication I missed when I merged the proxies from
runbot_merge and forwardport.
2021-03-02 14:28:32 +01:00