sourcegraph/doc/dev/background-information/web/code_host_integrations.md
Quinn Slack 80024726b7
remove extension registry UI and related GraphQL API (#45891)
Removes the extension registry UI and the GraphQL API that is necessary for the registry extension UI.

Any extensions that already exist locally or remotely can still be used with the enableLegacyExtensions site config flag and by enabling the extensions in your user settings.

This change is an intermediate step toward removing the extension registry (except the endpoint that's needed to support pre-4.0 Sourcegraph instances).

I think this PR has a 99% chance of going into the 4.4 release (2023-01-20) and not needing to be reverted. Subsequent PRs that actually make it impossible to use local or custom legacy extensions are still pending customer communication and confirmation. I hope we can merge other future PRs there as well, but there is a greater chance we'd need to revert them before 4.4. By making this PR first, it means less of a revert and more progress regardless of what we learn from customers.
2022-12-22 00:10:56 -08:00

2.7 KiB

Developing the code host integrations

Code host integrations are how Sourcegraph delivers features directly into a code host's interface. These integrations allow developers to benefit from Sourcegraph without leaving their code host as they navigate repositories, source code files, commits, and diffs.

For a guide on usage of integrations, see the Integrations section.

How code host integrations are delivered

Code host integrations are implemented as a JavaScript bundle that is injected directly into the code host's web UI.

Sourcegraph has two channels available to deliver this JavaScript bundle:

  • Native integrations which configure the code host to natively load the JavaScript as an additional resource on every page. These integrations can be configured once by an administrator (typically on a self-hosted code host instance) and are then automatically available to all users.
  • Browser extensions for Chrome and Firefox, which inject the JavaScript bundle on all code host pages. These integrations don't require any central configuration of the code host, but they require each user to individually install the browser extension in order to benefit from it.

Code views

Code host integrations mainly operate on code views.

A code view is any instance of source code being displayed on any code host page. It can be an entire source file, a snippet of a file, or a diff view. There may be many code views on a single page, for example on a pull request page.

Code host integrations work by first identifying all code views on a given page, and then by adding interface elements (such as action buttons), and listening for hover events over specific code tokens in order to show hover pop-ups.

Contributing to code host integrations

The source code for code host integrations is located in the browser directory of the Sourcegraph repository.

For build steps and details of the directory layout, see browser/README.md