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

Pull Request Reviews are not posted. #686

Closed
niklas opened this issue Jul 11, 2023 · 1 comment · Fixed by #689
Closed

Pull Request Reviews are not posted. #686

niklas opened this issue Jul 11, 2023 · 1 comment · Fixed by #689
Labels
Type/Bug Something isn't working

Comments

@niklas
Copy link

niklas commented Jul 11, 2023

When Pull Request Reviews are submitted (Comment, Approve, Change Requested), no message appears in the subscribed channel

Reproduction steps:

  1. Set up Github Plugin as in instructions (company-wide webhook)
  2. Open PR (is posted in channel)
  3. Post a normal comment on PR (is posted, too)
  4. Add a PR Review (NOT posted)

Logging

When enabling DEBUG logging, the following line appears:

{"timestamp":"2023-07-11 12:23:12.556 Z","level":"debug","msg":"Unhandled review state","caller":"app/plugin_api.go:970","plugin_id":"github","state":"approved"}

Investigation:

Looking at webhook.go:827, the review state is checked against uppercase APPROVED, but it seems to be lowercase approved. Same goes fort the other PR review actions.

Extras

Here is the payload from the github webhook settings page (cleared private data):

{
  "action": "submitted",
  "review": {
    "id": 1234567,
    "node_id": "PRR_XXXXX",
    "user": {
      "login": "niklas",
     [..]
    },
    "body": "Thanks, that looks better. I'll change the wording to German.",
    "commit_id": "abcdedf123345",
    "submitted_at": "2023-07-11T11:38:40Z",
    "state": "approved",
    "html_url": "---",
    "pull_request_url": "----",
    "author_association": "CONTRIBUTOR",
    "_links": {
      "html": {
        "href": "---"
      },
      "pull_request": {
        "href": "---"
      }
    }
  },
[...]
}

As one can see, github sends review.state = "approved" (lowercase).

@hanzei hanzei added the Type/Bug Something isn't working label Jul 13, 2023
Kshitij-Katiyar added a commit to Brightscout/mattermost-plugin-github that referenced this issue Aug 11, 2023
Kshitij-Katiyar added a commit to Brightscout/mattermost-plugin-github that referenced this issue Aug 14, 2023
mickmister pushed a commit that referenced this issue Aug 16, 2023
* [MI-3380]:Fixed issue #686 'Pull Request Reviews are not posted' (#34)

* [MM-686]:fixed review comments
@niklas
Copy link
Author

niklas commented Aug 22, 2023

Thank you. <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type/Bug Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

2 participants