Avoid commit preload timeout in MR destroy audit
What does this MR do and why?
What does this MR do and why?
Deleting a merged MR with many commits can cause a timeout in MergeRequestBeforeDestroyAuditor. The audit event was fetching committer IDs by loading all commits via MergeRequestDiff#with_users, which triggers a full association preload on merge_request_diff_commits.
Adds committer_user_ids_from_diff on MergeRequest, which queries the commits tables directly (reusing the existing committer_emails_from_diff SQL) and resolves user IDs via User.by_any_email. This avoids loading commit objects entirely.
Gated behind FF destroy_mr_audit_use_committer_ids_from_diff since committer_emails_from_diff has limited production exposure so far.
References
Related to #602304
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.