Implement new diffs REST API endpoint
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
- Create a merge request with multiple changes.
- 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>
. - 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.
-
I have evaluated the MR acceptance checklist for this MR.
- Related to #322117 (closed)
- Related to #388311 (closed)
Edited by Amy Qualls