Open
Conversation
There was a problem hiding this comment.
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_prompttemplate 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-是 |
There was a problem hiding this comment.
[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=启用) |
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 平台支持
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.