mirror of
https://github.com/zulip/zulip.git
synced 2026-07-12 21:04:41 +08:00
bitbucket: Allow the stream to be specified
(imported from commit eea7392551b568502c01e59c89056b4369fe53e0)
This commit is contained in:
parent
8879b84293
commit
707898b236
@ -83,9 +83,14 @@
|
||||
Choose the <code>POST</code> hook from the list presented and click "Add hook." Make sure to replace the <code>@</code> in the bot's email address with <code>%40</code>,
|
||||
as Bitbucket will not execute the hook if the username contains a <code>@</code>.</p>
|
||||
|
||||
<p>In the URL field, enter <code>https://bot_email:bot_api_key@api.zulip.com/v1/external/bitbucket</code>:</p>
|
||||
<p>In the URL field, enter <code>https://bot_email:bot_api_key@api.zulip.com/v1/external/bitbucket</code>:</p>
|
||||
<img class="screenshot" src="/static/images/integrations/bitbucket/001.png">
|
||||
|
||||
<p>By default, notifications are sent to
|
||||
the <code>commits</code> stream. To send notifications to a
|
||||
different stream, append <code style="white-space: nowrap;">?stream=stream_name</code> to
|
||||
the URL. The stream must already exist.</p>
|
||||
|
||||
<p><b>Congratulations! You're done!</b><br /> Whenever you push code to your repository,
|
||||
you'll get an automated notification that looks like this:</p>
|
||||
<img class="screenshot" src="/static/images/integrations/bitbucket/002.png">
|
||||
|
||||
@ -2088,7 +2088,8 @@ def get_status_list(requesting_user_profile):
|
||||
|
||||
@authenticated_rest_api_view
|
||||
@has_request_variables
|
||||
def api_bitbucket_webhook(request, user_profile, payload=REQ(converter=json_to_dict)):
|
||||
def api_bitbucket_webhook(request, user_profile, payload=REQ(converter=json_to_dict),
|
||||
stream=REQ(default='commits')):
|
||||
repository = payload['repository']
|
||||
commits = [{'id': commit['raw_node'], 'message': commit['message'],
|
||||
'url': '%s%scommits/%s' % (payload['canon_url'],
|
||||
@ -2108,7 +2109,7 @@ def api_bitbucket_webhook(request, user_profile, payload=REQ(converter=json_to_d
|
||||
None, payload['user'])
|
||||
|
||||
subject = elide_subject(subject)
|
||||
check_send_message(user_profile, get_client("API"), "stream", ["commits"], subject, content)
|
||||
check_send_message(user_profile, get_client("API"), "stream", [stream], subject, content)
|
||||
return json_success()
|
||||
|
||||
@authenticated_json_post_view
|
||||
|
||||
Loading…
Reference in New Issue
Block a user