Page load performance issues when CODEOWNERS contains a large amount of members

Summary

Too many members from the CODEOWNERS file are displayed on file content pages which results in extremely long loading times.

This is for a repository where the intended workflow is to let anyone approve the creation of new files, but the modification of existing files is subject to approval. Since the approval is set to follow code owners, everyone needs to be added as a global rule to allow

Steps to reproduce

  1. Create a CODEOWNERS file that references a group containing a lot of users (100-1000+) for all files in the repo
* @everyone
* some/specific/file @someone @someone-else
  1. Try to load the content of any repo file covered by the first default rule in the browser.

Example Project

No access to a group with a large amount of users to test on public gitlab.com

What is the current bug behavior?

Browsing pages for files and folders becomes extremely slow and difficult as thousands of users are displayed above file and folder content

What is the expected correct behavior?

Only some amount of users would be displayed to reduce the load times and impact on the page usability

Relevant logs and/or screenshots

codeowners

Output of checks

This bug happens on a internally-hosted version of Gitlab EE

Proposal

Place a "show all" button to expand to the full list on-demand. See this comment for UX mockup.

  • show 5 names maximum and afterwards we would show a tertiary button that says # more (where # = total count of members - 5 visible members).
  • When expanded the button label says "show less" to collapse the list back to 5 visible members.
Edited by Sean Carroll