Skip to content

[CLOUD-203] Handle GitHub App setup callback

Created by: unknwon

This PR adds the GitHub App for Sourcegraph Cloud setup handler to the enterprise namespace, handling creating the organization code host connection automatically upon a successful GitHub App installation.

GitHub App installation does not provide long-live access tokens like other PAT or GitHub OAuth, so only the installation ID will be saved with the code host connection (with blank token, which has to be exchanged at runtime with fixed lifetime of one hour).

Therefore, repository syncing and other stuff will not work (as expected), and will be tackled separately.

This PR is safe to merge upon approval because the site config "dotcom" > "githubApp.cloud" is used as the config switch, the code path is disabled if it is not configured.

Demo

https://user-images.githubusercontent.com/2946214/148500289-074cacc9-f126-4246-ab68-66886c0be8f2.mp4

Testing

For testing locally, please follow the local testing guide.


Jira: CLOUD-203

Merge request reports

Loading