Skip to content

Commit fdc0972

Browse files
committed
feat: 新增,大模型推理异常及没有修改的代码不推送消息,避免过多消息干扰
1 parent 5708979 commit fdc0972

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

api.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ def __handle_push_event(webhook_data: dict, gitlab_token: str, gitlab_url: str):
190190
changes = filter_changes(changes)
191191
if not changes:
192192
logger.info('未检测到PUSH代码的修改,修改文件可能不满足SUPPORTED_EXTENSIONS。')
193+
return
193194
review_result = "关注的文件没有修改"
194195

195196
if len(changes) > 0:
@@ -250,6 +251,10 @@ def __handle_merge_request_event(webhook_data: dict, gitlab_token: str, gitlab_u
250251
commits_text = ';'.join(commit['title'] for commit in commits)
251252
review_result = review_code(str(changes), commits_text)
252253

254+
if "COT ABORT!" in review_result:
255+
logger.error('COT ABORT!')
256+
return
257+
253258
# 将review结果提交到Gitlab的 notes
254259
handler.add_merge_request_notes(f'Auto Review Result: \n{review_result}')
255260

0 commit comments

Comments
 (0)