mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 06:53:25 +00:00
webhooks/github: Suppress "comment edited" events when body is same.
GitHub generates spurious edited events on hiding/unhiding a comment, and on clicking "edit"/"update" without any changes, when the comment "body" contains certain specific characters. Instead of sending a notification message, we suppress those edge cases by comparing the "body" content of the comment and changes in the event payload. Fixes #31042, #26136.
This commit is contained in:
@@ -629,6 +629,14 @@ A temporary team so that I can get some webhook fixtures!
|
||||
expected_message = "sbansal1999 edited a [comment](https://github.com/sbansal1999/testing-gh/discussions/20#discussioncomment-6332416) on [discussion #20](https://github.com/sbansal1999/testing-gh/discussions/20):\n\n~~~ quote\nsome random comment edited\n~~~"
|
||||
self.check_webhook("discussion_comment__edited", TOPIC_DISCUSSION, expected_message)
|
||||
|
||||
def test_comment_edited_unchanged_skipped(self) -> None:
|
||||
self.check_webhook(
|
||||
fixture_name="issue_comment__edited__unchanged",
|
||||
expected_topic_name=None,
|
||||
expected_message=None,
|
||||
expect_noop=True,
|
||||
)
|
||||
|
||||
|
||||
class GitHubSponsorsHookTests(WebhookTestCase):
|
||||
CHANNEL_NAME = "github"
|
||||
|
||||
Reference in New Issue
Block a user