Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

github webhook: Fix markdown formatting clash.

The Dancef7e1ce5632b8
diff --git a/zerver/webhooks/github/tests.py b/zerver/webhooks/github/tests.py
index fc508191a35..ed563b6c53d 100644
--- a/zerver/webhooks/github/tests.py
+++ b/zerver/webhooks/github/tests.py
@@ -479,7 +479,7 @@ class GitHubWebhookTest(WebhookTestCase):
self.check_webhook("pull_request__unassigned", expected_topic_name, expected_message)
def test_pull_request_ready_for_review_msg(self) -> None:
- expected_message = "**Hypro999** has marked [PR #2](https://github.com/Hypro999/temp-test-github-webhook/pull/2) as ready for review."
+ expected_message = "Hypro999 has marked [PR #2](https://github.com/Hypro999/temp-test-github-webhook/pull/2) as ready for review."
self.check_webhook(
"pull_request__ready_for_review",
"temp-test-github-webhook / PR #2 Test",
@@ -487,7 +487,7 @@ class GitHubWebhookTest(WebhookTestCase):
)
def test_pull_request_review_requested_msg(self) -> None:
- expected_message = "**eeshangarg** requested [showell](https://github.com/showell) for a review on [PR #1](https://github.com/eeshangarg/Scheduler/pull/1)."
+ expected_message = "eeshangarg requested [showell](https://github.com/showell) for a review on [PR #1](https://github.com/eeshangarg/Scheduler/pull/1)."
self.check_webhook(
"pull_request__review_requested",
"Scheduler / PR #1 This is just a test commit",
@@ -495,7 +495,7 @@ class GitHubWebhookTest(WebhookTestCase):
)
def test_pull_request__review_requested_team_reviewer_msg(self) -> None:
- expected_message = "**singhsourabh** requested [authority](https://github.com/orgs/test-org965/teams/authority) for a review on [PR #4](https://github.com/test-org965/webhook-test/pull/4)."
+ expected_message = "singhsourabh requested [authority](https://github.com/orgs/test-org965/teams/authority) for a review on [PR #4](https://github.com/test-org965/webhook-test/pull/4)."
self.check_webhook(
"pull_request__review_requested_team_reviewer",
"webhook-test / PR #4 testing webhook",
@@ -505,7 +505,7 @@ class GitHubWebhookTest(WebhookTestCase):
def test_pull_request_review_requested_with_custom_topic_in_url(self) -> None:
self.url = self.build_webhook_url(topic="notifications")
expected_topic_name = "notifications"
- expected_message = "**eeshangarg** requested [showell](https://github.com/showell) for a review on [PR #1 This is just a test commit](https://github.com/eeshangarg/Scheduler/pull/1)."
+ expected_message = "eeshangarg requested [showell](https://github.com/showell) for a review on [PR #1 This is just a test commit](https://github.com/eeshangarg/Scheduler/pull/1)."
self.check_webhook("pull_request__review_requested", expected_topic_name, expected_message)
def test_pull_request_labeled_msg(self) -> None:
@@ -570,7 +570,7 @@ Check [randscape](http://github.com/github/hello-world/runs/4) completed (succes
def test_team_edited_description(self) -> None:
expected_topic_name = "team Testing"
expected_message = """\
-**Hypro999** changed the team description to:
+Hypro999 changed the team description to:
\n~~~ quote
A temporary team so that I can get some webhook fixtures!
~~~"""
diff --git a/zerver/webhooks/github/view.py b/zerver/webhooks/github/view.py
index 29ecfcb5907..6b3ed57f09b 100644
--- a/zerver/webhooks/github/view.py
+++ b/zerver/webhooks/github/view.py
@@ -512,7 +512,7 @@ def get_team_body(helper: Helper) -> str:
if "description" in changes:
actor = get_sender_name(helper)
new_description = payload["team"]["description"].tame(check_string)
- return f"**{actor}** changed the team description to:\n\n~~~ quote\n{new_description}\n~~~"
+ return f"{actor} changed the team description to:\n\n~~~ quote\n{new_description}\n~~~"
if "name" in changes:
original_name = changes["name"]["from"].tame(check_string)
new_name = payload["team"]["name"].tame(check_string)
@@ -626,7 +626,7 @@ def get_pull_request_auto_merge_body(helper: Helper) -> str:
def get_pull_request_ready_for_review_body(helper: Helper) -> str:
payload = helper.payload
- message = "**{sender}** has marked [PR #{pr_number}]({pr_url}) as ready for review."
+ message = "{sender} has marked [PR #{pr_number}]({pr_url}) as ready for review."
return message.format(
sender=get_sender_name(helper),
pr_number=payload["pull_request"]["number"].tame(check_int),
@@ -751,9 +751,9 @@ def get_pull_request_review_requested_body(helper: Helper) -> str:
sender = get_sender_name(helper)
pr_number = payload["pull_request"]["number"].tame(check_int)
pr_url = payload["pull_request"]["html_url"].tame(check_string)
- message = "**{sender}** requested {reviewers} for a review on [PR #{pr_number}]({pr_url})."
+ message = "{sender} requested {reviewers} for a review on [PR #{pr_number}]({pr_url})."
message_with_title = (
- "**{sender}** requested {reviewers} for a review on [PR #{pr_number} {title}]({pr_url})."
+ "{sender} requested {reviewers} for a review on [PR #{pr_number} {title}]({pr_url})."
)
body = message_with_title if include_title else message