Dashboard performance
Problem
GitLab.com has a lot of public projects. When you use the dashboard, it shows you all issues (for instance) matching the filters that you can see. That means:
- Issues in public projects
- Where issues are enabled
- And visible to anyone with membership
- And not confidential
- Or confidential, and authored by the current user
- Or confidential, and assigned to the current user
- Or the current user has membership
- And visible to anyone with membership
- Or issues in internal projects
- Where issues are enabled
- And visible to anyone with membership
- And not confidential
- Or confidential, and authored by the current user
- Or confidential, and assigned to the current user
- Or the current user has membership
- And visible to anyone with membership
- Or issues in private projects
- Where issues are enabled
- And the current user has membership
For smaller instances, this may be fine. But with the number of projects on GitLab.com, it's very tricky. If we remove the feature, it might negatively impact people on smaller instances, but we have to do something on GitLab.com, because https://gitlab.com/dashboard/issues times out, which means the features (global label and milestone search) are purely hypothetical for GitLab.com, because no-one can use them.
Options
- We could restrict the dashboard to only show issues or MRs from projects that you have access to, or have authored an issue / MR, or have an issue / MR assigned to you. Obviously we still need to do the access checks, but the projects list would be much shorter.
- Pros: this should be a big improvement, although we'd need to measure it.
- Cons: the dashboard would be very confusing.
- We could prevent filtering by anything on the dashboard unless you already are filtering by author or assignee.
- Pros: filtering by author or assignee is now reasonably fast.
- Cons: the UX here is tricky.
- We add a setting for allowable filters on the dashboard, and restrict that to author and assignee for GitLab.com.
- Pros: problem solved!
- Cons: we didn't solve anything, we just swept it under the carpet.
Original description
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6839, https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7564, and https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7760 are band-aids that made the dashboard less likely to time out. But we really need it to perform reasonably at the scale of GitLab.com, especially as it's linked to from every page (in the sidebar).
There is some discussion about this in https://gitlab.com/gitlab-org/gitlab-ce/issues/24201#note_19255457. In summary:
- Searching all public projects on GitLab.com is very slow.
- We think it should be faster to only search projects where the current user has membership, authored an issuable, or has an issuable assigned to them.
- We could and should already be doing this in the case of the sidebar links, which go to the assigned issues. Making this faster would make most people happy.
- If that's still not fast enough, we might need to consider restricting the dashboard further.
So let's start by doing these:
- Aggressively restrict projects when filtering by assignee or author: https://gitlab.com/gitlab-org/gitlab-ce/issues/25503
- Don't show every label on the dashboard, and search on the server side: https://gitlab.com/gitlab-org/gitlab-ce/issues/24201#note_19098529