Skip to content

Add Sourcegraph integration

Felix Becker requested to merge felixfbecker/gitlab-ee:sourcegraph into master

This is the port of Copied MR description:

What does this MR do?

This supersedes !23755 (merged) and closes #20642 (closed). It natively integrates Sourcegraph into Gitlab without the need to install the Sourcegraph browser extension, which directly brings all the features to GitLab that Sourcegraph extensions provide, like code intelligence (hover tooltips, go to definition, etc) or code coverage decorations:


The UI uses the GitLab CSS so they fit into the GitLab design. Users can add write their own extensions against the Sourcegraph extension API. The Sourcegraph integration is fully open source:

In its current form, this only works on, loading extensions from the extension marketplace on For private instances, there would need to be a setting in the admin UI to set the URL of a private Sourcegraph instance. Could I get some guidance on where to add this UI and how to persist that setting and read it in the frontend JavaScript?

cc @phikai @deuley


Description Screenshot
Admin settings Screen_Shot_2019-11-15_at_4.29.18_AM
User settings (only visible if enabled in the admin settings, and the help text changes based on the admin settings) Screen_Shot_2019-11-15_at_4.31.52_AM

Demo (17c9e0d1 on Nov 8)

Does this MR meet the acceptance criteria?


Performance and testing


If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Craig Norris

Merge request reports