Commit Graph

687 Commits

Author SHA1 Message Date
Christophe Monniez
e769a9d2af [FIX] runbot: improve the way a database name is choosen for running
When a build is reaching the run_run_odoo step, a database has to be
set. If none are found in the build params, the one from the last step
is choosen. Historically, the last one in the `Split` config was `all`
but now, the last one is `base`.

With this commit, if none are found in build params, `all` is choosen if
found in any install config steps. As a default, the one from the first
step is choosen.
2020-12-04 15:03:37 +01:00
Christophe Monniez
3b6487b969 [FIX] runbot: fix _is_docker_step to incidentallly fix log menu
Since 3657a65b20 docker_run is called outside of the step and python
steps have to set the `docker_params` variable. This breaks the computed
`log_list` because the string `docker_run(` is searched in python
steps code to determine if it's a docker_step.

With this commit, the `docker_params = ` is searched instead.
2020-11-26 18:05:00 +01:00
Xavier-Do
7519406e3f [FIX] runbot: to_upgrade for complement should use base_id 2020-11-26 13:35:09 +01:00
David James
190f2ed356 [IMP] runbot: serve badges for projects which are not accessible to the public 2020-11-24 15:18:20 +01:00
Xavier-Do
4ab669e371 [IMP] runbot: add to_upgrade option
For now, the sticky flag is used to define bundle to use as target to upgrade.
The plan for future is to continue to test upgrade, even if the bundle is not sticky anymore.
This new flag will allow to remove sticky for old branche.
This will also allow to disable upgrda tests for still sticky branches when needed.

This commit also filter source bundle based on this flag
(before that all base bundle where used as source, even if not sticky)
2020-11-24 15:14:23 +01:00
Christophe Monniez
6aab868883 [IMP] runbot: add a commit form and search 2020-11-24 15:13:59 +01:00
Xavier-Do
d76a41537c [IMP] runbot: add batch_dependent triggers
Params mechanism are a way to avoid to rebuild with the exact same params.
Commit is the main identifier to know if two builds are the same, ususally
commit_link are not usefull to uniquify params, exept when the mergebase is
in use as in security check (based on diff).

We would also like to avoid to have red diff-based build in sticky/base branches when the
ci is ignored on a pr, but we want to keep the diff display on new batches
(lines and files changed).
We need a way to know if it is a is_base bundle. This was an initially forbidden behaviour
because of duplicate detection.

This commit add a batch_dependent flag. This will enable the use of the batch in the
fingerprint, making it unique per batch and disabling duplicate detection/ in this
case we can use the "is_base" information from the bundle + avoid false duplicate
detection if trigger is based on mergebase-commit diff. (pr based on another pr now merged)
2020-11-24 15:13:00 +01:00
Christophe Monniez
2556145843 [FIX] runbot: do not count linked errors
On the build errors frontend page, the linked errors are displayed too.
With this commit, they are removed from the search query.
2020-11-23 12:15:21 +01:00
Christophe Monniez
733ab2dd43 [IMP] runbot: try to improve dashboard bundle line title 2020-11-18 16:49:45 +01:00
Christophe Monniez
9637976fef [IMP] runbot: bring back copy bundle name button 2020-11-18 16:49:45 +01:00
Christophe Monniez
9c7cee657d [IMP] runbot: improve build error frontend page
On the build error web page, a regular assigned error is not shown to
all users.

With this commit, a regular build error (not only random) will be shown
if the error is assigned.
2020-11-18 16:49:45 +01:00
Christophe Monniez
c6a1d202a1 [IMP] runbot: parse log redirects to the created error
When builds logs are parsed by using the contextual button, the client
stays on the same page even if a build error is created.

With this commit, the client is now redirected to the created/found
build error(s).
2020-11-18 16:49:45 +01:00
Christophe Monniez
e51a27bbbb [FIX] runbot: fix build error creation form 2020-11-18 16:49:45 +01:00
Xavier-Do
87512ae78c [IMP] runbot: improve coverage
- execute coverage results in case of failure
- fix coverage links
- use coverage directly
2020-11-18 13:36:41 +01:00
Xavier-Do
559e10754e [FIX] runbot: fix wakeup 2020-11-12 14:02:00 +01:00
Xavier-Do
3657a65b20 [IMP] runbot: call docker_run outside steps
When calling a step from a python step, it is impossible to alter some parameter, the only solution is to copy all step code.
With this change, python step are now able to override docker_run parameter of another step by modifying the dict returned by run_* steps
and assigning the result to "docker_params".

This will mainly be used to set the correct docker_image for migration pre and post test. This can also be used to alter a command,
like removing the pip install or adding extra pre/post operation on the command.
2020-11-11 10:47:26 +01:00
Christophe Monniez
4dec2c5f5c [FIX] runbot: fix warning during dockerfile test 2020-11-10 17:33:18 +01:00
Christophe Monniez
79f7fc9ed2 [FIX] runbot: fix default image_tag
Also fix Docker build process return code.
2020-11-10 11:03:30 +01:00
Christophe Monniez
981cb7e1b6 [IMP] runbot: use a Dockerfile model
Currently, runbot is using a single Dockerfile maintained in a data file
in the source code. This situation is not convenient for testing Odoo in
different environments.

With this commit, a Dockerfile Odoo model is used to allow usage of
multiple Docker containers.

This model comes with a pre-defined Dockerfile that can be used to build
the current Odoo supported versions (12.0 up to 14.0).
2020-11-10 09:52:48 +01:00
Xavier-Do
92ac1d4737 [FIX] runbot: fix field label 2020-10-20 15:26:41 +02:00
David James
237e931e57 [IMP] runbot: add extra parameters and environment variables to run stages 2020-10-19 11:29:39 +02:00
Xavier-Do
7e2d7c65a1 [FIX] runbot: fix message formating 2020-10-19 01:30:39 +02:00
Xavier-Do
43075a59e6 [IMP] runbot: allow to define errors policy for _git decode 2020-10-15 16:54:47 +02:00
Xavier-Do
1985917702 [FIX] runbot: add limit on log length 2020-10-15 15:55:33 +02:00
Xavier-Do
45034d362d [FIX] runbot: inverted condition 2020-10-15 12:09:40 +02:00
Xavier-Do
bd69c0dfa0 [FIX] runbot: manual is on trigger, not slot 2020-10-15 11:28:20 +02:00
Xavier-Do
f9272cb207 [IMP]: add linitng tools (+bunch of small fixes) 2020-10-15 10:38:36 +02:00
Xavier-Do
c3cc9013df [IMP] runbot: use last pylint version 2020-10-14 18:08:47 +02:00
David James
58eefd3b52 [FIX] runbot: serve badges for non-default projects 2020-10-12 16:39:57 +02:00
Christophe Monniez
91de4f9314 runbot: bump pdfminer.six to version 20200720
Odoo.sh team discrovered that pip also install pycryptodome alongside
with pdfminer 20181108. This installation causes clashes with pycrypto
that may be used elsewehere in Odoo code. This version was used in order
to stick with the Debian version but it appears that Debian fixed that
issue in the deb package [1] and [2]. As the runbot uses the pypi
version instead of the patched Debian package, the runbot could face the
same problems.

So as the issue is fixed in 20200720, this commit will install it in the
Dockerfile.

So we can stay sync with Odoo.sh. Thanks guys.

1.https://metadata.ftp-master.debian.org/changelogs/main/p/pdfminer/pdfminer_20181108+dfsg-3_changelog
2.https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=919008
3.https://github.com/pdfminer/pdfminer.six/releases/tag/20200720
2020-10-01 20:15:45 +02:00
Xavier-Do
67f6eb12c5 [IMP] runbot: improve build order
The old order based on status is not really needed anymore:

- Scheduled builds have a special condition and already have a low priority.
- Indirect builds don't exist anymore
- It is actually questionnable to postpone rebuild. Sometimes they are needed but stuck.

This new proposition will keep subbuild scheduling close to parent build. Some build may take 2 hours
because they are parallelized and children are stuck. Priority should be defined by top parent.
2020-09-25 15:20:26 +02:00
Christophe Monniez
6c3f14ed61 [IMP] runbot: add bundle_ids to ErrorLog SQL view 2020-09-25 11:18:46 +02:00
Xavier-Do
0e2f75c5d6 [FIX] runbot: typo 2020-09-23 14:09:23 +02:00
Xavier-Do
03b82e712a [FIX] runbot: allow to disable screencast globaly 2020-09-23 13:49:35 +02:00
Xavier-Do
b991eb5b70 [IMP] runbot: enable screencast, add access control, small fixes 2020-09-23 13:27:59 +02:00
Christophe Monniez
17f0458d06 [FIX] runbot: host must be null instead of emptry string 2020-09-23 00:29:44 +02:00
Christophe Monniez
6cf0b3e128 [IMP] runbot: add ffmpeg tool to Dockerfile
This will allow screenscasts on runbot.
2020-09-22 19:57:49 +02:00
Christophe Monniez
73426d9348 [IMP] runbot: add pdf417 library
The pdf417gen python library is needed for the l10n_cl_edi. As this module
is not mandatory, the library was not added in the requirements.txt
file.

In order to test the feature on the runbot, this commit adds the library
in the Docker container.

Related work:
    odoo/odoo#54995
    odoo/enterprise#12080
    odoo/enterprise@8290bfaf
2020-09-15 13:58:56 +02:00
Christophe Monniez
b63cc4510c [FIX] runbot: allow to change build host from interface 2020-09-14 14:47:37 +02:00
Xavier-Do
e1e965778b [FIX] runbot: keep host for child when host is assigned. 2020-09-14 11:29:21 +02:00
Xavier-Do
0a766d0a1a [FIX] runbot: simplest base example without pr 2020-09-13 13:25:32 +02:00
Xavier-Do
675e2f1688 [IMP] runbot: manual host 2020-09-11 15:12:36 +02:00
Xavier-Do
45721cdf6c [IMP] runbot: runbot 5.0
Runbot initial architechture was working for a single odoo repo, and was
adapted to build enterprise. Addition of upgrade repo and test began
to make result less intuitive revealing more weakness of the system.

Adding to the oddities of duplicate detection and branch matching,
there was some room for improvement in the runbot models.

This (small) commit introduce the runbot v5.0, designed for a closer
match of odoo's development flows, and hopefully improving devs
experience and making runbot configuration more flexible.

**Remotes:** remote intoduction helps to detect duplicate between odoo and
odoo-dev repos: a commit is now on a repo, a repo having multiple remote.
If a hash is in odoo-dev, we consider that it is the same in odoo.
Note: github seems to manage commit kind of the same way. It is possible
to send a status on a commit on odoo when the commit only exists in
odoo-dev.
This change also allows to remove some repo duplicate configuration
between a repo and his dev corresponding repo.
(modules, server files, manifests, ...)

**Trigger:** before v5.0, only one build per repo was created, making it
difficult to tweak what test to execute in what case. The example use
case was for upgrade. We want to test upgrade to master when pushing on
odoo. But we also want to test upgrade the same way when pushing on
upgrade. We introduce a build that should be ran on pushing on either
repo when each repo already have specific tests.
The trigger allows to specify a build to create with a specific config.
The trigger is executed when any repo of the trigger repo is pushed.
The trigger can define depedencies: only build enterprise when pushing
enterprise, but enterprise needs odoo. Test upgrade to master when pushing
either odoo or upgrade.
Trigger will also allows to extract some build like cla that where
executed on both enterprise and odoo, and hidden in a subbuild.

**Bundle:** Cross repo branches/pr branches matching was hidden in build
creation and can be confusing. A build can be detected as a duplicate
of a pr, but not always if naming is wrong or traget is invalid/changes.
This was mainly because of how a community ref will be found. This was
making ci on pr undeterministic if duplicate matching fails. This was
also creating two build, with one pointing to the other when duplicate
detection was working, but the visual result can be confusing.
Associtaions of remotes and bundles fix this by adding all pr and
related branches from all repo in a bundle. First of all this helps to
visualise what the runbot consider has branch matching and that should
be considered as part of the same task, giving a place where to warn
devs of some possible inconsistencies. Associate whith repo/remote, we
can consider branches in the same repo in a bundle as expected to have
the same head. Only one build is created since trigger considers repo,
not remotes.

**Batch:** A batch is a group of build, a batch on a bundle can be
compared to a build on a branch in previous version. When a branch
is pushed, the corresponding bundle creates a new batch, and wait for
new commit. Once no new update are detected in the batch for 60 seconds,
All the trigger are executed if elligible. The created build are added
to the batch in a batch_slot. It is also possible that an corresponding
build exists (duplicate) and is added to the slot instead of creating a
new build.

Co-authored-by d-fence <moc@odoo.com>
2020-09-10 13:44:38 +02:00
Xavier Morel
0b1b36d10c [FIX] runbot: mis-migrated test
73f720a55c refactored the runbot tests,
and amongst other things created a single patch point for the "mock
root" as a testcase attribute.

One of the tests was missed during that refactoring, likely because
it's skipped by default.
2020-07-08 08:15:45 +02:00
Christophe Monniez
af00bf16e7 [IMP] runbot: add ocrmypdf package to Dockerfile
The ocrmypdf suite of tools are needed by task #2238654.

Altough this package will be optional for Odoo users, it has to be
usable by dev's in order to test and/or fix the feature.
2020-06-19 15:26:31 +02:00
Christophe Monniez
9684c2d97e [FIX] runbot: avoid unallowed characters in docker names
Docker container names are derived from the dest and step name. The dest
is itself derived from the branch name.

In some rare cases, it happens that a character not allowed by Docker
appears in the container name computed by the runbot.

With this commit, a sanitize_container_name function is used to remove
unallowed characters at the container utility level.
2020-06-17 10:15:37 +02:00
Christophe Monniez
5ad74635e0 [IMP] runbot: install postgresql-client 12 in Dockerfile
The postgresql-client in the Dockerfile is the one provided by the
Debian package. When the postgresql server on the host has a higher
version than the client, some builds may fail (for example, dumping a
database with the pg_dump).

With this commit, the postgresql-client 12 from the postgresql repo is
used in the Dockerfile.
2020-05-28 16:30:38 +02:00
Xavier-Do
3bf9b263f0 [FIX] runbot: send status only once.
Runbot can send status multiple time for the same hash:
- if transaction fails in scheduler and is retried
- if multiple subbuild are failing

Leading to multiple issues:
- when github receive more than one failure status, mergebot will
be notified multiple times and send multiple mail (for forward ports mainly)
- github will answer `422 Unprocessable Entity for url...` after
1000 status.

This fix proposes to limit number of status:
- By avoiding to send status for orphan build (parent status will never change)
- By storing last send status to avoid to notify multiple time
- By sending status post commit to avoid to contact  github in case of failure.
This will also slightly reduce transaction time by removing an http request.
2020-04-24 11:39:36 +02:00
Christophe Monniez
b517df4ff0 [IMP] runbot: try to fetch multiple times before disabling
Sometimes, it happens that a `git fetch` fails with an error code 128
for example. When this happens, the runbot host is immediately disabled.

During investigations of such cases, we found that simply retrying the
fetch command works.

With this commit, the fetch command is tried 5 times with an increasing
delay before deciding to disable the runbot host.
2020-04-24 11:35:01 +02:00
Christophe Monniez
4c4b7213bb [IMP] runbot: remove pull_head_name patch filter
Since we store the target_branch_name, filtering out pull head names
that contains `patch-` is not necessary anymore.

This commit is one first step towards a clean refactoring.
2020-04-03 14:53:21 +02:00