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.31k stars 582 forks source link

API requests should be sent to `api.my-name.ghe.com` instead of using `/api/v3` in the URL path #6233

Closed davidstaheli closed 1 month ago

davidstaheli commented 1 month ago

GitHub is requesting for this to be addressed by October 4, 2024 if at all possible, to ensure a seamless experience for users of this extension.

Steps to Reproduce:

GitHub logs show that recent API requests using the user agent "GitHub VSCode Pull Requests" targeted URLs with /api/v3 in the path, such as https://my-name.ghe.com/api/v3/users. The /api/v3 pattern is specific to GitHub Enterprise Server and isn't supported on github.com. Soon, it will also no longer work on *.ghe.com (please contact @davidstaheli and @eyalgal, GitHub PMs, for timing details). Instead, *.ghe.com hosts should be treated like GitHub Enterprise Cloud and the api. domain prefix should be used, similar to with github.com, such as https://api.my-name.ghe.com/users. Thank you!

alexr00 commented 1 month ago

Should have been fixed by https://github.com/microsoft/vscode-pull-request-github/pull/4941, but it looks like I missed a spot where we try to check if a git remote is actually GitHub Enterprise.

eleanorjboyd commented 1 month ago

@alexr00, gave this a try creating a pull request / refreshing and didn't see logs in the "GH pull request" output or the "Github" output channel. Where would I find the log to check and how would I ensure it is triggered?

alexr00 commented 1 month ago

The incorrect path was only being used when we try to figure out if your git remotes are actually GitHub Enterprise, so you'll need to sign out to verify.

To verify:

  1. Sign out of GitHub in VS Code
  2. Set the log level of GitHub Pull Request to "Debug"
  3. Clone a GitHub Enterprise Cloud repo and open this folder in VS Code
  4. Open the GitHub view container and click the "Sign in" button. Verify that you see the url of your GitHub Enterprise Cloud server in the modal dialog that shows up (ex. aaaaa.ghe.com).
  5. Open the output for GitHub Pull Request. Verify that there are no log lines that say "All headers".
rzhao271 commented 1 month ago

I tried using my DevDiv EMU account but didn't see a modal dialog for step 4. I logged in through my browser instead.

TylerLeonhardt commented 1 month ago

EMU isn't the same as GitHub Enterprise Cloud. You need an account within that instance (ccc.ghe.com). I think I should be able to verify this

alexr00 commented 1 month ago

Thanks @TylerLeonhardt !