Skip to content

Commit

Permalink
Merge pull request #7 from francovp/feat-merge-request-hook-skip-summ…
Browse files Browse the repository at this point in the history
…ary-gen-when-no-code-changes

feat(merge_request): skip AI summary generation when no code changes
  • Loading branch information
coolbeevip authored Oct 26, 2024
2 parents 6328402 + 195a03a commit b851156
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/merge_request_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ async def generate_diff_description_summary(event, gl):
description = event.data["object_attributes"]["description"]
labels = event.data["object_attributes"]["labels"]
iid = event.data["object_attributes"]["iid"]
change_event = event.data["changes"]
if not change_event:
logging.debug(f"MR has no code changes, AI Summary generation skipped...")
return None

if bot_gitlab_merge_request_summary_enabled and AI is not None:
try:
if not has_ai_review(description, labels):
Expand Down

0 comments on commit b851156

Please sign in to comment.