vscode-gitlens icon indicating copy to clipboard operation
vscode-gitlens copied to clipboard

Improve Focus View response when attempting to `Connect to GitHub` with invalid settings.json

Open jkelroy opened this issue 1 year ago • 1 comments

When you have an invalid settings.json config for GitHub Enterprise and you open up the Focus View, selecting Connect to GitHub no-ops. Instead, we should be pointing the user to update their settings.json so they can connect the integration.

To repro:

  1. Include a forward slash at the end of your domain for gitlens.remotes for a GitHub Enterprise instance (see example)
  2. Open a GitHub Enterprise repository and then open the Focus View
  3. Select Connect to GitHub
  4. There is no response

Example of an invalid settings.json - removing the / resolves this and allows you to connect the integration.

{
  "gitlens.remotes": [
    {
      "domain": "githubenterprise-url.com/",
      "type": "GitHub"
    }
  ]
}

https://github.com/gitkraken/vscode-gitlens/assets/27739784/9ef60e29-7c37-4cde-ab32-ab8114b866d3

jkelroy avatar Feb 23 '24 17:02 jkelroy

Thanks, @jkelroy!

This was precisely the problem. Adding the gitlen.remotes entry in setup.json caused the Focus "Connect to GitHub" to ask me for a github PAT which then connected.

Thanks!

tprather avatar Feb 23 '24 18:02 tprather

Noting that in addition to in-client messaging updates to make it clearer in general when GitLens remote settings may be misconfigured, we should provide more detailed instructions about this setting (especially how to format each property) in the help center docs

axosoft-ramint avatar Feb 29 '24 17:02 axosoft-ramint