Skip to content

Implement new diffs REST API endpoint

Patrick Bajao requested to merge 322117-mr-changes-api-endpoint into master

What does this MR do and why?

The old changes MR API endpoint doesn't support pagination and slow when requesting for changes of a large MR.

This new API endpoint will replace that and marks the deprecation of the old endpoint.

Here's a comparison on how the endpoints perform on a MR with 187 changes (measured locally via GDK):

  • Changes endpoint: ~0.6s
  • Diffs endpoint: ~0.1s

This shows around 80% improvement.

How to set up and validate locally

  1. Create a merge request with multiple changes.
  2. Access the new diffs endpoint via http://localhost:3000/api/v4/projects/<project ID>/merge_requests/<merge request IID>/diffs?page=<page>&per_page=<per_page>.
  3. Confirm the results are complete.

MR acceptance checklist

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

Edited by Amy Qualls

Merge request reports