[MR AI Summary] Do not create a diff summary for empty diff
Background
In #408726 (comment 1696633587), we got a feedback wherein the merge request diff is empty. This is because an empty commit was pushed to MR source branch.
Internally, we still create an empty
MergeRequestDiff
if commit is empty.
Proposal
Check if MergeRequestDiff
is empty before calling Llm::SummarizeMergeRequestService#execute
in MergeRequestDiff#prepare_diff_summary
.
We're also filtering out binary files from diffs when generating prompt which can lead to empty diff sent to AI. We should also not send a request to AI if this is the case.
Edited by Patrick Bajao