Commit Graph

1075 Commits

Author SHA1 Message Date
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
Christophe Monniez
0cb07e73db
[FIX] runbot: return closest branch when PR head name are equals (#11)
When searching for the closest branch name in a target repo, if the PR
head names are equals, a branch method is called on a dictionary, causing
a traceback.

With this commit, the method is called on a branch object instance.

closes #11
2018-04-19 16:16:24 +02:00
Moises Lopez - https://www.vauxoo.com/
fa6a0944f4 [REF] runbot: hook - Find the right repo from payload
This change allow use a global webhook from github based on the organization without use a configuration for each repository.

closes: #5
2018-04-19 09:59:27 +02:00
Martin Trigaux
4a558741e0 [FIX] runbot: remove unused argument
Leftover from the old api conversion
Making an error when trying to kill a build
2018-04-10 09:02:36 +02:00
Moisés López
9de7c2f8cf [FIX] runbot: Use correct name of new parameters 2018-03-28 10:29:39 +02:00
Moisés López
8b4b941e06 [FIX] runbot: dictionary don't have iteritems attibute 2018-03-28 10:29:39 +02:00
Moisés López
a886dba4ab [FIX] runbot: Fix decode error 2018-03-28 10:29:39 +02:00
Moisés López
1e7edad85a [FIX] runbot: Fix KeyError if there are sticky branches without builds
Before this commit, when a clean instance of the runbot is installed,
there was a KeyError on the frontend because there was not builds for
the sticky branches.
2018-03-28 09:42:52 +02:00
Moisés López
c9de61a320 [REF] runbot: Consider empty returned values
When installing a clean runbot instance a bad query is made because
there is not any build yet.

With this commmit, the query is not made when there are no builds
directories found on the filesystem.
2018-03-28 09:42:52 +02:00
Moisés López
dcdd16038b [REF] runbot: Remove used variable before assigned
When the lock file creation fails, the file descriptor is not assigned.
Before this commit, an ValueError was raised in such a situation.
2018-03-28 09:38:51 +02:00
Luis González
23ad9f4bc0 [FIX] runbot: Add missing HTML attributes aria-* (#1)
Some HTML attributes were missing, and are required to ensure good
compatibility with screen readers.

The following attributes are included:
- `aria-expanded`: this should be present in all dropdown menus
- `aria-label`: this should be present in all links and buttons which
  don't show text, but icons or images.
2018-03-26 14:36:43 +02:00
Julien Legros
3cacd8db52
[FIX] runbot: build garbage collection 2018-03-23 14:20:34 +01:00
Julien Legros
f8cbae79e1
[FIX] runbot: nginx reload
Actually check the return code and do not raise any exception doing so.
2018-03-21 13:06:32 +01:00
Christophe Simonis
dc3659c6f1 [FIX] runbot: use connected user when logging kill/rebuild
As these methods are call in sudo mode, we should use request's user to
have a meaningful log entry.
2018-03-20 10:20:53 +01:00
Julien Legros
278d4ed449
[FIX] runbot: guess_result conversion to record api 2018-03-16 10:16:44 +01:00
Julien Legros
297d502afd
[FIX] runbot: adapt navbar view to v11 2018-03-15 13:38:02 +01:00
Julien Legros
3d71619dcd
[FIX] runbot: make repo_id stored again
Oversight of the code migration.
2018-03-14 16:02:08 +01:00
Julien Legros
328a25a31f
[FIX] runbot: do not rely on copy behavior for rebuilds
Instead of marking most fields as `copy=False` to be able to use the
copy method for rebuilds, we create the build explicitly. We also
forbid to copy builds as it doesn't make much sense to begin with.

As for duplicates, it wasn't always possible to rebuild them. The
rebuild now injects a specific context key (force_rebuild). This allows
duplicates to undergo a rebuild. The side-effect of writing on previous
builds is also removed[1].

[1]: it's not obvious from the diff but the porting to the V8 API
should have yielded

duplicate.write({'duplicate_id': build_id.id})

instead of

build_id.write({'duplicate_id': build_id.id})
2018-03-14 15:05:17 +01:00
Christophe Monniez
f5dcb7b371 [FIX] runbot_cla: fix enforce utf-8 even when runbot locale is different
The CLA md file must be encoded in UTF-8 but before this commit, the
file was opened with the locale of the system running the runbot. That
way, a UnicodeDecodeError was raised when the CLA was UTF-8 and not the
runbot locale was different. Leading to wrong validations.

This commit enforce UTF-8 encoding when opening the CLA's.
2018-03-14 11:07:55 +01:00
Christophe Simonis
9ff0e171e0 [FIX] runbot: resurrect badges 2018-03-13 18:14:15 +01:00
Christophe Monniez
e9a292373f [FIX] runbot: compute build time and don't copy from previous build
Before this commit, the job_end was always None because of a time2str
function with no return. So the job_time was the same as the job age.
Also, the result and times were copied from the prvious build. Displayed
time and results were wrong.
2018-03-13 16:38:20 +01:00
Julien Legros
1543c8d0d8 [FIX] runbot: allow rebuild and kill 2018-03-13 15:01:58 +01:00
Christophe Monniez
0b1ff4dd49 [FIX] runbot: add the dasboard view for sticky branches
During the runbot migration to Odoo 11.0, the dashboard was lost in
Limbo.
2018-03-13 11:15:39 +01:00
Christophe Monniez
5b8184890e [FIX] runbot: sync the build sequence with the build id
The branch order was wrong because of a zeroed build sequence.
2018-03-12 18:14:17 +01:00
Christophe Monniez
08beb51f2e [fix] runbot: make fast_launch find the last build 2018-03-12 17:49:35 +01:00
Christophe Monniez
4b0eac3b21 [FIX] runbot: compute repository url 2018-03-12 17:43:24 +01:00
Christophe Monniez
889df07bf6 [FIX] runbot: remove bad indentation 2018-03-12 16:59:35 +01:00
Christophe Monniez
bd715451a9 [FIX] runbot: allow webhooks to work 2018-03-12 15:39:44 +01:00
Christophe Monniez
21c31b4c3c [REF] runbot, runbot_cla: upgrade to Odoo 11.0
The previous code of runbot and runbot_cla was made for Odoo API version
8.0. This commit makes it work with Odoo API 11.0 and Python 3.

Also, the present refactoring splits the code into multiple files to
make it easier to read (I hope).

The main change due to Python 3 is the job locking mechanism:
Since PEP-446 file descriptors are non-inheritable by default.
A new method (os.set_inheritable) was introduced to explicitely make
fd inheritable. Also, the close_fds parameter of the subprocess.Popen
method is now True by default.

Finally, PEP-3151 changed the exception raised by fcntl.flock from IOError to OSError
(and IOError became an alias of OSError).

As a consequence of all that, the runbot locking mechanism to check if a
job is finished was not working in python3.
2018-03-12 14:36:33 +01:00
Christophe Monniez
e33881c9b4 [REF] README: update the readme file for the brand new repo 2018-03-08 16:59:39 +01:00
Christophe Simonis
c340e18506 [FIX] runbot: force lowercase build dest (used as dbname prefix) 2018-02-07 16:00:28 +01:00
Christophe Monniez
966e12ee71 [FIX] runbot: add dependency on base_setup
To install properly, Runbot needs to find base.menu_config which is
defined in base_setup res_config_view.
2017-11-20 11:14:54 +01:00
Christophe Simonis
0c3c8a0b75 [FIX] runbot: init method may not exists on parent class 2017-11-14 16:58:56 +01:00
Christophe Simonis
cdf4cd8287 [IMP] runbot: allow to rebuild deathrow builds 2017-09-28 15:06:47 +02:00
Christophe Simonis
c322a10ccc [IMP] runbot: guess future result of testing build 2017-09-21 18:24:44 +02:00
Christophe Simonis
03da1e9339 [IMP] runbot: automatically link logs to build
The linked build is extracted from dbname via a trigger on new row
creation.

This improve rendering of build page.

A migration script is added to link existing logging entries to
corresponding build and remove invalid ones.
Note that this migration script can take a long time.
2017-09-21 17:44:32 +02:00
Christophe Simonis
eb267ffa44 [FIX] runbot: correct redirect url 2017-09-18 13:41:08 +02:00
Christophe Simonis
e265607b3f [FIX] runbot: correct logging in method _ask_kill 2017-09-18 13:35:43 +02:00
Christophe Simonis
54f3cb9488 [FIX] runbot: force integer build ids in routes 2017-09-18 13:27:27 +02:00
Denis Vermylen
fb1e1dfd53 [IMP] runbot: add kill button (+ deathrow state)
Allow logged users to kill builds that are pending or testing.

The kill button solves the following problem:

When you have a community and enterprise branch with pull request.
The enterprise PR gets fetched before the branch by runbot, so it
builds with the community master branch instead of the corresponding
community branch. As the branch shares the same HEAD as the PR,
so no other build is done for the branch.

Previously you had to wait the build to finish building, then rebuild it
from the branch, taking twice the time necessary. Now you'll be able to
kill & rebuild it just after pushing the branch.

Also having a kill button is globally a nice to have feature.
2017-09-18 12:43:02 +02:00