-
- Downloads
Optimize /api/v4/projects endpoint for visibility level
Previously when a user requested a list of projects, `Project#public_or_visible_to_user` would search all authorized projects and public/internal projects as well. However, when a user requests a specific `visibility_level` (e.g. private), that should reduce the search space, and we shouldn't need to load public/internal projects. Improves https://gitlab.com/gitlab-org/gitlab-ce/issues/59329
Showing
- app/finders/projects_finder.rb 1 addition, 1 deletionapp/finders/projects_finder.rb
- app/models/project.rb 17 additions, 5 deletionsapp/models/project.rb
- changelogs/unreleased/sh-optimize-projects-api.yml 5 additions, 0 deletionschangelogs/unreleased/sh-optimize-projects-api.yml
- spec/models/project_spec.rb 48 additions, 1 deletionspec/models/project_spec.rb
Please register or sign in to comment