Skip to content

feat: -增加分批次审查#148

Open
machsh64 wants to merge 3 commits intosunmh207:mainfrom
machsh64:feature/batch-review-v1.0.0
Open

feat: -增加分批次审查#148
machsh64 wants to merge 3 commits intosunmh207:mainfrom
machsh64:feature/batch-review-v1.0.0

Conversation

@machsh64
Copy link

No description provided.

  - 增加分批次审查功能
  - 提示词更新(但提示词效果并不好的样子 in qwen2.5-coder:32b-instruct)
@machsh64 machsh64 requested a review from sunmh207 as a code owner October 24, 2025 07:54
Copilot AI review requested due to automatic review settings October 24, 2025 07:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a batch-based code review feature that divides code changes into smaller batches for AI review, then consolidates the results. This addresses issues where reviewing all changes at once caused the AI to lose context or forget prompt template requirements.

Key Changes:

  • Added configurable batch review system with environment variables (BATCH_REVIEW_ENABLED, BATCH_REVIEW_FILES_PER_BATCH)
  • Implemented review_changes_in_batches() method that processes changes in configurable file batches
  • Created summary_merge_review_prompt template for consolidating multiple batch reviews
  • Updated all webhook handlers to use the new batch review approach

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
conf/prompt_templates.yml Added new summary_merge_review_prompt template and restructured code_review_prompt with stricter output format requirements and self-checking mechanisms
conf/.env.dist Added batch review configuration variables (BATCH_REVIEW_ENABLED, BATCH_REVIEW_FILES_PER_BATCH)
biz/utils/code_reviewer.py Implemented review_changes_in_batches() and _summarize_reviews() methods for batch processing and consolidation
biz/queue/worker.py Updated all event handlers to use review_changes_in_batches() instead of review_and_strip_code()
BATCH_REVIEW_IMPLEMENTATION.md Added comprehensive documentation explaining the batch review feature, configuration options, and performance characteristics
Comments suppressed due to low confidence (1)

conf/prompt_templates.yml:1

  • Inconsistency in scoring criteria labels between the definition section (line 13: '性能与资源利用效率(5分)') and the output format section (line 27: '性能与资源利用效率'). Additionally, the summary section (line 92) uses '性能与资源效率' (missing '利用'). All three instances should use the same label for consistency.
code_review_prompt:

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

在 `conf/.env` 文件中添加:

```bash
# 启用批量审查 0-否 1-是
Copy link

Copilot AI Oct 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Corrected comment punctuation and spacing: '启用批量审查 0-否 1-是' should be '启用批量审查(0=禁用,1=启用)' to match the style used in conf/.env.dist line 42.

Suggested change
# 启用批量审查 0-否 1-是
# 启用批量审查(0=禁用,1=启用)

Copilot uses AI. Check for mistakes.
yesgit pushed a commit to yesgit/AI-Codereview-Gitlab that referenced this pull request Dec 22, 2025
- 新增批量审查功能,按文件分批次审查代码
- 支持通过环境变量控制批量审查行为
  * BATCH_REVIEW_ENABLED: 启用/禁用批量审查(默认启用)
  * BATCH_REVIEW_FILES_PER_BATCH: 每批次文件数量(默认1)
- 新增 summary_merge_review_prompt 提示词模板用于汇总多批次审查结果
- 批量审查功能完美结合项目级 prompt 模板支持
- 更新所有 webhook handler(GitLab/GitHub/Gitea)使用批量审查方法
- 保留 Gitea 平台支持
yesgit pushed a commit to yesgit/AI-Codereview-Gitlab that referenced this pull request Dec 22, 2025
合并上游第二批特性:
- PR sunmh207#130: 项目级别的 Prompt 模板配置
- PR sunmh207#148: 批量审查功能

主要功能:
1. 支持为不同项目设置专属的 prompt 模板文件
2. 批量审查:按文件分批次审查,避免上下文过长
3. 智能汇总:多批次审查结果自动汇总
4. 保留 Gitea 平台支持
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant