microsoft / microsoft/vscode-pull-request-github

Plugin does not work with SSH aliases for SSH remotes

Offen
#6,228 2 Kommentare 5 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@alexr00 arbeitet bereits daran.

Seit 26.9.2024.

feature-request
Vorherrschende Sprache
TypeScript
Sterne
2.6k
Forks
796
Ø Merge
1 T. 4 Std.
Gemergte PRs (30 T.)
46

Beschreibung

Type: Bug

Background

Our instance of Github Enterprise is setup to require access via SSH. We also use an alias in ~/.ssh/config to make the git clone command shorter, something like:

Host gitsrv gitsrv.full.domain.com
    HostName gitsrv.full.domain.com
...

(names revised)

Steps (not working)

  1. Clone the repo using git clone gitsrv:MyOrg/cool_repo
  2. Open the folder in VS code and go to the PR tile
  3. The plugin is stuck at the "You have not yet signed in with GitHub" screen.
  4. The plugin logs has these messages:
2024-09-15 19:45:10.790 [info] GitHubServer> Received fallback response from the server: dial tcp: lookup gitsrv on 10.10.10.10:53: no such host
2024-09-15 19:45:10.790 [warning] GitHubServer> No response from host https://gitsrv/MyOrg/cool_repo: Unexpected token 'd', "dial tcp: "... is not valid JSON
2024-09-15 19:45:10.790 [warning] No remotes found. The following remotes are missing: origin, upstream

The plugin however works fine if we use the full server name (git clone gitsrv.full.domain.com:MyOrg/cool_repo). BTW, also works with the git@ prepended to the hostname.

Hypothesis

The plugin attempts to convert the SSH hostname/alias directly into the HTTP URL to the server. Perhaps it could attempt to resolve it via the SSH config file first? For e.g., this (on Unix like systems at least) seems to get the right name:

ssh -G "$SERVER" | egrep "^hostname\s+"| awk '{print $2}'

Related

Issue #6095 is potentially related, but there aren't enough details there to tell.

Extension version: 0.96.0
VS Code version: Code 1.93.1 (38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40, 2024-09-11T17:20:05.685Z)
OS version: Darwin arm64 23.6.0
Modes:

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.