Skip to content

ytanck/chat-review-gitlab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

功能介绍

代码审查机器人:在 Gitlab 中使用 ChatGPT 或 其他模型(兼容openai的api) 进行 CodeReview。当你在 GitLab 上创建一个新的 Merge request 时,机器人会自动进行代码审查,审查信息将显示在 MR timeline / file changes 中。

审计原理

image

Usage

运行服务

  1. git clone https://github.com/ytanck/chat-review-gitlab.git
  2. npm install
  3. npm run start

创建Project Access Tokens

image

Gitlab配置Webhook

配置回调服务地址

Webhook URL示例:http://xxx:4000/code-review?access_token=<access_token>

image

测试示例图

image

Configuration

  1. BASE_URL AI模型host,默认https://api.openai.com,可替换通义或其他模型链接
  2. API_KEY [required] 模型api的key
  3. DEFAULT_MODEL 默认gpt3.5-turbo,可替换通义或其他模型
  4. GITLAB_URL 你的gitlab仓库的host
  5. TARGET_CR_FILE 正则匹配需要code review的文件,默认检查.js/.jsx/.ts/.tsx结尾的文件

说明

项目启发

github版CRChatGPT-CodeReview

gitlab版CR-PythonChatGPT-CodeReview

gitlab版CR-TSchat-review 仓库未更新,目前已不能使用

由于上面几个仓库都不适用于我个人情况,故制作该永久分叉独立开发,感谢以上大佬对开源的贡献 🙏

About

ChatGPT Gitlab Code Review

Resources

Stars

Watchers

Forks

Packages

No packages published