mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 14:35:27 +00:00
Use "synchronized" (past tense) in github webhook.
Normally github gives us a past tense version of the action, but not for "synchronize," so we fix up the tense. This also adds zerver.GithubHookTests.test_pull_request_synchronize (imported from commit ef69467ed4a02dbfa94c8215fb9043b668d1dec9)
This commit is contained in:
@@ -5303,6 +5303,11 @@ class GithubHookTests(AuthedTestCase):
|
||||
"zulip-test: pull request 7: Counting is hard.",
|
||||
"zbenjamin closed [pull request 7](https://github.com/zbenjamin/zulip-test/pull/7)")
|
||||
|
||||
def test_pull_request_synchronize(self):
|
||||
self.basic_test('pull_request_synchronize', 'commits',
|
||||
"zulip-test: pull request 13: Even more cowbell.",
|
||||
"zbenjamin synchronized [pull request 13](https://github.com/zbenjamin/zulip-test/pull/13)")
|
||||
|
||||
def test_pull_request_comment(self):
|
||||
self.basic_test('pull_request_comment', 'commits',
|
||||
"zulip-test: pull request 9: Less cowbell.",
|
||||
|
||||
@@ -25,10 +25,14 @@ def github_generic_subject(noun, topic_focus, blob):
|
||||
return "%s: %s %d: %s" % (topic_focus, noun, blob['number'], blob['title'])
|
||||
|
||||
def github_generic_content(noun, payload, blob):
|
||||
action = payload['action']
|
||||
if action == 'synchronize':
|
||||
action = 'synchronized'
|
||||
|
||||
# issue and pull_request objects have the same fields we're interested in
|
||||
content = ("%s %s [%s %s](%s)"
|
||||
% (payload['sender']['login'],
|
||||
payload['action'],
|
||||
action,
|
||||
noun,
|
||||
blob['number'],
|
||||
blob['html_url']))
|
||||
|
||||
Reference in New Issue
Block a user