runbot/runbot/models
Christophe Monniez 5dd889de3c [IMP] runbot: split branch creation and pending builds creation
When searching for new builds by parsing git refs, the new branches are
created as well as the pending builds in the same _find_new_commits
method.

With this commit, this behavior is splitted into two methods, that way,
it's now possible to create missing branches without creating new
builds. The closest_branch detection is enhanced because all the new
branches are created before the builds (separated loops).

The find_new_commits method uses an optimized way to search for
existsing builds. Before this commit, a build search was performed for
each git reference, potentially a huge number.

With this commit, a raw sql query is performed to create a set of tuples
(branch_id, sha) which is enough to decide if a build already exists.

A test was added to verify that new refs leads to pending builds.

Also, a performance test was added but is skipped by default because it
needs an existing repo with 20000 branches in the database so it will
not work with an empty database. This test showed a gain of performance
from 8sec to 2sec when creating builds from new commits.

co-authored by @Xavier-Do
2019-05-03 10:34:49 +02:00
..
__init__.py [IMP] runbot: add dependencies to build 2019-04-25 17:58:51 +02:00
branch.py [IMP] runbot: add dependencies to build 2019-04-25 17:58:51 +02:00
build_dependency.py [IMP] runbot: add dependencies to build 2019-04-25 17:58:51 +02:00
build.py [IMP] runbot: split branch creation and pending builds creation 2019-05-03 10:34:49 +02:00
event.py [REF] runbot, runbot_cla: upgrade to Odoo 11.0 2018-03-12 14:36:33 +01:00
repo.py [IMP] runbot: split branch creation and pending builds creation 2019-05-03 10:34:49 +02:00
res_config_settings.py [FIX] runbot: properly convert update frequency into integer 2019-03-11 22:01:17 +01:00