Skip to content

Paginate merge request discussions

Patrick Bajao requested to merge 340172-paginate-mr-discussions into master

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.

  1. Import this test project which contains a MR with multiple discussions: 2022-06-01_16-53-198_root_discussions-pagination_export.tar.gz
  2. Enable the paginated_mr_discussions feature flag via rails console:
    Feature.enable(:paginated_mr_discussions)
  3. 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.

Related to #340172 (closed)

Edited by Patrick Bajao

Merge request reports

Loading