Skip to content

Batch-fetch GitLab Project visibility when computing permissions

Warren Gifford requested to merge bl/gitlab-authz-optimization into master

Created by: beyang

This PR adds an optimization to the GitLab OAuth authz implementation, wherein permissions for GitLab projects ("project" is what GitLab calls a repository) are fetched in batches of 100 in certain cases, instead of individually. These certain cases are those in which the projects we're fetching have visibility public or internal (i.e., not private). This should make permissions fetching much faster for customers using GitLab OAuth authz and have predominantly internal or public repositories on Sourcegraph.

This also adds a site config option experimentalFeatures > debug.log > extsvc.gitlab that can be set to true to turn on debug tracing of GitLab API requests in a running Sourcegraph instance. This should help with future debugging of permissions performance issues.

Please see my inline comments for more explanation of what's in this PR.

Post-merge TODOs

  • Cut patch release for customer
  • Update CHANGEOG

Merge request reports

Loading