oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.71k stars 2.73k forks source link

Bun still ask for Github credential when SSH key is set up #12172

Closed Paper-Folding closed 1 month ago

Paper-Folding commented 3 months ago

What version of Bun is running?

1.1.17

What platform is your computer?

Windows

What steps can reproduce the bug?

  1. Add ssh+git as a dependency, for example:
    "my-lib": "git+ssh://git@github.com/My-Namespace/my-lib.git#1.0.0"
  2. Note that SSH key has been generated and add to git locally, i.e., these command is being executed before:
    git config --global gpg.format ssh
    git config --global user.signingkey "C:\Users\[my-username]\.ssh\id_ed25519.pub"
  3. Run bun install
  4. A "Connect to Github" dialog will appear first:
    image
  5. Close the dialog manually and "The string binding is invalid" error dialog will show:
    image
  6. Close the error dialog again and I'm using vscode, vscode will ask me for password, so I skip with esc key
  7. Finally, bun will install the dependency successfully via SSH key.

The problem is, the dialog in step 5 and 6 should not appear. When I'm using yarn before, this issue does not exists.

What is the expected behavior?

The dialog in step 5 and 6 above should not appear, Bun should check for SSH key first before asking for github credential.

What do you see instead?

No response

Additional information

No response

rluba commented 1 month ago

I just encountered the same issue, but with a private GitLab instance: I have a git+ssh://git@<server>/<repo>#v2.1.0 dependency and bun install shows a Password for https://git@<server> prompt – for a split-second, before it gets overwritten by other console status updates.

That the prompt gets deleted makes the issue more difficult to diagnose because then the process just hangs and you don’t know why. You can only detect it due to the still-visible trailing key symbol on the macOS terminal:

missing password prompt

The password prompt hints at the underlying issue: the dependency is configured as git+ssh, but bun nonetheless tries to access it via https!

Paper-Folding commented 1 month ago

I just encountered the same issue, but with a private GitLab instance: I have a git+ssh://git@<server>/<repo>#v2.1.0 dependency and bun install shows a Password for https://git@<server> prompt – for a split-second, before it gets overwritten by other console status updates.

That the prompt gets deleted makes the issue more difficult to diagnose because then the process just hangs and you don’t know why. You can only detect it due to the still-visible trailing key symbol on the macOS terminal: missing password prompt

The password prompt hints at the underlying issue: the dependency is configured as git+ssh, but bun nonetheless tries to access it via https!

The problem is, I have already set up git properly after that the bun still asks me for credentials.

rluba commented 1 month ago

Never mind. The issue I mentioned is actually fixed with the latest bun version. (I was running a slightly outdated version.)