Commit Graph

414 Commits

Author SHA1 Message Date
Xavier Morel
6494ea6cb0 [ADD] runbot_merge: webhook signature support 2018-09-03 13:16:36 +02:00
Xavier Morel
35f33cee6d [FIX] runbot_merge: a few warnings 2018-09-03 13:16:36 +02:00
Xavier Morel
323aa20053 [ADD] runbot_merge: remote github plugin 2018-09-03 13:16:36 +02:00
Xavier Morel
b35a24ca62 [FIX] runbot_merge: undesired merge conflict
Not quite sure why local didn't hit it but don't really care either.
2018-09-03 13:16:36 +02:00
Xavier Morel
50b9943d78 [FIX] runbot_merge: review action is APPROVE
Despite the review *state* being APPROVE*D*.

Fix test & handling in mock github.
2018-09-03 13:16:36 +02:00
Xavier Morel
3de8262b50 [REM] runbot_merge: tests of updating a merged or closed PR
Github apparently doesn't sync merged/closed PRs (which makes sense
but isn't really documented) so strip out test and assume that never
happens (with a log error in case it ever does).
2018-09-03 13:16:36 +02:00
Xavier Morel
7451a94358 [IMP] runbot_merge: PR source branch/label handling
Remote's labels are not entirely under our control as the part before
":" is the *owner* of the source repo => introduce additional "owned"
fixture to handle this case, as it may diverge from the "user" role if
running the tests against an organisation.
2018-09-03 13:16:36 +02:00
Xavier Morel
0725c77323 [IMP] runbot_merge: logging of comment commands (or lack thereof) 2018-09-03 13:16:36 +02:00
Xavier Morel
381c504584 [IMP] runbot_merge: logins -> user roles
Can't really assume we can get the github logins "user" or "reviewer"
to run the test suite remotely, so add an indirection and backronym
those to *roles* instead. The local test suite has identical roles &
logins, but the remote version does not.

Also use the "other" role for any random user, and don't create its
partner up-front.

Also renamed the self-reviewer user to self_reviewer, that's a bit
less weird when dealing with e.g. ini files.
2018-09-03 13:16:36 +02:00
Xavier Morel
91937aac27 [FIX] runbot_merge: incorrect changes spec/order (depth) 2018-09-03 13:16:36 +02:00
Xavier Morel
f67bdd8c5e [FIX] runbot_merge: incorrect relation name in M2O 2018-09-03 13:16:36 +02:00
Xavier Morel
4005eea72a [FIX] runbot_merge: github API error
Turns out PATCH /git/refs/:ref returns a 422 when the ref does not
exist, rather than the 404 I'd expected.

Also improve the error message by including the JSON body which tends
to be more descriptive/helpful than the reason for Github's API.

Maybe I should replace all raise_for_status() by printing the JSON
body instead...
2018-09-03 13:16:36 +02:00
Xavier Morel
d98d40389d [IMP] runbot_merge: pluginify github mock
This is the preparation of an attempt to make these tests work with
both a local github mock (in-memory) and a remote actual github.

Move a bunch of fixtures relying on the specific github
implementation (and odoo-as-library access) to the "local" plugin,
including splitting the "repo" fixture.

The specific fixtures will likely have to be adjusted as the
remote endpoint is fleshed out.
2018-09-03 13:16:36 +02:00
Xavier Morel
5e64f79730 [ADD] runbot_merge: update squash flags when PR commits are updated
If the PR's commits count changes, the squash state should be updated
to match/reflect.
2018-09-03 13:16:36 +02:00
Xavier Morel
df2d19302b [REM] runbot_merge: support for squash+/squash-
AL thinks it's not useful and it's better to always squash/rebase a
single commit & merge multiple. Mark tests as xfail'd instead of
removing them.

Also mark test_edit_retarget_managed as skipped explicitly
2018-09-03 13:16:36 +02:00
Xavier Morel
b30bb09319 [FIX] runbot_merge: when closing a staged PR, cancel the staging 2018-09-03 13:16:36 +02:00
xmo-odoo
7233179d6a [FIX] runbot_merge: only cancel active staging on p=0
Not when any priority is set on any PR…
2018-09-03 13:16:36 +02:00
Xavier Morel
9286b346e8 [FIX] runbot_merge: IDE warnings 2018-09-03 13:16:36 +02:00
Xavier Morel
34497a91b4 [FIX] runbot_merge: don't try to stage urgent PRs in error 2018-09-03 13:16:36 +02:00
Xavier Morel
47428a4580 [IMP] runbot_merge: only label PR if not created merged/closed
Would generate a ton of GH API churn when synchronising.
2018-09-03 13:16:36 +02:00
Xavier Morel
39a0d723af [ADD] runbot_merge: tag PR to signify state changes 2018-09-03 13:16:36 +02:00
Xavier Morel
7033952913 [ADD] runbot_merge: reviews support
Reviews are interpreted like comments and can contain any number of
commands, with the difference that APPROVED and REQUEST_CHANGES are
interpreted as (respectively) r+ and r- prefixes.
2018-09-03 13:16:36 +02:00
Xavier Morel
49c8fdbed2 [IMP] runbot_merge: prioritize p0 more
* p0 cancel existing stagings in order to be staged as soon as
  possible
* p0 PRs should be picked over split batches
* p0 bypass PR-level CI and review requirements
* p0 can be set on any of a batch's PR, matched PRs will be staged
  alongside even if their priority is the default
2018-09-03 13:16:36 +02:00
Xavier Morel
e6f5b84a19 [IMP] runbot_merge: add PR ID to commit message when merging 2018-09-03 13:16:36 +02:00
Xavier Morel
ea9203c359 [IMP] allow delegate reviewers to retry and r- 2018-09-03 13:16:36 +02:00
Xavier Morel
781b679648 [FIX] runbot_merge: de-f-string-ify 2018-09-03 13:16:36 +02:00
Xavier Morel
933559da04 [IMP] runbot_merge: repos shoud be unique
Having the same repository in two different projects makes no sense,
the two projects will conflict with one another.
2018-09-03 13:16:36 +02:00
Xavier Morel
e52d08ecdf [ADD] runbot_merge: a merge bot
No actual dependency on runbot, should be usable completely
independently.
2018-09-03 13:16:36 +02:00
Christophe Monniez
cfba7da06d
[IMP] runbot: skip an additional port for chrome
In a near future, Odoo will use Chrome Headless instead of phantomjs.
Chrome needs a port to listen to and it was decided that it will be
http_port + 2.
With this commit, we ensure that this port is not used by another build.

Closes #30
2018-08-14 13:57:31 +02:00
Olivier Dony
b98b8dedd9 [IMP] runbot: make nginx server_name more specific
Avoids overly generic vhost declaration, and makes config easier to
understand.

We only want to allow such hosts:
    <build_dest>.runbotX.odoo.com
    <build_dest>-<db_name_extension>.runbotX.odoo.com

Where <db_name_extension> is usually "all" or "base".
2018-07-30 12:11:39 +02:00
Christophe Simonis
e815571d14 [ADD] runbot: new /runbot/glances route
Allow to have a glances on sticky builds status.

Closes: #28
2018-06-25 09:26:35 +02:00
Christophe Monniez
52cdd9fd27
[FIX] runbot: add build type
The unicode icon added in the build subject is not clear for the users.
In that state, it's not easy to add a title on the icon or the subject.

With this commit, a build type field is added to differentiate the
builds and add the appropriate icon and title.

Closes: #24
2018-06-18 10:42:23 +02:00
Christophe Monniez
8471c8c35b
[FIX] runbot: improve coverage processing
When a build with coverage is killed during the tests, the coverage
result is set to 100%.

With this commit, coverage result is verbosely skipped if the coverage
file does not exists.

Also, the coverage module is no longer user to retrieve the coverage
value as it was already calculated. It's faster to grep the html file
than to recompute the value.

As the coverage builds takes a longer time than normal builds, the
timeout is increased for those kind of builds (as it was already done for the
CPU limit).

Finally, the omitted patterns were wrong and are now fixed with this
commit.

Closes #25
2018-06-15 13:30:04 +02:00
Christophe Monniez
822433a3bb
[IMP] runbot: add link to the latest coverage
On the frontend, the coverage is a static indication.
With this commit, this indication is now a link to the coverage details
page.

Closes: #26
2018-06-12 09:04:09 +02:00
Christophe Monniez
a3da5cad04
[IMP] runbot: increase cpu_limit
When the Odoo instances are spawned for tests, they have a time limit
set on their CPU usage. This limit is hard-coded in the _spawn method
calls.

As the number of tests are increasing, their duration increases too.
As this limit is inherited by subprocesses, if a phantomjs test
last too long, the test is killed alone.

Finally, when the coverage is enabled, the tests duration is
approximately increased of 1.5 times.

With this commit, the cpu_limit of the two main tests jobs are
increased. When the coverage is used, the cpu_limit is increased.

Closes: #23
2018-06-11 17:58:29 +02:00
Christophe Simonis
806ae08460 [IMP] runbot: color "pending" tag accordingly to some limits
Closes: #22
2018-06-07 11:28:27 +02:00
Christophe Monniez
b1f155c1a2
[IMP] runbot: kill older builds when a new one is created
When a new commit is found and a new build is created, if a user
pushes more commits in the same branch a few minutes later, it causes
more builds in testing phase, resulting in a CPU waste.

With this commit, previous builds in testing phase in non sticky
branches are killed when a new build is created.

Closes: #20
2018-06-06 16:31:33 +02:00
Christophe Monniez
c6fe87e18b
[IMP] runbot: update nginx template
When someone tries to log in an old runbot build that is not running
anymore, he lands on the runbot instance that was running the build.
Also, all the running builds are allowed on all runbot instances,
leading to the same behavior.

With this commit, only the builds that are running on the runbot
instance can be reached, others are defaulted to a 404.

closes #21
2018-06-01 16:37:43 +02:00
Christophe Simonis
7fcbf6e653 [IMP] runbot: visually mark rebuilds 2018-06-01 16:31:57 +02:00
Christophe Monniez
5feec55e87 [FIX] runbot: limit the number of builds in other builds button
Actually, the "Other builds" button can increase the page size and
increase the page loading time.
With this commit, the number of other builds visible in the button is limited to 100.
2018-05-29 10:56:21 +02:00
Christophe Monniez
223ba61828 [IMP] runbot: add coverage result on builds
When the coverage is activated on a branch, the coverage result is not
stored.

With this commit, the coverage result will be stored on a build.
The last result will be shown on the frontend for sticky branches.

Also, an extra_parameter field is added on the build model.
2018-05-28 09:40:01 +02:00
Christophe Monniez
6dd997dcdd [FIX] runbot: reset frontend table layout
With the 'fixed' table layout, the first column of the frontend takes
too much place.
2018-05-28 09:40:01 +02:00
Christophe Monniez
eaf393fa1f [IMP] runbot: add icons for reverse dependency builds
When a reverse dependency is in testing, pending or deathrow state, there is no
icon in the depending build box.
This commit adds icons for testing, pending and deathrow states.
Also, icons are now displayed in the repository name order.

closes: #19
2018-05-28 09:40:01 +02:00
Christophe Monniez
46c4c54337 [IMP] runbot: force a rebuild when commit in reverse dependency
When a build fails in a repo that depends on another repo, it's difficult
to figure out from which commit it comes in the depending repo.

If this commit is applied, when a new commit is found in a repo's sticky
branch, the latest build from the same branch name, in the depending
repo will be forced to rebuild.
2018-05-28 09:40:01 +02:00
Christophe Monniez
5d23d0957a [FIX] runbot: remove deprecated method
The refresh method is deprecated and invalidate_cache should be used
instead. Also, since the new API, the cache is automatically
invalidated, hence this removal.
2018-05-28 09:40:01 +02:00
kujiu
0d2075db3e [IMP] Improve a11y and usability with titles and aria-labels on buttons
Closes: #14
2018-05-28 09:40:01 +02:00
Christophe Monniez
9555370fa6
[FIX] runbot: update github status on duplicates too
Actually, when a build is a duplicate of another build, its github status is not updated.
e.g. a pull request may not have a github status but its corresponding
branch have a gtihub status.
With this commit, all builds will have their github status updated based
on the corresponding build status.

Thanks for your help @xmo-odoo 

closes: #3
2018-04-27 13:39:33 +02:00
Christophe Monniez
d7f727a0d0 [FIX] runbot: add proper db argument when build is a duplicate
When a build was a duplicate, the link to the running build instance was
leading to the duplicate instance with the db filter of the current
build. Because of that, the user was then redirected to the database selector.

With this commit, the link button gives the proper database argument.

Thanks @RomainLibert for reporting this issue.
2018-04-25 14:46:00 +02:00
Christophe Monniez
efbce41e2e
[IMP] runbot: choose the python version for coverage
When code coverage was processed the 'coverage' utility was called the
same way regardless of the Odoo version. That was the cause of two
problems:
1) In some OS packages, the 'coverage' executable was renamed to
'python-coverage' and 'python3-coverage'
2) Since version 11.0, Odoo needs python3

With this commit, the coverage module is called from python '-m'
argument and the python version is chosen from the Odoo executable
shebang.

closes: #12
2018-04-20 16:16:24 +02:00
Christophe Monniez
12542808a9 [IMP] runbot: log latest commit hash and message when server is built
When a server is built based on dependency_ids, only the branch refs was
logged. In this situation, it's difficult to reproduce a build locally
in the exact same conditions.

With this commit, the latest commit hash and message of this
branch is also logged.
2018-04-20 10:37:52 +02:00