mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
integration: Remove branch names to Gogs edited PR event.
This is a follow up to #24673, we want to modify every webhook events to follow the same pattern and consistency where branch name should only show on opened and merged events.
This commit is contained in:
@@ -85,7 +85,7 @@ class GogsHookTests(WebhookTestCase):
|
||||
|
||||
def test_pull_request_edited(self) -> None:
|
||||
expected_topic = "test / PR #1349 Test"
|
||||
expected_message = """kostekIV edited [PR #2](https://try.gogs.io/kostekIV/test/pulls/2) from `c` to `master`."""
|
||||
expected_message = """kostekIV edited [PR #2](https://try.gogs.io/kostekIV/test/pulls/2)."""
|
||||
self.check_webhook("pull_request__edited", expected_topic, expected_message)
|
||||
|
||||
def test_pull_request_assigned(self) -> None:
|
||||
|
||||
@@ -81,8 +81,11 @@ def format_pull_request_event(payload: WildValue, include_title: bool = False) -
|
||||
action = payload["action"].tame(check_string)
|
||||
url = payload["pull_request"]["html_url"].tame(check_string)
|
||||
number = payload["pull_request"]["number"].tame(check_int)
|
||||
target_branch = payload["pull_request"]["head_branch"].tame(check_string)
|
||||
base_branch = payload["pull_request"]["base_branch"].tame(check_string)
|
||||
target_branch = None
|
||||
base_branch = None
|
||||
if action != "edited":
|
||||
target_branch = payload["pull_request"]["head_branch"].tame(check_string)
|
||||
base_branch = payload["pull_request"]["base_branch"].tame(check_string)
|
||||
title = payload["pull_request"]["title"].tame(check_string) if include_title else None
|
||||
|
||||
return get_pull_request_event_message(
|
||||
|
||||
Reference in New Issue
Block a user