mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
webhooks: Add body to PR Review Event message for GitHub Integration.
This commit passes the body of the PR Review as the message to the helper function that generates the message to be sent by the GitHub Integration. Previously when a PR Review was done the message sent would just include the link of the review but the message didn't include the body the review. After this commit, the message also includes the body of the review. Fixes #24676
This commit is contained in:
@@ -240,13 +240,13 @@ class GitHubWebhookTest(WebhookTestCase):
|
||||
self.check_webhook("status__with_target_url", TOPIC_REPO, expected_message)
|
||||
|
||||
def test_pull_request_review_msg(self) -> None:
|
||||
expected_message = "baxterthehacker submitted [PR review](https://github.com/baxterthehacker/public-repo/pull/1#pullrequestreview-2626884)."
|
||||
expected_message = "baxterthehacker submitted [PR review](https://github.com/baxterthehacker/public-repo/pull/1#pullrequestreview-2626884):\n\n~~~ quote\nLooks great!\n~~~"
|
||||
self.check_webhook("pull_request_review", TOPIC_PR, expected_message)
|
||||
|
||||
def test_pull_request_review_msg_with_custom_topic_in_url(self) -> None:
|
||||
self.url = self.build_webhook_url(topic="notifications")
|
||||
expected_topic = "notifications"
|
||||
expected_message = "baxterthehacker submitted [PR review for #1 Update the README with new information](https://github.com/baxterthehacker/public-repo/pull/1#pullrequestreview-2626884)."
|
||||
expected_message = "baxterthehacker submitted [PR review for #1 Update the README with new information](https://github.com/baxterthehacker/public-repo/pull/1#pullrequestreview-2626884):\n\n~~~ quote\nLooks great!\n~~~"
|
||||
self.check_webhook("pull_request_review", expected_topic, expected_message)
|
||||
|
||||
def test_pull_request_review_comment_msg(self) -> None:
|
||||
|
||||
@@ -490,6 +490,7 @@ def get_pull_request_review_body(helper: Helper) -> str:
|
||||
url=payload["review"]["html_url"].tame(check_string),
|
||||
type="PR review",
|
||||
title=title if include_title else None,
|
||||
message=payload["review"]["body"].tame(check_string),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user