mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 08:26:11 +00:00
github webhooks: Fix message for unsupported team payloads.
The main thing fixed here is that we weren't turning on our keys into a list. And then I refined the message a bit more, including sorting the keys. I also avoid the unnecessary "else".
This commit is contained in:
@@ -452,4 +452,8 @@ A temporary team so that I can get some webhook fixtures!
|
|||||||
stack_info = m.call_args[1]["stack_info"]
|
stack_info = m.call_args[1]["stack_info"]
|
||||||
|
|
||||||
self.assertIn("content_type: application/json", msg)
|
self.assertIn("content_type: application/json", msg)
|
||||||
|
self.assertIn(
|
||||||
|
"summary: The 'team/edited (changes: bogus_key1/bogus_key2)' event isn't currently supported by the GitHub webhook",
|
||||||
|
msg,
|
||||||
|
)
|
||||||
self.assertTrue(stack_info)
|
self.assertTrue(stack_info)
|
||||||
|
|||||||
@@ -280,8 +280,9 @@ def get_team_body(helper: Helper) -> str:
|
|||||||
if "privacy" in changes:
|
if "privacy" in changes:
|
||||||
new_visibility = payload["team"]["privacy"]
|
new_visibility = payload["team"]["privacy"]
|
||||||
return f"Team visibility changed to `{new_visibility}`"
|
return f"Team visibility changed to `{new_visibility}`"
|
||||||
else:
|
|
||||||
raise UnexpectedWebhookEventType("GitHub", f"Team Edited: {changes.keys()}")
|
missing_keys = "/".join(sorted(list(changes.keys())))
|
||||||
|
raise UnexpectedWebhookEventType("GitHub", f"team/edited (changes: {missing_keys})")
|
||||||
|
|
||||||
def get_release_body(helper: Helper) -> str:
|
def get_release_body(helper: Helper) -> str:
|
||||||
payload = helper.payload
|
payload = helper.payload
|
||||||
|
|||||||
Reference in New Issue
Block a user