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 |
---|---|---|---|---|---|---|---|---|
GitHub.com | Tier 1 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
GitHub Self-Hosted Enterprise | Tier 1 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
GitLab.com | Tier 1 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
GitLab Self-Hosted | Tier 1 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Bitbucket Cloud | Tier 1 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Bitbucket Server | Tier 1 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Gerrit | Tier 1 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Azure DevOps | Tier 1 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
AWS CodeCommit | Tier 2 | ✓ | ✗ | ✗ | ✓ | ✓ | ✓ | ✗ |
Perforce | Tier 2 | ✓ | ✓ | ✗ | ✓ | ✓ | ✗ | ✗ |
Plastic SCM (Enterprise) | Tier 2 | ✓ | ✗ | ✗ | ✓ | ✓ | ✓ | ✗ |
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).
Configure a code host connection
Site admins can configure Sourcegraph to sync code from the following code hosts:
- GitHub
- GitLab
- Bitbucket Cloud
- Bitbucket Server / Bitbucket Data Center
- Azure DevOps
- Gerrit
- AWS CodeCommit
- Other Git code hosts (using a Git URL)
- Non-Git code hosts
Rate limits
For information on code host-related rate limits, see 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:
WARNING: disabling all git and API requests to codehosts will also disable permissions syncs, batch changes, discovery of new repos, and updates to currently synched repos. Synching with codehosts is a core functionality of Sourcegraph and many other features may also be affected.
JSON"disableAutoGitUpdates": true, "disableAutoCodeHostSyncs": true, "gitMaxCodehostRequestsPerSecond": 0, "gitMaxConcurrentClones": 0
Using Self-signed TLS Certificates
To use Sourcegraph with self-signed TLS Certificates, update the site configuration to add the certificate and skip verification of the certificate chain. This configuration exists within the experimentalFeatures
:
JSON"experimentalFeatures": { "tls.external": { "certificates": [ "-----BEGIN CERTIFICATE-----\n..." ], "insecureSkipVerify": true } }
Testing Code Host Connections
WARNING: Sourcegraph 4.4.0 customers are reporting a bug where the connection test is failing when Sourcegraph is running behind proxies where TCP dial cannot be used with ports 80/443. This causes repositories to stop syncing. If you're experiencing this issue, please upgrade to 4.4.1 where normal HTTP requests are used instead.
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.