Skip to content

Ask for GitHub App OAuth and login connection during Org Code Host Connection

Administrator requested to merge pjlast/CLOUD-287-ask-for-org-scope into main

Created by: pjlast

This PR solves two tickets, CLOUD-287 and CLOUD-286. When a user attempts to create an Org code host connection with GitHub App enabled, additional scope (read:org) is requested for their sign-in connection, or if no sign-in connection exists they are prompted to make it (this is just default GitHub OAuth behaviour). After that they are redirected to the GH App install page.

UPDATE: we have since discovered that the read:org permission does not grant us the access we had thought it did. Instead, we are now requesting for GitHub App OAuth as well, as that will allow us to get a list of organizations the user belongs to where GitHub App is installed, and then make connections like that.

Here are two Loom videos, one showing what happens if the user has zero login/code host connections, going through all the steps. The other shows what happens if a few steps are already in place.

In turn this now solves https://sourcegraph.atlassian.net/browse/CLOUD-308

https://www.loom.com/share/bbb401d0f78c45e782abaefafd2de011

https://www.loom.com/share/9cfbf5dce376439394bd34d570ed1639

Test plan

Manual e2e test and updated unit test

Merge request reports

Loading