vscode-pull-request-github: Unable to Access Enterprise Git Pull Requests
❯ git remote --v
origin git@github3.abcd-comp.com:myuser/some-repo.git (fetch)
origin git@github3.abcd-comp.com:myuser/some-repo.git (push)
origin-https https://github3.abcd-comp.com/my-org/some-repo.git (fetch)
origin-https https://github3.abcd-comp.com/my-org/some-repo.git (push)
upstream git@github3.abcd-comp.com:my-org/some-repo.git (fetch)
upstream git@github3.abcd-comp.com:my-org/some-repo.git (push)
With the repo configuration as above, and following VSCode settings
{
"github-enterprise.uri": "https://github3.abcd-comp.com",
"githubPullRequests.remotes": [
"origin",
"upstream",
]
}
I am unable to see any PRs being listed in the VSCode.
[2022-03-03 18:56:35.177] [exthost] [info] Extension host with pid 2298 started
[2022-03-03 18:56:35.237] [exthost] [info] ExtensionService#_doActivateExtension vscode.configuration-editing, startup: false, activationEvent: 'onLanguage:jsonc'
[2022-03-03 18:56:35.241] [exthost] [info] ExtensionService#_doActivateExtension vscode.json-language-features, startup: false, activationEvent: 'onLanguage:jsonc'
[2022-03-03 18:56:35.252] [exthost] [info] ExtensionService#_doActivateExtension vscode.typescript-language-features, startup: false, activationEvent: 'onLanguage:jsonc'
[2022-03-03 18:56:35.260] [exthost] [info] ExtensionService#_doActivateExtension vscode.microsoft-authentication, startup: false, activationEvent: 'onAuthenticationRequest:microsoft'
[2022-03-03 18:56:35.272] [exthost] [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch, startup: true, activationEvent: '*'
[2022-03-03 18:56:35.274] [exthost] [info] ExtensionService#_doActivateExtension vscode.git-base, startup: true, activationEvent: '*', root cause: vscode.github
[2022-03-03 18:56:35.276] [exthost] [info] ExtensionService#_doActivateExtension GitHub.vscode-pull-request-github, startup: true, activationEvent: '*'
[2022-03-03 18:56:35.328] [exthost] [info] ExtensionService#_doActivateExtension vscode.github-authentication, startup: false, activationEvent: 'onAuthenticationRequest:github'
[2022-03-03 18:56:38.123] [exthost] [info] ExtensionService#_doActivateExtension vscode.git, startup: false, activationEvent: 'api', root cause: GitHub.vscode-pull-request-github
[2022-03-03 18:56:38.267] [exthost] [info] ExtensionService#_doActivateExtension vscode.github, startup: true, activationEvent: '*'
[2022-03-03 18:56:38.279] [exthost] [info] Eager extensions activated
[2022-03-03 18:56:38.284] [exthost] [info] ExtensionService#_doActivateExtension vscode.emmet, startup: false, activationEvent: 'onStartupFinished'
[2022-03-03 18:56:38.288] [exthost] [info] ExtensionService#_doActivateExtension vscode.merge-conflict, startup: false, activationEvent: 'onStartupFinished'
[Info] Registering git provider
[Info] Looking for git repository
[Info] Found 0 repositories during activation
[Info] Git repository found, initializing review manager and pr tree view.
[Info] Repository file:///....... has been opened
[Info] Review> Validate state in progress
[Info] Review> Validating state...
[Info] Cannot updates repositories as git is uninitialized
[Info] Git initialization state changed: state=initialized
[Info] Review> Queuing additional validate state
[Info] Review> Validating state...
[Info] No remotes found. The following remotes are missing: origin, upstream, origin-https
[Info] No GitHub remotes found
[Info] Review> Queuing additional validate state
[Info] Repo state for file:///...... changed.
[Info] Repo file:///.... has already been setup.
[Info] Review> Validating state...
[Info] Found GitHub remote
[Info] Review> no matching pull request metadata found for current branch master
[Info] Review> no matching pull request metadata found on GitHub for current branch master
[Info] Found GitHub remote
[Info - 13:56:35.342] Reading sessions from keychain...
[Info - 13:56:38.118] Getting sessions for read:user,repo,user:email...
[Info - 13:56:38.118] Got 0 sessions for read:user,repo,user:email...
Is there something I am doing wrong?
- Extension version: v0.36.2
- VSCode Version: 1.64.2 (Universal)
- OS: OSx
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 15 (5 by maintainers)
Commits related to this issue
- Issue #3371 | Updated getAuthSessionOptions in case of GitHub Enterprise AuthProvider — committed to jpspringall/vscode-pull-request-github by jpspringall 2 years ago
- Issue #3371 | Updated getAuthSessionOptions in case of GitHub Enterprise AuthProvider (#3565) Resolves Unable to Access Enterprise Git Pull Requests #3371 — committed to microsoft/vscode-pull-request-github by jpspringall 2 years ago
Sorry @wrslatz I have been away from this space for a while and lost track of this thread. I switched to insiders with latest like @alexr00 suggested and I am able to manage GHE accounts properly so far. I am also able to manage my external repo access at the same time in a clean way as well. I did log out of the current session just to avoid confusion.
Folks who are seeing these issues: can you please try out VS Code Insiders with the latest pre-release version of the extension? There are some important changes there that might fix the issues you’re seeing:
You might need to sign out and sign back in again in VS Code to get things working.
Please do post back on whether it works or not!
@wrslatz If you are on macOS then you might give it a try by cleaning up the keychain entries for vscode github auth.
delete and that should let you re-login. When you do so, use the Enterprise auth firs and then the public one. That is what worked for me.
When I was logged into the Public Github, it never provided me an option to Authenticate against the Enterprise git. and even when it did, it only worked after the above fix. Cleaning up the keychain and recreating helped. Been working for me since.
Hi @harshanarayana and @wrslatz I actually think this issue is a bit more severe than stated in this post. It actually stops you signing in if you are not signed into GitHub Enterprise
@harshanarayana I have taken your code and created a PR #3564 Though it can’t go as is, as I have also updated some md files with further information @wrslatz I have created a release for it
I’m fairly confident that the worst of the auth issues are solved for GitHub Enterprise so I’m closing this issue. If you encounter any other problems please open a new issue and include the version of GitHub Enterprise you’re using!
@wrslatz looking at your log your issue may be slightly different as you are getting a session back. Both @harshanarayana and I are getting 0 sessions back: Got 0 sessions for read:user,repo,user:email
But feel free to give it a go and see what happens
Cheers
James
I did some digging and looks like I found the quick fix.
Adding the above in
src/github/credentials.ts
underinitialize
seem to fix the issue. Looks like 7aebab4 seem to have broken a small case.I rebuilt the extension with above changes and got it working until we get an official fix.