Commit Graph

1037 Commits

Author SHA1 Message Date
Xavier-Do
c7fccf3b56 [FIX] runbot: fix monitoring routes 2020-01-15 12:07:01 +01:00
Christophe Monniez
8cc82b7dde [FIX] runbot: fix compute previous_version and intermediates
When changing the sticky value in a branch form, it triggers the
computes of previous version and intermediate versions.

In the onchange situation, the branch.id is a NEW id and it fails with a
traceback.

With this commit, a verification is made to ensure that the id is there.
2020-01-15 10:22:18 +01:00
Christophe Monniez
45799df094 [FIX] runbot: temporarily freeze the coverage version
As the Odoo requirements were recently updated, the last RUN entry in
the Docker image was rebuilt on our runbot instances.

Since that moment the coverage builds are failing with an import error.
After investigation, it appears that the latest coverage version modifies the sys.path.
A bug report was written for coverage: https://github.com/nedbat/coveragepy/issues/919

For that reason, this commit freeze the coverage version until this bug
is fixed.

Also, the os import problem in conatainer.py is fiexed.
2020-01-14 13:46:58 +01:00
Xavier-Do
300f39003f [MERGE] runbot: migration to odoo 13.0 2020-01-14 13:26:26 +01:00
Xavier-Do
d0dff374b0 [FIX] runbot: fix previous versions computation
ORM does not support non_searchable.non_stored dependency.
thus, the closest_sticky.previous_version dependency will log an error
when previous_version is written.
this dependency is usefull to make the compute recursive, avoiding to have
both record and record.closest_sticky in self, in that order, making the record.previous_version
empty in all cases.
Writing self on sticky will mitigate the problem. but it is still posible to
have computation errors if defined_sticky is not sticky. (which is not a normal use case)
2020-01-14 13:24:58 +01:00
Xavier-Do
ec88a68e8a [IMP] runbot: avoid partial invalidation 2020-01-14 13:24:58 +01:00
Xavier-Do
163fa6ca59 [FIX] runbot: fix views 2020-01-14 13:24:58 +01:00
Xavier-Do
acf31c2820 [FIX runbot: remove _update_nb_children] 2020-01-14 13:24:58 +01:00
Xavier-Do
2b70c0bcc4 Revert "[IMP] runbot: use counts for global states"
This reverts commit 54f9b9b546.
The main reason is linked to inconsistency in state compute because
of error in nb_ computations.

This was to avoid concurrent update, witch is not a such a big problem
now since workers are no longer using crons. (retry on failure is faster).
2020-01-14 13:24:58 +01:00
Xavier-Do
650a93fee7 [FIX] runbot: fix auto test-tags False 2020-01-14 13:24:58 +01:00
Xavier-Do
93b901dcdd [IMP] runbot: simplify views and adapt to odoo13
mainly fixes datetime and bootstrap layouts
2020-01-14 13:24:58 +01:00
Xavier-Do
9215a23cc1 [FIX] change version number to avoid second execution when migrating to 13.0 2020-01-14 13:24:57 +01:00
Xavier-Do
3ef33a5320 [FIX] runbot: clear environment, do not reset
Resetting env will make this env unusable with the new orm,
breaking field recomputes logic
2020-01-14 13:24:57 +01:00
Xavier-Do
20f97798d9 [FIX] runbot: use create_single decorator everywhere
All create in odoo are now create_multi. This is a quick and dirty
fix to make it work with runbot.
2020-01-14 13:24:57 +01:00
Xavier-Do
8dcaa6669b [FIX] runbot: allow portal user to see frontend 2020-01-14 13:24:57 +01:00
Xavier-Do
4e694ffefa [IMP] runbot: addapt tests to 13.0 2020-01-14 13:24:57 +01:00
Xavier-Do
1dcea28f45 [FIX] runbot: make field name unique 2020-01-14 13:24:57 +01:00
Xavier-Do
1069598616 [REF] runbot: use selection_add 2020-01-14 13:24:57 +01:00
Xavier-Do
df157f7742 [REF] runbot: add descriptions 2020-01-14 13:24:57 +01:00
Xavier-Do
2b53c7cfd0 [REF] runbot: adapt cron path 2020-01-14 13:24:57 +01:00
Xavier-Do
e706bb70c2 [REF] runbot: remove deprecated model_cr 2020-01-14 13:24:57 +01:00
Xavier-Do
24189fd0ee [REF] runbot: runbot deprecated api.multi 2020-01-14 13:24:57 +01:00
Xavier Morel
63271cd82e [IMP] runbot_merge: better notification of stored field update
Using `modified` seems safer than just blowing the cache with respect
to stored computed fields depending on PR state (not sure there are
any but it's likely).
2020-01-13 08:47:58 +01:00
Xavier Morel
f91629f693 [FIX] runbot_merge: v13 computed field compatibility
In v13, computed fields *must* have their value set on all records.
2020-01-13 08:47:45 +01:00
Xavier Morel
08f73ea3d3 [FIX] runbot_merge: convert priority field to a regular integer
In 13.0, the value of a selection field can't be an integer anymore.
2020-01-13 08:43:57 +01:00
Xavier Morel
27e9a4f9ee [FIX] runbot_merge: provide explicit labels on fields
Two fields can't have the same label, because of the field names,
there were field label conflicts.
2020-01-13 08:43:10 +01:00
Xavier Morel
0bdc824c2e [FIX] runbot_merge: incorrect name_get implementation
It's supposed to return a list of pairs, not a dict.
2020-01-13 08:42:25 +01:00
Xavier Morel
99d2d426eb [FIX] runbot_merge: api.multi decorator removed 2020-01-13 08:42:08 +01:00
Xavier Morel
a30a1c08e7 [FIX] runbot_merge, forwardport: missing model descriptions
Really can't be arsed to care, just want to remove the warning.
2020-01-13 08:41:54 +01:00
Xavier Morel
060709ac42 [ADD] forwardport: missing access rights 2020-01-13 08:39:47 +01:00
Christophe Monniez
ff051b7ae0 [FIX] runbot: use a logging handler that loves logrotate
When the linux logrotate system rename the runbot logfile used by the
new builder script, the script continue to write in the reotated file.

With this commit, the WatchedFileHandler is used. This handler is
specialy crafted to handle this situation, it detects the file renaming
and automatically changes to the new file that have the old filename.
2020-01-07 09:46:55 +01:00
Christophe Monniez
926ab4a9d9 [FIX] runbot: fix build_error test tags validation
When trying to remove test_tags on a build_error, the validation fails
because it tries to iterate on False. Also, the ValidationError
exception was not properly imported.

With this commit, the validation is fixed and a test is added.
2020-01-06 11:52:13 +01:00
Christophe Monniez
f4ef66e029 [FIX] runbot: catch exceptions during main loop
* If an excpetion occurs during the main loop, the builder crashes. With
this commit, the main_loop is in a try/catch.

Also:

* remove unused imports
* move the first log after the Odoo import because Odoo changes the
  process timezone to UTC
2019-12-19 15:50:52 +01:00
Christophe Monniez
501142c561 [IMP] runbot: allow to rebuild a branch
When a repo is set to "no_build", there is no way to force a branch to
build from the backend.

With this commit, a button is added on a branch form to ask rebuild of the
branch, even when the repo is set to "no_build".
2019-12-19 15:41:11 +01:00
Xavier-Do
eaee010b25 [IMP] runbot: add relation between branches
Migration tests comming on runbot, it will be usefull to have quick
way to obtain branches related to current build.

This commit adds a field for the colsest sticky branch, previous version
and intermediates stickies.

Example when last sticky is saas-13.2:
branch_name: master-test-tri
closest_sticky: master
previous_version: 13.0
intermediate_stickies: saas-13.1, saas-13.2
2019-12-19 15:38:53 +01:00
Xavier Morel
7d79ad8d3e [FIX] forwardport: don't keep the commit date
This is not super useful and causes issues with runbot as it uses
commit dates to decide how "old" branches are, and ignores (doesn't
create when it scans them) branches more than a month old.

So the forwardport branches will be completely ignored (not considered
let alone tested) if we happen to forward-port a PR last updated more
than a month ago. Which is somewhat inconvenient.

Closes #274
2019-12-19 15:25:23 +01:00
Xavier-Do
328ba2d9c2 [IMP] runbot: adding some log 2019-12-18 17:37:06 +01:00
Xavier-Do
9ae816a23d [IMP] runbot: add some log 2019-12-18 17:27:33 +01:00
Christophe Monniez
7606c03c35 [IMP] runbot: allow to change prefix in multi wizard
Also fix the modules that were not set on the config step.
2019-12-18 16:36:14 +01:00
Xavier-Do
cede4b936e [FIX] runbot: fix docker state and rebuild button
When docker is stopped, end command cannot execute.
Thus the state is considered as running.
2019-12-18 16:30:01 +01:00
Xavier-Do
426b7af2cb [REF] runbot: refactor sheduler 2019-12-18 16:30:01 +01:00
Christophe Monniez
ae5f2906bf [REF] runbot: proof of concept standalone script
Actually, when deploying multiple instances of runbot, a full odoo
installation is needed.

With this commit, a single standalone (sort of) can be used to start a
runbot builder. It uses the same database as the runbot scheduler.
This script just reserve pending builds for himself and starts to build.

This is just a proof of concept. It should work alongside with a
standard runbot installation.
2019-12-18 16:30:01 +01:00
Xavier-Do
36a35b14c8 [IMP] runbot: update gitignore for static databases 2019-12-18 14:31:49 +01:00
Xavier-Do
630e1d55f7 [IMP] runbot: custom python result
This commit add the possibility to add custom checks to python steps,
as well as ignoring triggered result if log of level error/warning
is not considered as a problem.
2019-12-18 14:31:49 +01:00
Christophe Monniez
6c64bbb49b [IMP] runbot: improve build log view
Co-authored-by: Xavier-Do <xdo@odoo.com>
2019-12-17 16:08:31 +01:00
Christophe Monniez
5552c16102 [IMP] runbot: create a broken symlink in all server sources
As the --upgrade-paths options does not work as expected in Odoo, a
symbolic link has to be created in odoo/addons/base/maintenance pointing
to the migration scripts.

The runbot uses Docker read-only volumes to access the sources that are
shared between builds, preventing the creation of such a link.

With this commit, a symbolic link is created right after the export of a
commit only when the repo is a "server" repo.

This link is broken outside of the Docker volumes but uses the mount
points of the sources inside the container.

Two ir.config_parameter's are used to enable and configure this feature:

* runbot_migration_ln: the relative path where the link should be placed
  (typically odoo/addons/base/maintenance)

* runbot_migration_repo_id: the id of the migration scripts repo, used
to determine the name of the mount point inside the Docker container

A change is also made in the "reverse dependcy build" to avoid the
creation of a build in the migration repo for each push in its
dependency. Simply set the no_build field on this migration repo.
2019-12-16 13:10:55 +01:00
Xavier-Do
8d20c2ce79 [IMP] runbot: add Commit to run_python steps context 2019-12-13 13:44:01 +01:00
Xavier-Do
2ed0b9c4d4 [FIX] runbot: ref_time rounding.
`getmtime` will return a 6 digit float when postgress will only store 5.
Depending on rounding, _get_refs have 1/2 chance to make an update
when it shouldn't. Rounding below psql precision before comparing and
storing should fix this.
2019-12-09 16:32:27 +01:00
Xavier-Do
e5a2f98c59 [IMP] runbot: store times in other tables.
Sometimes, sheduler may have a hard time to create build.
The transaction can be verry long when there are many repo and
a lot of new commits. Writing get_ref_time on repo will fail
due to concurrent update rollbacking the whole transaction.

This is supposedly because of hook occuring during the transaction.
With this new model, hook will only perform an insert, and shouldn't
interfer with ref_times.
2019-12-09 15:40:02 +01:00
Christophe Monniez
3f806416d6 [FIX] runbot: adapt test to new docker_state method 2019-12-06 11:40:38 +01:00