feat: Gitea 自动代码审查服务
基于 OpenCodeReview 的 webhook 服务:监听 Gitea 的 push 与 Pull Request 事件, 调用 OCR 审查 diff,把结果发布回 Gitea,并按阻断阈值决定是否自动合并。 主要能力: - Push / PR 事件触发,支持分支 glob 过滤与 PR-only / push-only 范围 - PR 内联评论(按 diff 行号定位)、汇总评论、Issue 生命周期、提交状态 - 可配置阻断阈值(严重级别 / 类别 / 任意意见) - 无阻断问题时自动合并,审查覆盖不完整时拒绝合并 - 内置 Web 后台:仓库配置、任务日志、失败重跑、连通性自检 - SQLite 持久化,worker 重启回收卡死任务,失败自动重试 实现为独立服务而非 Gitea Action:本机 act_runner 指向的实例不可达, 且后台配置与任务历史需要独立进程承载。
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
# Gitea connection
|
||||
CR_GITEA_URL=http://192.168.31.51
|
||||
# Admin token used to publish reviews, issues and statuses. Create one in
|
||||
# Gitea: Settings -> Applications -> Generate New Token (scopes: repo, issue).
|
||||
CR_GITEA_TOKEN=
|
||||
|
||||
# Shared secret configured on the Gitea webhook (Settings -> Webhooks).
|
||||
# When set, the service rejects any webhook whose HMAC signature does not match.
|
||||
CR_WEBHOOK_SECRET=
|
||||
|
||||
# Bearer token protecting the admin UI and REST API. Leave empty to disable auth
|
||||
# (only acceptable when the port is not exposed beyond a trusted network).
|
||||
CR_ADMIN_TOKEN=
|
||||
|
||||
# LLM endpoint used by OpenCodeReview.
|
||||
CR_LLM_URL=
|
||||
CR_LLM_TOKEN=
|
||||
CR_LLM_MODEL=
|
||||
CR_LLM_PROTOCOL=openai
|
||||
CR_LLM_AUTH_HEADER=
|
||||
CR_LLM_EXTRA_HEADERS=
|
||||
CR_LLM_TIMEOUT=180
|
||||
|
||||
# Optional: path to a custom OCR rule JSON inside the container.
|
||||
CR_RULE_PATH=
|
||||
|
||||
# Host port for the admin UI.
|
||||
CR_HOST_PORT=8090
|
||||
|
||||
# Runtime tuning (optional).
|
||||
CR_CONCURRENCY=4
|
||||
CR_REVIEW_TIMEOUT_MS=2700000
|
||||
CR_MAX_TOKENS_BUDGET=0
|
||||
Reference in New Issue
Block a user