Code host connections

Sourcegraph can sync repositories from code hosts and other similar services. We designate code hosts between Tier 1 and Tier 2 based on Sourcegraph's capabilities when used with those code hosts.

Tier 1 code hosts

Tier 1 code hosts are our highest level of support for code hosts. When leveraging a Tier 1 code host, you can expect:

  • Scalable repository syncing - Sourcegraph is able to reliably sync repositories from this code host up to 100k repositories. (SLA TBD)
  • Scalable permissions syncing - Sourcegraph is able to reliably sync permissions from this code host for up to 10k users. (SLA TBD)
  • Authentication - Sourcegraph is able to leverage authentication from this code host (i.e. Login with GitHub).
  • Code Search - A developer can seamlessly search across repositories from this code host. (SLAs TBD)
  • Code Monitors - A developer can create a code monitor to monitor code in this repository.
  • Code Insights - Code Insights reliably works on code sync'd from a tier 1 code host.
  • Batch Changes - A Batch Change can be leveraged to submit code changes back to a tier 1 code host while respecting code host permissions.
Code Host Status Repository Syncing Permissions Syncing Authentication Code Search Code Monitors Code Insights Batch Changes Tier 1
GitHub Self-Hosted Enterprise Tier 1 Tier 1
GitLab Self-Hosted Tier 1
Bitbucket Cloud Tier 1
Bitbucket Server Tier 1
Gerrit Beta Tier 2 (Working on Tier 1)
Azure DevOps Tier 1
Perforce Tier 2 (Working on Tier 1)
Plastic SCM (Enterprise) Tier 2

Status definitions

A code host status is:

  • 🟢 Generally Available: Available as a normal product feature up to 100k repositories.
  • 🟡 Partially available: Available, but may be limited in some significant ways (either missing or buggy functionality). If you plan to leverage this, please contact your Customer Engineer.
  • 🔴 Not available: This functionality is not available within Sourcegraph

Tier 2: Code Hosts

We recognize there are other code hosts including CVS, SVN, and many more. Today, we do not offer native integrations with these code hosts and customers are advised to leverage Src-srv-git and the explicit permissions API as a way to ingest code and permissions respectively into Sourcegraph.

Src-srv-git and the explicit permissions API follow the same scale guidance shared above (up to 100k repos and 10k users).

Full Code Host Docs

Site admins can configure the following code hosts:

Users can configure the following public code hosts:

Rate limits

Sourcegraph makes our best effort to use the least amount of calls to your code host. However, it is possible for Sourcegraph to encounter rate limits in some scenarios. Please see the specific code host documentation for more information and how to mitigate these issues.

Rate limit syncing

Sourcegraph has a mechanism of syncing code host rate limits. When Sourcegraph is started, code host configurations of all external services are checked for rate limits and these rate limits are stored and used.

When any of code host configurations is edited, rate limits are synchronized and updated if needed, this way Sourcegraph always knows how many requests to which code host can be sent at a given point of time.

Current rate limit settings

Current rate limit settings can be viewed by site admins on the following page: Site Admin -> Instrumentation -> Repo Updater -> Rate Limiter State.This page includes rate limit settings for all external services configured in Sourcegraph.

Here is an example of one external service, including information about external service name, maximum allowed burst of requests, maximum allowed requests per second and whether the limiter is infinite (there is no rate limiting):

  "extsvc:github:4": {
    "Burst": 10,
    "Limit": 1.3888888888888888,
    "Infinite": false

Increasing code host rate limits

Customers should avoid creating additional free accounts for the purpose of circumventing code-host rate limits.Some code hosts have higher rate limits for paid accounts and allow the creation of additional paid accounts whichSourcegraph can leverage.

Please contact [email protected] if you encounter rate limits.

Temporarily disabling requests to code hosts

It may be the case that you'd like to temporarily disable all git and API requests from Sourcegraph to a code host. Adding the following to your site configuration will stop Sourcegraph from sending requests to the configured code host connections:

"disableAutoGitUpdates": true,
"disableAutoCodeHostSyncs": true,
"gitMaxCodehostRequestsPerSecond": 0,
"gitMaxConcurrentClones": 0

Testing Code Host Connections

In Sourcegraph 4.4, site administrators have the ability to test a code host connection via the site-admin UI to improve the debuggability when something goes wrong. This check confirms that Sourcegraph has the ability to connect with the respective code host via TCP dial.