webhooks: Remove description from Issue Assigned event message.

This commit removes the description from the Issue Assigned
event message that is sent by the Github Integration.

Previously when an issue was assigned, the message also had the
description of the issue, which is redundant as the description
has been already sent through the issue created event. After
this commit, the description no longer appears in the message.

Fixes #24554
This commit is contained in:
sbansal1999
2023-04-22 09:32:54 +05:30
committed by Tim Abbott
parent 566e59f0c2
commit 85689a5343
2 changed files with 3 additions and 3 deletions

View File

@@ -143,14 +143,14 @@ class GitHubWebhookTest(WebhookTestCase):
self.check_webhook("issues", expected_topic, expected_message)
def test_issue_assigned(self) -> None:
expected_message = "sbansal1999 assigned [issue #7](https://github.com/sbansal1999/testing-gh/issues/7) (assigned to sbansal1999):\n\n~~~ quote\nIDK how this works, lets see if it can be fixed or not.\n~~~"
expected_message = "sbansal1999 assigned [issue #7](https://github.com/sbansal1999/testing-gh/issues/7) (assigned to sbansal1999)."
expected_topic = "testing-gh / issue #7 Sample Issue testing something"
self.check_webhook("issues__assigned", expected_topic, expected_message)
def test_issue_assigned_with_custom_topic_in_url(self) -> None:
self.url = self.build_webhook_url(topic="notifications")
expected_topic = "notifications"
expected_message = "sbansal1999 assigned [issue #7 Sample Issue testing something](https://github.com/sbansal1999/testing-gh/issues/7) (assigned to sbansal1999):\n\n~~~ quote\nIDK how this works, lets see if it can be fixed or not.\n~~~"
expected_message = "sbansal1999 assigned [issue #7 Sample Issue testing something](https://github.com/sbansal1999/testing-gh/issues/7) (assigned to sbansal1999)."
self.check_webhook("issues__assigned", expected_topic, expected_message)
def test_issue_unassigned(self) -> None:

View File

@@ -165,7 +165,7 @@ def get_issue_body(helper: Helper) -> str:
action=action,
url=issue["html_url"].tame(check_string),
number=issue["number"].tame(check_int),
message=issue["body"].tame(check_none_or(check_string)),
message=None if action == "assigned" else issue["body"].tame(check_none_or(check_string)),
assignee=assignee["login"].tame(check_string) if assignee else None,
title=issue["title"].tame(check_string) if include_title else None,
)