Skip to content

Add Sourcegraph integration

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

This is the port of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/30574. 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:

image

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: https://github.com/sourcegraph/sourcegraph/tree/master/browser

In its current form, this only works on gitlab.com, loading extensions from the extension marketplace on sourcegraph.com. 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

Screenshots

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

https://youtu.be/t85PosdwNag (17c9e0d1 on Nov 8)

Does this MR meet the acceptance criteria?

Conformity

Performance and testing

Security

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