Skip to content

Conversation

qiniu-ci
Copy link
Collaborator

@qiniu-ci qiniu-ci commented Jul 16, 2025

改动摘要

修复了PR review事件处理中缺少action类型判断的bug。现在只有当事件类型为"submitted"时才会触发AI任务,避免了在编辑或其他操作时重复触发。

具体改动

  • 修改文件: /workspace/internal/webhook/handler.go
  • 修改位置: handlePRReview函数 (第280-295行)
  • 具体变动:
    1. 添加了action := event.GetAction()获取事件动作类型
    2. 在日志中增加了action信息记录
    3. 添加了action类型检查,只处理"submitted"事件
    4. "submitted"事件会被忽略并记录调试日志

这个修复确保了只有在用户正式提交review时才会触发AI批量处理任务,避免了在创建、编辑或其他操作review时的重复触发。


AI 完整输出

改动摘要

修复了PR review事件处理中缺少action类型判断的bug。现在只有当事件类型为"submitted"时才会触发AI任务,避免了在编辑或其他操作时重复触发。

具体改动

  • 修改文件: /workspace/internal/webhook/handler.go
  • 修改位置: handlePRReview函数 (第280-295行)
  • 具体变动:
    1. 添加了action := event.GetAction()获取事件动作类型
    2. 在日志中增加了action信息记录
    3. 添加了action类型检查,只处理"submitted"事件
    4. "submitted"事件会被忽略并记录调试日志

这个修复确保了只有在用户正式提交review时才会触发AI批量处理任务,避免了在创建、编辑或其他操作review时的重复触发。

原始 Prompt

根据Issue修改代码:

标题:对于一次性提交多个Review Comments的场景,我们当前的实现没有判断事件类型为 "submited",会导致重复触发AI任务
描述:如题,请帮修复这个bug。

输出格式:

改动摘要

简要说明改动内容

具体改动

  • 列出修改的文件和具体变动

qiniu-ci added 2 commits July 16, 2025 19:32
Add action type check in handlePRReview function to ensure AI tasks are only triggered when PR review events have action type "submitted". This prevents duplicate processing when reviews are edited or other operations are performed.

- Add action type extraction from PR review event
- Include action info in debug logging
- Skip processing for non-submitted events with debug log
- Only process reviews that are actually submitted by users

Closes #148
@CarlJi CarlJi merged commit fba569d into main Jul 16, 2025
1 check passed
@qiniu-ci qiniu-ci deleted the codeagent/issue-148-1752665571 branch July 22, 2025 12:20
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.

2 participants