mattermost / mattermost-plugin-github

GitHub plugin for Mattermost
Apache License 2.0
156 stars 146 forks source link

fix message parse error on `pull_reviews` #778

Closed Sn-Kinos closed 2 months ago

Sn-Kinos commented 2 months ago

Summary

Fix the problem that plugin subscribed pull_reviews didn't show the state of pr review.

Description

The plugin didn't show the status of pr review. When I checked the code, I found #689 that makes the state to uppercase for switch-case statement. However, on renderTemplate, Its if statement is using the state with lowercase so renderTemplate can't get the state and can't parse properly. Then I modified states to lowercase and check it w/ make test

Reproduce

  1. Subscribe the repository with /github subscriptions add <owner>/<repo> --features pull_reviews on some channel.
  2. Make PR on the repository.
  3. Submit comment on the PR.
  4. Check the message on the channel.

Problem

AS IS TO BE
[owner/repo] @foo pr-title:

Lorem ipsum...
[owner/repo] @foo approved pr-title:

Lorem ipsum...

Ticket Link

NONE (under 20 lines of code change)

mattermost-build commented 2 months ago

Hello @Sn-Kinos,

Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

mickmister commented 2 months ago

Thanks for tracking down the issue and fixing it @Sn-Kinos 🚀

There's an open PR that fixes this issue that is in review https://github.com/mattermost/mattermost-plugin-github/pull/768. Would you be okay if I closed your PR in favor of that one? Thanks @Sn-Kinos

Sn-Kinos commented 2 months ago

Oops, I'd seen that PR before but I've forgot about it 😓😓. I don't mind about closing this PR :D @mickmister