Sign inSign up

texthtml/gitlab-merge-bot

By texthtml

•Updated about 8 years ago
Archived

Bot assistant for code review and merge requests approval for Gitlab

Image
1

594

texthtml/gitlab-merge-bot repository overview

⁠Gitlab Merge Bot

⁠Usage

⁠Configure a project for code review

In Settings, General:

  • 🗹 Only allow merge requests to be merged if the pipeline succeeds
  • 🗹 Only allow merge requests to be merged if all discussions are resolved

In Settings, Repository, protect every branches :

  • Branch: * (wildcard)
  • Allowed to merge: Masters
  • Allowed to push: No one
⁠Bot account configuration

Choose which gitlab account will be associated to the bot and make sure he have the role Master on the repository to be able to install webhooks and merge code into master.

⁠Bot configuration
  1. Go to projects administration page
  2. Create a new project configuration
  3. Enter Gitlab hostname and token
  4. Choose the project you want to configure
  5. Click "Setup…"
  6. On the new project Actions menu, choose "Install Webhook"
⁠Usage
⁠Review
  • ask for a code review: r?
  • ask for changes: r-
  • approve a merge request: r+

⁠Installation

⁠With docker
docker run \
    --rm \
    -v ./db:/data/:rw \
    -e HOOK_URL=https://this-container-gitlab-accessible-url/ \
    texthtml/gitlab-merge-bot
⁠Locally
⁠Requirements
⁠Configuration
echo DATABASE_URL=/path/to/db.sqlite > .env
echo HOOK_URL=https://url.to/merge-bot/ >> .env
⁠Intialization
diesel database setup
⁠Running
cargo run
⁠Development

Once configured and initialized:

ROCKET_ADDRESS=0.0.0.0 nodemon -e rs,toml,env,tera,sql -x cargo -- run

Tag summary

Content type

Image

Digest

Size

572.9 MB

Last updated

about 8 years ago

docker pull texthtml/gitlab-merge-bot