mattermost-plugin-github icon indicating copy to clipboard operation
mattermost-plugin-github copied to clipboard

In RHS, display whether there are linked pull requests to issues, and if there are linked issues for pull requests

Open mickmister opened this issue 5 years ago • 7 comments

It would be good to know when looking at Your Assignments if there is a submitted pull request that fixes an issue. That way the user can filter out issues that have already been addressed by an open pull request when looking at assigned tasks.

I'm not sure if this is something we already have access to given the requests we are making to GitHub's API. If this feature requires more API requests that we are not already making, I'm inclined to say this feature is not worth implementing.

mickmister avatar May 14 '20 16:05 mickmister

4/5, I think its not worth implementing, it will need additional API requests. We are fetching data from Link. We may get that data if assign same PR to current user, not doing that would lead to unexpected behavior.

sanjaydemansol avatar Jul 31 '21 05:07 sanjaydemansol

@sanjaydemansol Thanks for looking into the issue. Do you think this would be feasible using the GraphQL service being used in this PR https://github.com/mattermost/mattermost-plugin-github/pull/404?

mickmister avatar Aug 02 '21 15:08 mickmister

Yeah, it should be, in GraphQL. I will look into that.

sanjaydemansol avatar Aug 26 '21 15:08 sanjaydemansol

Hi @mickmister , I looked into it. 2/5 It is possible via Graphql. Here is an example I have prepared where, we have fetched title to referenced PR.

{
  search(first: 3, type: ISSUE, query: "user:sanjaydemansol is:open") {
    issueCount
    pageInfo {
      hasNextPage
      endCursor
    }
    edges {
      node {
        ... on Issue {
          createdAt
          title
          url
          number
          timelineItems(last: 2) {
            edges {
              node {
                ... on ConnectedEvent {
                  subject {
                    ... on PullRequest {
                      title
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

sanjaydemansol avatar Dec 27 '21 17:12 sanjaydemansol

@sanjaydemansol The query doesn't quite seem right. E.g. it gives me https://github.com/hanzei/plugin-test/issues/3 as a result.

hanzei avatar Jan 04 '22 13:01 hanzei

@sanjaydemansol If you want to get into graphql, wrapping up https://github.com/mattermost/mattermost-plugin-github/pull/404 might be a good starting point.

hanzei avatar Jan 04 '22 13:01 hanzei

@sanjaydemansol If you want to get into graphql, wrapping up #404 might be a good starting point.

@hanzei Yes that PR should probably be merged before any other work is using GraphQL, as the PR introduces a robust checking of the plugin settings etc. to construct the GraphQL queries properly.

We should only implement and maintain one solution to GraphQL, so 2/5 it makes the most sense to complete and merge that PR first and foremost.

mickmister avatar Jan 10 '22 08:01 mickmister