Skip to content

Projects::MergeRequestsController#commits degrades with high commits count

Summary

Extracted from: #30507 (closed)

Currently Projects::MergeRequestsController#commits uses MergeRequestDiff#commits method, which loads all diff commits into the memory, but still limits them to the safe number (100)

Consider querying the limited number of commits by passing a limit param to the MergeRequestDiff#commits method. Also an author and latest pipeline can be preloaded to avoid N + 1

Edited by Igor Drozdov