GitHub import: improve OAuth flow design and documentation

On the "new github import" page (/import/github/new), when GitHub OAuth is not enabled it looks like this:

Screenshot_2023-11-29_at_1.53.26_PM

2 problems with this stage:

  1. The message links to https://staging-ref.gitlab.com/help/integration/github, which describes how to set up GitHub OAuth but is not specific to setting up GitHub for imports. Import requires some additional steps, as discussed in this issue: GitHub import rate limit: ensure we are using G... (#432970 - closed)

  2. The "Authenticate" button makes a POST request to /import/github/personal_access_token, which results in an error "Missing OAuth configuration for GitHub.".

Once GitHub OAuth is set up, the page shows 2 blue buttons, both for OAuth. Kind of unexpected. This 2 button thing comes up in this video showing a screenshare of GitHub OAuth for imports

Proposal

As for (2): Let's add frontend validation when the user clicks the Authenticate button under the PAT field (not targeting the Authenticate with GitHub button) and display an error Please enter a valid PAT when the field is empty.

Edited by Martin Wortschack