mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
webhooks/github: Fix repeating description for edits and updates.
This change updates the GitHub Integration webhook get_opened_or_update_pull_request_body method so that the description is only printed if it actually changes. If the update event is a result of some other attribute update, such as an asignee change, then the description is not included in the message sent to the zulip stream. Fixes #16345
This commit is contained in:
@@ -251,6 +251,14 @@ class GitHubWebhookTest(WebhookTestCase):
|
||||
expected_message = "baxterthehacker edited [PR #1](https://github.com/baxterthehacker/public-repo/pull/1) from `changes` to `master`."
|
||||
self.check_webhook("pull_request__edited", TOPIC_PR, expected_message)
|
||||
|
||||
def test_pull_request_edited_with_body_change(self) -> None:
|
||||
expected_message = "cozyrohan edited [PR #1](https://github.com/cozyrohan/public-repo/pull/1) from `issue-#1` to `main`:\n\n~~~ quote\nPR EDITED\n~~~"
|
||||
self.check_webhook("pull_request__edited_with_body_change", TOPIC_PR, expected_message)
|
||||
|
||||
def test_pull_request_synchronized_with_body(self) -> None:
|
||||
expected_message = "baxterthehacker updated [PR #1](https://github.com/baxterthehacker/public-repo/pull/1) from `changes` to `master`."
|
||||
self.check_webhook("pull_request__synchronized_with_body", TOPIC_PR, expected_message)
|
||||
|
||||
def test_pull_request_assigned_msg(self) -> None:
|
||||
expected_message = "baxterthehacker assigned [PR #1](https://github.com/baxterthehacker/public-repo/pull/1) to baxterthehacker."
|
||||
self.check_webhook("pull_request__assigned", TOPIC_PR, expected_message)
|
||||
|
||||
Reference in New Issue
Block a user