Paginate merge request discussions
What does this MR do and why?
To improve performance of discussions.json
endpoint for merge requests, pagination is being introduced so requests will be divided into smaller requests.
The discussions will be loaded sequentially with oldest first by default (first request contains 20 discussions and succeeding ones will be incremented with a multiplier of 1.5). Filters and sorting will still be respected.
This is behind the paginated_mr_discussions
feature flag.
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Import this test project which contains a MR with multiple discussions: 2022-06-01_16-53-198_root_discussions-pagination_export.tar.gz
- Enable the
paginated_mr_discussions
feature flag via rails console:Feature.enable(:paginated_mr_discussions)
- Visit the MR on the imported project and see the discussions load.
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 #340172 (closed)