Skip to content

Upgrade Sourcegraph integration to 0.0.82

What does this MR do and why?

This change upgrades the Sourcegraph dependency to the latest version.

Why now?

We (Sourcegraph) have recently worked on changes to our extensions architecture which also affects all of our external extensions (e.g. IDE, browser, and native extensions).

The native GitLab extension is special though, since, as opposed to the other extensions, we do not control the deployment of this client and instead rely on GitLab's rollout cycle.

For our recent release, we made sure to not break existing GitLab instances that are still using the old extension client. We can maintain these changes for a while but ultimately we want to delete the old extension code.

To prepare our customers for this change and to have as little impact on GitLab on-premise instances as possible, we want to upgrade our GitLab native extension sooner so that when we come to the actual deprecation in the future, our GitLab customers have had plenty of opportunities to upgrade.

What changed?

The main difference and why we want to upgrade to 0.0.82 as soon as possible is that we now do a feature test against the Sourcegraph instance to find out if the migrated extensions APIs are used. If this is the case, we no longer download extension code from Sourcegraph servers but instead fall back to inlined extension code that are included in the updated npm package.

Since the native integration version that was bundled with GitLab was already quite dated, this change also includes several bug fixes that we have worked on over the last months. These are tested against newer GitLab versions regularly as it shares the code with our browser extension.

Test plan (including screenshots or screen recordings)

It took me quite a while to get it set up but I verified my changes locally by setting up a GitLab and Sourcegraph development environment and manully testing through various scenarios. You can learn more about it in this Sourcegraph commit.

How to set up and validate locally

  1. Configure the GitLab instance to enable Sourcegraph instances (in Admin > General).
  2. Enable the Sourcegraph integration for your logged in Gitlab user.
  3. Open a code view for a file is also indexed on the Sourcegraph instance.
  4. Hover symbols and observer that it renders the tooltip.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading