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

Honor the resolved/unresolved state of pull request comments #2245

Open
jcansdale opened this issue Feb 27, 2019 · 0 comments
Open

Honor the resolved/unresolved state of pull request comments #2245

jcansdale opened this issue Feb 27, 2019 · 0 comments

Comments

@jcansdale
Copy link
Collaborator

@jcansdale jcansdale commented Feb 27, 2019

At the moment pull request comments are only hidden inside the extension when the code near to them hasn't been changed (they're not marked as Outdated on github.com). The option to Resolve conversation has recently been added to github.com. We should continue showing conversations until they have been marked as resolved.

How it looks on dotcom

Here is a comment on the github.com conversation view that is marked as Outdated but that is still visible because it hasn't been resolved.

image

Here is a comment that is visible on the diff view that isn't Outdated, but that has been resolved.

image

Required APIs

Unfortunately the GraphQL schema that exposes the resolved/unresolved state of comments is under preview.

In order to use use these preview schema together, the API needs to be accessed using the following header:

Accept: application/vnd.github.ocelot-preview;application/vnd.github.cateye-preview+json

This isn't supported by GitHub's API explorer but is supported by the GraphiQL app.

image

You will need to use a GraphQL endpoint of:

https://api.github.com/graphql?access_token=your_personal_access_token

Here is a sample query:

{
  repository(owner: "github", name: "VisualStudio")
  {
    pullRequest(number: 2241)
    {
      reviewThreads(first: 100)
      {
        nodes        
        {    
          isResolved resolvedBy { name }
          
          comments(first: 100)
          {
            nodes { path bodyText }
          }
        }
      }
    }
  }
}

Here is a resolved comment thread:

            {
              "isResolved": true,
              "resolvedBy": {
                "name": "Jamie Cansdale"
              },
              "comments": {
                "nodes": [
                  {
                    "path": "src/GitHub.App/Services/RepositoryCloneService.cs",
                    "bodyText": "Maybe we should move the log.Error(...) to above DeleteDirectory in case it also throws?"
                  }
                ]
              }
            }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.