Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

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 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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant