Giter VIP home page Giter VIP logo

review-bot's Introduction

review-bot

Main CI WorkFlow

gitlab review-bot

Settings

Step 1: Create Private Token

Step 2: Deploy Review Bot

docker run -d -p 2640:2640 \
    -e BOT_SCM_HOST=https://gitlab.com \
    -e BOT_SCM_TOKEN=<your-private-token> \
    -e BOT_SCM_SECRET=<your-webhook-secret> \
    zc2638/review-bot:latest
  • https://gitlab.com replace with the actual gitlab server address
  • <your-private-token> replace with the token generated by step1
  • <your-webhook-secret> replace with a custom password for the webhook, which can be a random string

Step 3: Generate Webhook Secret

  1. Directly access the interface to request to obtain the secret key

GET /secret?namespace=zc&name=test

  1. Visit Online API Doc http://<your-server-address>/swagger/ui

Step 4: Add Project Webhook

  • add webhook to associated project, URL is http://<your-host-address>/webhook
  • the review-bot user must have your project permissions
  • webhook must set sufficient permissions(e.g. CommentsConfidential CommentsPull request events)

Step 5: Add Project Config

Please add the .gitlab/review.yml configuration file to the default branch of the project repository.
You can refer to the .gitlab directory settings of this project.

# can use /lgtm
reviewers:
  - reviewer1
  - reviewer2

# can use /approve
approvers:
  - approver1
  - approver2

# merge request settings
pullrequest:
  # The merge information is mainly based on the title of PR
  # otherwise it is mainly based on the content of <!-- title --><!-- end title --> in PR description template
  squash_with_title: true

# custom label settings
custom_labels:
  # Operation instructions in comments
  - order: /kind cleanup
    # Label name associated with the instruction
    name: kind/cleanup
    # Automatically add prefix for merged submission information
    short: cleanup
    # Label background color
    color: #33a3dc
    # Label description
    description: "kind: cleanup code"

  - order: /area scheduler
    name: area/scheduler
    color: #96582a
    description: "area: scheduler service code area"

Step 6 (optional): Add Merge Request Template

  • Download at url GET /download?type=gitlab
  • Unzip and move the directory gitlab to .gitlab in your project

You can refer to the .gitlab directory settings of this project.

Please Enjoy it

Deploy

Local

go run github.com/zc2638/review-bot/cmd -c config/config.yaml

Docker

docker run -d -p 2640:2640 \
    -e BOT_SCM_HOST=https://gitlab.com \
    -e BOT_SCM_TOKEN=<your-private-token> \
    -e BOT_SCM_SECRET=<your-webhook-secret> \
    zc2638/review-bot:latest

Config

change config file in config/config.yaml

server:
  port: 2640
scm:
  host: https://gitlab.com
  token: <your-private-token>
  secret: <your-webhook-secret>
Configuration Item Environment Variable Description
server.port BOT_SERVER_PORT bot server listening port
scm.host BOT_SCM_HOST source code management address
scm.token BOT_SCM_TOKEN private token
scm.secret BOT_SCM_SECRET webhook secret

review-bot's People

Contributors

mageluoen avatar zc2638 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

dapengjacky

review-bot's Issues

同学,您这个项目引入了208个开源组件,存在3个漏洞,辛苦升级一下

检测到 zc2638/review-bot 一共引入了208个开源组件,存在3个漏洞

漏洞标题:jwt-go 安全漏洞
缺陷组件:github.com/dgrijalva/[email protected]+incompatible
漏洞编号:CVE-2020-26160
漏洞描述:jwt-go是个人开发者的一个Go语言的JWT实现。
jwt-go 4.0.0-preview1之前版本存在安全漏洞。攻击者可利用该漏洞在使用[]string{} for m[\"aud\"](规范允许)的情况下绕过预期的访问限制。
影响范围:(∞, 4.0.0-preview1)
最小修复版本:4.0.0-preview1
缺陷组件引入路径:main@->github.com/dgrijalva/[email protected]+incompatible

另外还有3个漏洞,详细报告:https://mofeisec.com/jr?p=aa46d0

请问有使用示例文档吗

感谢您的项目。请问下在README中只看到了如何部署,请问有gitlab mr处具体使用的说明吗,比如哪些命令是可用的等

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.