Backport of 'Remove unnecessary committer batch-load from mergeability fields' to 19.4

What does this MR do and why?

Backports !258392 (merged) to 19.4. On projects that prevent committers from approving, the merge request widget's mergeable / detailedMergeStatus GraphQL fields batch-loaded every diff commit, which on merge requests with thousands of commits exceeded the GraphQL timeout and the widget never loaded. The fix removes that unused batch load.

Clean cherry-pick of e70b3e6e, already in 19.5.

Detailed context for AI agents
  • Original MR: !258392 (merged) (merged 2026-10-05, milestone 19.5, workflow::production).
  • Issue: https://gitlab.com/gitlab-org/gitlab/-/issues/630822
  • Commit e70b3e6e is an ancestor of 19-5-stable-ee and not of 19-4-stable-ee.
  • The cherry-pick applied without conflicts; the diff against 19-4-stable-ee is line-for-line identical to the original commit (3 files: app/models/commit_collection.rb, ee/app/graphql/ee/types/merge_request_type.rb, ee/spec/graphql/ee/types/merge_request_type_spec.rb).
  • Safety on 19.4: the removed lazy_committers wrapper called commits.add_committers_to_batch_loader, but nothing on 19.4 consumes that batch. The approval committer filter on 19.4 (MergeRequest#committer_ids_to_filter_from_approvers / #committers_to_filter_from_approvers) already goes through committer_users_from_diff -> committer_emails_from_diff, which uses either the SQL path (approval_committer_emails_from_diff, default off on 19.4) or commits.author_and_committer_emails. Neither path reads the committers_lazy batch. The only caller of the removed add_committers_to_batch_loader alias on 19.4 was the removed wrapper.
  • No local spec run against 19.4; CI covers the updated N+1 specs in ee/spec/graphql/ee/types/merge_request_type_spec.rb.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

  • This MR is backporting a bug fix, documentation update, or spec fix, previously merged in the default branch.
  • The MR that fixed the bug on the default branch has been deployed to GitLab.com (not applicable for documentation or spec changes).
  • The MR title is descriptive (e.g. "Backport of 'title of default branch MR'"). This is important, since the title will be copied to the patch blog post.
  • Required labels have been applied to this merge request
  • This MR has been approved by a maintainer (only one approval is required).
  • Ensure the E2E Omnibus GitLab EE pipeline (triggered by thee2e:test-on-omnibus-ee job) has succeeded. If it has failed (or shows warnings), investigate the failures. If you determine the failures are unrelated, you may proceed. If you need assistance investigating, request help in the #s_developer_experience Slack channel to confirm the failures are unrelated to the merge request.

Note to the merge request author and maintainer

If you have questions about the patch release process, please:

Edited by Marc Shaw

Merge request reports

Loading
Loading