Kind sir will merge your merge requests. Properly.
Kind Sir is a Gitlab satellite project.
It allows to automatically accept merge requests which got
specific number of upvotes during the code review with respect to build status.
Application reads config file and grabs a list of groups from Gitlab API to monitor.
The separate supervisor actor will be spawned for each group.
Once per minute groups’ supervisor spawns Repo Worker actor for each repository in
this group.
Repo worker tries to find .kind_sir.conf
file in the root of repository.
If there is no such file, worker will stop and repository will not
be processed. Otherwise Repo Worker will read this file and grab a list of
opened Merge Requests from the repository. After that it will check the number of
upvotes and downvotes for every merge request. And if request has
enought upvotes and meets the requirements of Veto settings and build status,
Repo Worker will try to merge it.
activator assembly
inside the repository directorykind_sir.jar
file produced by the assembly
from the root of project directory.private_token
of this user in Gitlab’s profile sectionjava -Dconfig.file=<your-config.conf> <kind-sir-assembly.jar>
git clone https://github.com/answr42/kind-sir.git
cd kind-sir
touch config.conf
and fill itdocker build -t kind-sir .
docker run --name kind-sir -d kind-sir
Kind Sir uses two kinds of configuration files:
kind_sir.conf
. Acceptance policy configuration placed in the rootApp configuration file is just a normal Lightbend Config file.
There are only two fields you can specify here:
https://your.gitlab.domain.name/help
and than choose:For example, let’s imagine you created config.conf
:
kindSir {
gitlab-url = "https://gitlab.acme.com"
gitlab-token = "ex_MT1jP5t1DeSnN4ka9"
gitlab-api-version = 4
}
After that you can run Kind Sir with command:
java -Dconfig.file=config.conf -jar kind-sir-assembly-0.1.jar
You should place config file named .kind_sir.conf
in the root of
every repository you want to be monitored by Kind Sir.
This is a regular JSON file.
You can find an example right in this repository.
There are also only three things to specify:
upvotes_threshold
: if the number of upvotes minus number of downvotes exceed specified number,veto_enabled
: true value means request will never be accepted ifignore_build_status
: if true, Kind Sir will merge request even if build failed orExample:
{
"upvotes_threshold": 2,
"veto_enabled": false,
"ignore_build_status": false
}