Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
webhooks/github: Distinguish review request removal from unassigning.
Niloth Pc0aa4b4b1204
diff --git a/zerver/webhooks/github/tests.py b/zerver/webhooks/github/tests.pyindex 51ea478eced..0c3e746c982 100644--- a/zerver/webhooks/github/tests.py+++ b/zerver/webhooks/github/tests.py@@ -546,14 +546,14 @@ class GitHubWebhookTest(WebhookTestCase):)def test_pull_request_review_request_removed_msg(self) -> None:- expected_message = "soheil-star01 unassigned [redolat](https://github.com/redolat) from [PR #1](https://github.com/techpillars-oy/test1/pull/1)."+ expected_message = "soheil-star01 removed the review request for [redolat](https://github.com/redolat) from [PR #1](https://github.com/techpillars-oy/test1/pull/1)."self.check_webhook("pull_request__review_request_removed", "test1 / PR #1 Feat/webhook", expected_message)def test_pull_request_review_request_removed_with_custom_topic_in_url(self) -> None:self.url = self.build_webhook_url(topic="notifications")- expected_message = "soheil-star01 unassigned [redolat](https://github.com/redolat) from [PR #1 Feat/webhook](https://github.com/techpillars-oy/test1/pull/1)."+ expected_message = "soheil-star01 removed the review request for [redolat](https://github.com/redolat) from [PR #1 Feat/webhook](https://github.com/techpillars-oy/test1/pull/1)."self.check_webhook("pull_request__review_request_removed", "notifications", expected_message)@@ -565,7 +565,7 @@ class GitHubWebhookTest(WebhookTestCase):self.get_body("pull_request__review_requested_team_reviewer"))["requested_team"]- expected_message = "soheil-star01 unassigned [authority](https://github.com/orgs/test-org965/teams/authority) from [PR #1](https://github.com/techpillars-oy/test1/pull/1)."+ expected_message = "soheil-star01 removed the review request for [authority](https://github.com/orgs/test-org965/teams/authority) from [PR #1](https://github.com/techpillars-oy/test1/pull/1)."self.check_webhook("pull_request__review_request_removed","test1 / PR #1 Feat/webhook",diff --git a/zerver/webhooks/github/view.py b/zerver/webhooks/github/view.pyindex e7df1e40005..844dab93bef 100644--- a/zerver/webhooks/github/view.py+++ b/zerver/webhooks/github/view.py@@ -734,7 +734,7 @@ def get_pull_request_review_requested_or_removed_body(helper: Helper) -> str:review_request_change = (f"requested {reviewer_link} for a review on"if payload["action"].tame(check_string) == "review_requested"- else f"unassigned {reviewer_link} from"+ else f"removed the review request for {reviewer_link} from")return f"{sender} {review_request_change} [{pr_reference}]({pr_url})."