Annotate bots/zulip_git_config.py.

This commit is contained in:
Tim Abbott 2016-09-10 11:48:10 -07:00
parent 534774bd7e
commit 33733e67ba

View file

@ -4,6 +4,8 @@
# Leaving all the instructions out of this file to avoid having to # Leaving all the instructions out of this file to avoid having to
# sync them as we update the comments. # sync them as we update the comments.
if False: from typing import Dict, Optional, Text
ZULIP_USER = "commit-bot@zulip.com" ZULIP_USER = "commit-bot@zulip.com"
ZULIP_API_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ZULIP_API_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
@ -23,6 +25,7 @@ ZULIP_API_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# * topic "master" # * topic "master"
# And similarly for branch "test-post-receive" (for use when testing). # And similarly for branch "test-post-receive" (for use when testing).
def commit_notice_destination(repo, branch, commit): def commit_notice_destination(repo, branch, commit):
# type: (Text, Text, Text) -> Optional[Dict[str, Text]]
if branch in ["master", "prod", "test-post-receive"]: if branch in ["master", "prod", "test-post-receive"]:
return dict(stream = 'test' if 'test-' in branch else 'commits', return dict(stream = 'test' if 'test-' in branch else 'commits',
subject = u"%s" % (branch,)) subject = u"%s" % (branch,))
@ -36,6 +39,7 @@ def commit_notice_destination(repo, branch, commit):
# #
# return '!avatar(%s) [%s](https://example.com/commits/%s)\n' % (author, subject, commit_id) # return '!avatar(%s) [%s](https://example.com/commits/%s)\n' % (author, subject, commit_id)
def format_commit_message(author, subject, commit_id): def format_commit_message(author, subject, commit_id):
# type: (str, str, str) -> str
return '!avatar(%s) [%s](https://git.zulip.net/eng/zulip/commit/%s)\n' % (author, subject, commit_id) return '!avatar(%s) [%s](https://git.zulip.net/eng/zulip/commit/%s)\n' % (author, subject, commit_id)
ZULIP_API_PATH = "/home/zulip/zulip/api" ZULIP_API_PATH = "/home/zulip/zulip/api"