Skip to content

Fix N+1 issues in /api/v3/repos/:namespace/:project/events [RUN ALL RSPEC] [RUN AS-IF-FOSS]

What does this MR do?

The /api/v3/repos/:namespace/:project/events endpoint was flagged as having N+1 problems #321839 (closed).

The N+1 issues happen when a collection of MergeRequests are serialised as API::Github::Entities::PullRequest entities.

The entity loads these associations:

This MR applies eager loading to avoid N+1 issues during serialization.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Related to #321839 (closed)

Edited by Luke Duncalfe

Merge request reports