Skip to content

WIP: Code intelligence

Isaac Snow requested to merge ijsnow/gitlab-ce:code-intelligence into master

What does this MR do?

We (Sourcegraph) are adding code intelligence to GitLab . This MR will add this by using Sourcegraph extensions. This means that along with code intelligence, we'll get the ability to extend GitLab in many more ways. See the extension registry for a full list.

Implementation

Sourcegraph's browser extension thinks of the concept of a code host1 as an interface. This interface tells Sourcegraph what is considered a code view2 and how to get the information for that code view needed to provide code intelligence.

GitLab's implementation of the code host interface is in this MR. The handling of the code host interface will be served by the Sourcegraph instance that GitLab is configured to communicate with. The separation of the code host interface implementation and the handling is done so that we can more easily handle backwards compatibility between different Sourcegraph and GitLab versions. This MR will include tests to ensure that if portions of GitLab's codebase that Sourcegraph needs changes, we'll know that the code host needs to be updated.

In Sourcegraph's browser extension, we support GitLab with some guess work on the repo/file/revision information. Since we're building Sourcegraph into GitLab, this MR includes some additions to some haml templates that provides Sourcegraph with the exact information we need so that we don't have to guess.

Glossary

  1. Code host - A website where one can view code (e.g. Sourcegraph, GitLab, GitHub, BitBucket, etc).
  2. Code view - A DOM element containing code to be annotated.

What are the relevant issue numbers?

Does this MR meet the acceptance criteria?

Will update when further along.

Merge request reports