automatic-pull-request-review icon indicating copy to clipboard operation
automatic-pull-request-review copied to clipboard

DISMISS doesn't work

Open Ana06 opened this issue 4 years ago • 1 comments

It seems that the addPullRequestReview mutation doesn't support DISMISS. I think this is a GitHub bug and not a problem in the action itself. But as a result the action is broken. You can check this with the following queries in https://docs.github.com/en/graphql/overview/explorer:

query get_pr_id {
  repository(owner: "Ana06", name: "capa") {
    pullRequest(number: 2) {
      id
      number
      title
    }
  }
}

image

mutation add_review {
  addPullRequestReview(input: {
    pullRequestId: "MDExOlB1bGxSZXF1ZXN0NTk3NzMyNTAx",
    event: REQUEST_CHANGES,
    body: "I request changes!"}
  ) { clientMutationId }
}

image

mutation dismiss_review {
  addPullRequestReview(input: {
    pullRequestId: "MDExOlB1bGxSZXF1ZXN0NTk3NzMyNTAx",
    event: DISMISS,
    body: "I don't request changes!"}) {
    clientMutationId
  }
}

image

I reported it to GitHub 9 days ago. GitHub support has told me to use the dismisspullrequestreview mutation. They are still looking into it, so it might be that they fix addPullRequestReview to support DISMISS. Otherwise we could update the code to use dismisspullrequestreview, as it seems to be working properly. I can send a PR after https://github.com/AndrewMusgrave/automatic-pull-request-review/pull/47 (to avoid merge conflicts).

Ana06 avatar May 19 '21 21:05 Ana06

I have released Ana06/[email protected] which fixes this and includes https://github.com/AndrewMusgrave/automatic-pull-request-review/pull/47: https://github.com/Ana06/automatic-pull-request-review/compare/0.0.5...v0.1.0

Ana06 avatar May 27 '21 14:05 Ana06