MCPcopy Index your code
hub / github.com/anc95/ChatGPT-CodeReview

github.com/anc95/ChatGPT-CodeReview @v1.0.23 sqlite

repository ↗ · DeepWiki ↗ · release v1.0.23 ↗
9,068 symbols 25,439 edges 27 files 2,401 documented · 26%
README

CodeReview BOT

A code review robot powered by ChatGPT

Translation Versions: ENGLISH | 简体中文 | 繁體中文 | 한국어 | 日本語

Usage

❗️⚠️ コストを考慮して BOT はテスト目的でのみ使用され、現在 AWS Lambda に展開されて速度制限を受けています。そのため、不安定な状況は完全に正常です。アプリケーションを直接展開することをお勧めします。

Install

Install: apps/cr-gpt;

Configuration

  1. リポジトリのホームページに移動します
  2. settings をクリックします
  3. secrets and variables メニューの下の actions をクリックします
  4. New repository variable をクリックして OpenAI の API キーの登録を行います。変数名は OPENAI_API_KEY にしてください。変数の値には OpenAI の API キーを入力します。 (OpenAI のホームページから API キーを取得できます。) image

Start using

  1. この bot は新しいプルリクエストが作成されたときに自動的にコードレビューを行います。レビュー結果はプルリクエストのタイムラインやファイル変更部分に表示されます。
  2. git push によりプルリクエストの更新が行われたときにも自動的にコードレビューを行います。

example:

ChatGPT-CodeReview/pull/21

image

Using Github Actions

基本的には、Github Actions での利用を推奨します。

actions/chatgpt-codereviewer

  1. OPENAI_API_KEY を設定する
  2. 以下の例のように .github/workflows/cr.yml を作成する
name: Code Review

permissions:
  contents: read
  pull-requests: write

on:
  pull_request:
    types: [opened, reopened, synchronize]

jobs:
  test:
    if: ${{ contains(github.event.*.labels.*.name, 'gpt review') }} # Optional; to run only when a label is attached
    runs-on: ubuntu-latest
    steps:
      - uses: anc95/ChatGPT-CodeReview@main
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
          # Optional
          LANGUAGE: Chinese
          MODEL:
          PROMPT:
          top_p: 1
          temperature: 1
          IGNORE_PATTERNS: /node_modules,*.md # Regex pattern to ignore files, separated by comma

Self-hosting

  1. このリポジトリをクローンします
  2. .env.example.env にリネームし、必要な環境変数を設定します
  3. 以下のコマンドを順番に実行することで依存関係をインストールし、bot を起動します
npm i
npm -i g pm2
npm run build
pm2 start pm2.config.cjs

詳細は probot を参照してください。

Dev

Setup

# Install dependencies
npm install

# Run the bot
npm start

Docker

# 1. Build container
docker build -t cr-bot .

# 2. Start container
docker run -e APP_ID=<app-id> -e PRIVATE_KEY=<pem-value> cr-bot

Contributing

cr-bot の改善に関する提案やバグ報告は、issue を作成してください。どのような貢献でも歓迎します!!

より詳しい情報は Contributing Guide を参照してください。

Credit

this project is inpired by codereview.gpt

License

ISC © 2023 anc95

Core symbols most depended-on inside this repo

push
called by 773
action/index.cjs
push
called by 725
action/github-action.js
slice
called by 602
action/index.cjs
slice
called by 563
action/github-action.js
on
called by 536
action/index.cjs
parseInt
called by 410
action/index.cjs
then
called by 347
action/index.cjs
create
called by 333
action/index.cjs

Shape

Function 6,523
Method 1,937
Class 608

Languages

TypeScript100%

Modules by API surface

action/index.cjs4,675 symbols
action/github-action.js4,344 symbols
action/multipart-parser-d1d13d05.js17 symbols
action/37.index.cjs.js17 symbols
src/chat.ts3 symbols
src/bot.ts3 symbols
action/worker.js3 symbols
action/worker1.js2 symbols
action/src/chat.d.ts2 symbols
middleware.ts1 symbols
action/worker-pipeline.js1 symbols

Dependencies from manifests, versioned

@probot/adapter-aws-lambda-serverless3.0.2 · 1×
@probot/adapter-github-actions3.1.3 · 1×
@rollup/plugin-commonjs24.0.1 · 1×
@rollup/plugin-json6.0.0 · 1×
@rollup/plugin-node-resolve15.0.1 · 1×
@rollup/plugin-typescript11.0.0 · 1×
@types/jest29.0.0 · 1×
@types/node18.0.0 · 1×
@types/pino-std-serializers4.0.0 · 1×
@vercel/edge0.2.7 · 1×
@vercel/ncc0.36.1 · 1×
dotenv16.0.3 · 1×

For agents

$ claude mcp add ChatGPT-CodeReview \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact