Commit Graph

1168 Commits

Author SHA1 Message Date
Xavier Morel
dd22f687bf [IMP] runbot_merge: allow filtering out branches from repositories 2020-01-24 13:39:14 +01:00
Xavier Morel
6b3c81a177 [FIX] make pytest cross-module-runnable
The pytest suite had been partially unified between mergebot and
forwardport but because of session-scoped modules it could not run
across those.

Make the db cache lazy and able to cache multiple databases, and move
the "current required module" to function scoped, this way things
should (and seem to) work properly on runs involving mergebot & fwbot.

Next step: xdist! (need to randomise repo names for that, probably).
2020-01-24 13:39:14 +01:00
Xavier Morel
7dfa973b57 [IMP] runbot_merge, forwardport: move required statuses to repository
Allows more flexibility in project composition as different
repositories can each have their own CI passes.
2020-01-24 13:39:14 +01:00
Xavier Morel
b2f9bd697c [FIX] runbot_merge: testsuite compatibility with pytest-xdist
randomise the name of the repositories created so they don't collide
and lead to odd results when running concurrent test cases which
specify the same repo name (a common property).

As a result, ignore the "no delete" flag for creation: there should be
no way to land on a pre-existing repo name even if we didn't clean
them up.

Also stagger the check of a running ngrok process: when pytest starts
its worker processes, all workers will run the tunnel fixture, and
since the ngrok process takes some time to get into a stable run state
chances are multiple workers will fail to connect and try to start
ngrok concurrently, which blows up as ngrok just kills the extra
processes instead of merging / proxying into an existing session. A
proper lockfile would probably be better but...

Fixes #297
2020-01-24 13:36:05 +01:00
Denis Ledoux
d0138712bd [ADD] runbot_merge: automatic reviewer de-provisioning
When an employee sadly leaves Odoo,
the Odoo production database (odoo.com) will call these routes
in order to remove the reviewer rights automatically.

So a user who no longer works for Odoo can't "r+" Github PRs.

This is related to odoo/internal#617
2020-01-24 13:28:18 +01:00
Xavier-Do
e65859c161 [FIX] runbot: catch ValueError instead of RunbotException in safe_eval 2020-01-24 13:09:36 +01:00
Xavier Morel
4bd65a4dff [MERGE] v13 migration of mergebot/forwardbot 2020-01-23 16:35:10 +01:00
Xavier Morel
5dccb141b7 [FIX] runbot_merge: disable homepage added enabled by website
Pages take over from redirections which really is a pain in the ass
when trying to find out why the bloody redirection seemingly refuses
to work.

Note: can't use the record tag because homepage_page is marked as
noupdate, so we have to bypass the flag checking.
2020-01-23 13:57:33 +01:00
Xavier Morel
b1ce1e82e0 [REM] runbot_merge: str override on pull_request
Interaction of CacheMiss and BaseModel is fucked, leading to an
infinite loop when trying to provide useful __str__ on a model (by
accessing model fields).
2020-01-23 10:08:55 +01:00
Christophe Monniez
edda6c0265 [IMP] runbot: build docker image once per loop turn
At this moment, the Docker image is built at the beginning of each
runbot build. This blocks the _scheduler while the image is built.

With this commit, the image is built before calling the _scheduler and
is not linked to a runbot build.

Also, the necessary dirs are created in the static path before starting
the loop.
2020-01-22 13:50:01 +01:00
Christophe Monniez
61101eaf46 [FIX] runbot: fix separtor class in build template 2020-01-22 13:32:27 +01:00
Christophe Monniez
e4e2634de1 [FIX] runbot: keep tests directory
Since 857821e4 a screenshot can be saved in the build directory under
the "tests" subdirectory.
Unfortunately, this directory is cleaned in case of local_cleanup.

With this commit, the 'tests' subdirectory is kept in place.
2020-01-22 13:32:27 +01:00
Xavier Morel
3f44bb5c9e [FIX] runbot_merge: styling crap
bs4 yields complete vomit on the template as-is (see:
https://imgur.com/a/XIMn7MX).

Add a bunch of color and styling overrides to get something closer to
the original, and move the existing styles to a "proper" scss file
while at it.
2020-01-21 11:21:14 +01:00
Xavier Morel
5d1772a9a5 [FIX] runbot: redirect to the relevant build on actions
Currently killing, waking or rebuilding a build then redirects to the
repository root which is worse than useless: you've lost the build you
come from, and for rebuilds it's no help getting to the new build.

Since it's very easy to go from a build to its repository, redirect to
the "most useful" build instead:

* if rebuilding the current build (from its page), open the page of
  the new build which was just created
* otherwise reload the current page whatever it is
2020-01-21 09:21:02 +01:00
Xavier-Do
4ae6907e3a [FIX] runbot: keep description on exact rebuild 2020-01-20 14:44:16 +01:00
Christophe Monniez
ca4768230d [FIX] runbot: avoid crash when creating migration symlink 2020-01-17 17:14:12 +01:00
Christophe Monniez
bf9ec0b7db [FIX] runbot: add file command to build Odoo 8.0 and 9.0 2020-01-17 17:10:25 +01:00
Xavier-Do
eede4dcd77 [IMP] runbot: filter hidden on monitoring page 2020-01-17 16:36:30 +01:00
Xavier-Do
3f997cff25 [IMP]: runbot: improve create performances. 2020-01-17 14:41:18 +01:00
Xavier-Do
9556723617 [FIX] runbot: fix exact rebuild without config_data 2020-01-17 14:41:18 +01:00
Xavier-Do
7058868c0f [IMP] runbot: select for update in ask_kill
When a build has a lot of children, _ask_kill can fail due to concurrent_update.
This solution locks all build before reading/updating builds.
2020-01-17 14:41:18 +01:00
Xavier-Do
534bb728ce [IMP] runbot: add parent_path 2020-01-17 14:41:18 +01:00
Xavier-Do
a2256fffb8 [FIX] runbot: don't detect duplicate on rebuild. 2020-01-17 14:41:18 +01:00
Christophe Monniez
cb05f2b9d8 [FIX] runbot: use template1 when creating databases 2020-01-17 13:53:52 +01:00
Xavier-Do
2274f7ab8b [FIX] runbot: handle externally killed docker.
If a docker is killed from outside, the start file will still be there but
not the end file. (when restarting docker service for instance)
This commits add a docker_state specific to non running docker
with start a file, that should be handled like unknow state:
This state is acceptable for a while, but build should be killed
if this state remains for to long.
2020-01-16 14:47:40 +01:00
Xavier-Do
d75c4f085f [FIX] runbot: fix duplicate id and improve global_state 2020-01-16 13:41:29 +01:00
Xavier-Do
c58d1626ea [FIX] runbot: config_data in duplicates and rebuild 2020-01-15 17:19:42 +01:00
Christophe Monniez
e56bb7a943 [IMP] runbot: allow kwargs in monitoring page 2020-01-15 14:14:53 +01:00
Christophe Monniez
0c8678e671 [IMP] runbot: add a config_data field on build
When two steps in the same build needs to exchange informations, some
hacks have to be used. E.g. using the extra_params fields to store comma
separated values.

With this commit, a config_data field is added alongside with a
JsonDictField that automatically transform the data into json.
2020-01-15 13:49:33 +01:00
Christophe Monniez
a7f1b94c41 [IMP] runbot: add a description field on build 2020-01-15 13:32:38 +01:00
Xavier-Do
190f03ab1e [FIX] runbot: update hook time as sudo on rebuild request 2020-01-15 12:40:38 +01:00
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