microsoft / vscode-pull-request-github

GitHub Pull Requests for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github
MIT License
2.26k stars 554 forks source link

Support multiple GitHub accounts #3595

Open skorpions2000 opened 2 years ago

skorpions2000 commented 2 years ago

Possibly related to closed issue https://github.com/microsoft/vscode-pull-request-github/issues/1941 but am reporting again as instructed at the bottom of the thread on that issue.

Extension version: v0.42.0
VSCode Version: 1.67.2
OS: Windows 10

изображение

alexr00 commented 2 years ago

@skorpions2000 thanks for making a new issue! Are you using GitHub enterprise?

Can you also please share the output from "GitHub Pull Requests"?

jasonmacallister commented 2 years ago

Also using GitHub Enterprise Server. From Output:

[Info] GitHubRepository> Fetching pull requests for branch failed: HttpError: Not Found [Info] GithubRepository> Unable to fetch issues without milestone: Error: GraphQL error: Could not resolve to a Repository with the name 'org/repo' [Info] GithubRepository> Unable to fetch issues with query: Error: GraphQL error: Could not resolve to a Repository with the name 'org/repo'

alexr00 commented 1 year ago

There has been a lot of work done in August and September to support GitHub Enterprise better. Could you try again with the latest version of the extension?

CombeeMike commented 1 year ago

I'm seeing this same issue with the same log output as shown by @jasonmacallister above with the latest v0.56.0.

I'm not using GitHub enterprise. At least I don't think so. Is there a place where I can verify this?

ATM I'm not able to use the extension at all due to this error...

FYI, the url shown in the error toaster is correct. At least it's the same URL as GitHub shows in the upper right corner of the repo as SSH clone url.

Not sure if relevant but using VSCode actions like Git: Pull works as expected.

alexr00 commented 1 year ago

I'm not using GitHub enterprise. At least I don't think so. Is there a place where I can verify this?

If your clone url is github.com then you are not using GitHub Enterprise. Is it a github.com url?

CombeeMike commented 1 year ago

I'm not using GitHub enterprise. At least I don't think so. Is there a place where I can verify this?

If your clone url is github.com then you are not using GitHub Enterprise. Is it a github.com url?

Ok, then I'm not using enterprise. The url is git@github.com:abc/xyz.git.

alexr00 commented 1 year ago

@CombeeMike in that case can you please do the following:

CombeeMike commented 1 year ago

@alexr00 I just realized that this was my own fault. I had 2 GitHub accounts connected to VSCode where 1 is a private and the other a work account. I'm using the PR extension exclusively with my work account and the repo I'm using it with is a private one. After completely removing the private account from VSCode, the PR extensions asked me to sign in, which I then did with the work account.

This solved the issue for me, so it seems like the PR extension was somehow erroneously connected/signed in with my private account which does not have access to the repo I was having troubles with.

Sorry for wasting your time with this, I could have also figured this out before asking for help here 🙈

alexr00 commented 1 year ago

@CombeeMike thanks for all details, they might help someone else who comes across this issue. Some other thoughts:

matt-unosquare commented 7 months ago

I am in a similar situation, where i have 2 githubs, 1 work, 1 personal, and the extension appears to be setup with the personal, but i see no way to telling it to use the work one instead

z-budhirajamadhav commented 2 months ago

+1 extension has setup on my personal account. I do not wish to use multiple accounts - can I still atleast tell the extension to use which account?

alexr00 commented 2 months ago

The only option until we have https://github.com/microsoft/vscode/issues/127967 is to sign out of the account you don't want to use.

As suggested here you could use VS Code Insiders for one account and VS Code stable for another.