PR Reviewer

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Manages environment variables for configuring GitHub and Notion API authentication and other sensitive settings.

  • Enables automated review of Pull Requests through the GitHub API, with capabilities to analyze code changes and provide feedback.

  • Integrates with Notion's workspace to store, organize, and track PR review data using Notion's database capabilities.

PR 审阅者设置指南

本指南提供了设置 PR Reviewer 项目的分步说明,其中包括与 GitHub 和 Notion 的集成。

先决条件

  • curl (适用于 MacOS/Linux)
  • 您的系统上安装了 Python 3.x

设置说明

步骤1:安装uv

MacOS/Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

🔁 之后重新启动终端以确保uv命令可用。


步骤 2:创建并设置项目

MacOS/Linux:

# Create a new directory for the project uv init pr_reviewer cd pr_reviewer # Create and activate a virtual environment uv venv source .venv/bin/activate # Install core dependencies uv add "mcp[cli]" requests python-dotenv notion-client

步骤 3:创建requirements.txt并从中安装

创建一个名为requirements.txt的文件,其内容如下:

# Core dependencies for PR Analyzer requests>=2.31.0 # For GitHub API calls python-dotenv>=1.0.0 # For environment variables mcp[cli]>=1.4.0 # For MCP server functionality notion-client>=2.3.0 # For Notion integration

安装软件包:

uv pip install -r requirements.txt pip install -r requirements.txt

步骤4:设置环境变量

在根目录中创建一个.env文件并添加以下内容:

GITHUB_TOKEN=your_github_token NOTION_API_KEY=your_notion_api_key NOTION_PAGE_ID=your_notion_page_id

GitHub 令牌:

  1. 转到 GitHub → 设置 → 开发者设置 → 个人访问令牌。
  2. 点击**“生成新令牌(经典)”**
  3. 启用这些范围:
    • read:org
    • read:repo_hook
    • repo
  4. 将令牌复制并粘贴到您的.env文件中作为GITHUB_TOKEN

概念整合:

  1. 转到Notion Integrations
  2. 单击**“新集成”并将类型设置为“内部”**
  3. 将其添加到您的工作区。
  4. 内部集成密钥复制为NOTION_API_KEY
  5. 集成 URL 末尾的 UUID复制为NOTION_PAGE_ID

步骤 5:创建主脚本

为您的服务器逻辑创建一个空脚本文件:

touch pr_reviewer

在此文件中添加您的应用程序逻辑。


步骤6:运行应用程序

要运行项目,请确保您的环境已激活并且.env已配置:

python pr_reviewer.py

-
security - not tested
F
license - not found
-
quality - not tested

一种与 GitHub 和 Notion 集成的工具,用于分析和审查拉取请求,从而实现 Notion 中的自动代码审查和文档记录。

  1. Prerequisites
    1. Setup Instructions
      1. Step 1: Install uv
      2. Step 2: Create and Set Up the Project
      3. Step 3: Create requirements.txt and Install from It
      4. Step 4: Set Up Environment Variables
      5. Step 5: Create the Main Script
      6. Step 6: Run the Application
    ID: hdyjdwqhhl