Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review mode disabled because GraphQL support not discovered for GHE #947

Closed
ChrisHines opened this issue Feb 12, 2019 · 11 comments
Closed
Assignees

Comments

@ChrisHines
Copy link

Issue Type: Bug

GitHub Enterprise 2.15.3

  1. Open a workspace with a GHE repo. (In case it's relevant, the local repo has a git@<host>:<user>/<repo>.git style remote.)
  2. Open the output panel
  3. View Github Pull Request output

I get:

[Info] Looking for git repository
[Info] Git repository found, initializing review manager and pr tree view.
[Info] Found GitHub remote
[Info] https://<redacted>/api/v3: GraphQL not supported (Network error: Response not successful: Received status code 404)
[Info] Review> no matching pull request metadata found for current branch master

I expected graphql to work. Clicking through the API doc links on our instance of GHE brings me to this page https://developer.github.com/enterprise/2.15/v4/guides/intro-to-graphql/. Following that documentation I found that the following command works using the same token that I have configured for the vscode-github-pr extention.

curl -H "Authorization: bearer <redacted>" https://<redacted>/api/graphql

The following also works, but returns a much smaller JSON response with a series of URL patterns that doesn't look like a GraphQL result.

curl -H "Authorization: bearer <redacted>" https://<redacted>/api/v3

The extension does not enable the batch review mode feature because it cannot find the GraphQL support.

Extension version: 0.4.0
VS Code version: Code 1.31.0 (7c66f58312b48ed8ca4e387ebd9ffe9605332caa, 2019-02-05T22:32:14.164Z)
OS version: Darwin x64 17.7.0

@kyeotic
Copy link

kyeotic commented Feb 18, 2019

I'm also experiencing this bug with this exact error, but oddly several of my teammates are able to use this plugin with the same GHE instance. I think more logging needs to be added to help identify the issue.

@StanleyGoldman StanleyGoldman self-assigned this Mar 5, 2019
@StanleyGoldman
Copy link
Contributor

StanleyGoldman commented Mar 5, 2019

It seems the endpoint the graphql query was being sent to is incorrect
https://developer.github.com/enterprise/2.15/v4/guides/forming-calls/#the-graphql-endpoint

The endpoint should take the form of...

http(s)://[hostname]/api/graphql

@StanleyGoldman
Copy link
Contributor

Hey @ChrisHines I'm trying real hard to reproduce your issue but I'm not having much luck.
I initially cloned via HTTPS, then via SSH, and both times the pull request list loads, the detail page displays.

I'm using a 2.16 instance of GHE and I'm going to get my hands on a 2.15 instance and test again.

I was hoping if you could try again with the latest version of the plugin.

@tyrsius Can you let us know what version of GitHub Enterprise you are testing against?

@ChrisHines
Copy link
Author

@StanleyGoldman I just tried again. The problem still exists. We still have GHE 2.15.3 here, but my VSCode is now 1.32.1 and my GitHub Pull Requests version is now 0.5.0.

Clarification

The extension mostly works. I can see the list of pull requests. I can load the detail page, and I can checkout the PR. But I cannot do batch reviews. When I click in the editor to add a review comment, I cannot see a Start Review button. I only see the Add Comment button. My understanding was that review mode should be implemented based on #546 being closed.

When it didn't work I looked at the two commits linked at the bottom of #546 and it looked to me like the review mode functionality is gated by support for graphql. That's why I mentioned in my initial issue post above that it seemed the extension was having problems finding the graphql endpoint.

@kyeotic
Copy link

kyeotic commented Mar 12, 2019

I believe this is caused by PR names that fail to deserialize. Possibly from length, possibly from having emoji in them.

@StanleyGoldman
Copy link
Contributor

Thanks for the clarification, I'm able to reproduce this...

On a public GitHub repo with a PR not created by me:
image

On a private GitHub Enterprise instance with a PR not created by me:
image

@sreenath1491
Copy link

I am having the same problem here. Unable to see the Start Review button and see the error message https://<redacted>/api/v3: GraphQL not supported (Network error: Response not successful: Received status code 404). I did a little debugging with vscode insiders and found the issue with url used for graphql at this line: https://github.com/microsoft/vscode-pull-request-github/blob/master/src/github/credentials.ts#L191. The baseUrl=https://<redacted>/api/v3 and the link function here: https://github.com/microsoft/vscode-pull-request-github/blob/master/src/github/credentials.ts#L274 seems to append /graphql to the url making the final graphQL url: https://<redacted>/api/v3/graphql thus giving a 404 response. It should be https://<redacted>/api/graphql. I was able to get a successful response by changing the URL. I am not sure if the cause has already been found .

@ChrisHines
Copy link
Author

I would really like to use the review mode feature on my GHE projects. Is there anything I can do to help get a fix for this issue into the next release? @StanleyGoldman has reproduced the issue and @sreenath1491 has done some initial debugging here. What is the next step?

@Cammisuli
Copy link

There's also some changes that are required here:

if (hostUri.authority === 'github.com') {
return path;
} else {
return `/api/v3${path}`;
}

@ChrisHines
Copy link
Author

@StanleyGoldman This issue is assigned to you, are you still working on it?

@ChrisHines
Copy link
Author

This was fixed for me by #1382 in release 0.13.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants