Skip to content

Commit

Permalink
validate callback
Browse files Browse the repository at this point in the history
  • Loading branch information
kszucs committed Mar 10, 2020
1 parent e791c62 commit 035024f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions dev/archery/archery/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ class CommentBot:

def __init__(self, name, handler, token=None):
# TODO(kszucs): validate
assert isinstance(name, str)
assert callable(self.handler)
self.name = name
self.handler = handler
self.github = github.Github(token)
Expand Down
2 changes: 1 addition & 1 deletion dev/archery/archery/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ def integration(with_all=False, random_seed=12345, **args):
def trigger_bot(event_name, event_payload, arrow_token, crossbow_token):
event_payload = json.loads(event_payload.read())

bot = CommentBot(name='ursabot', handler='ursabot', token=arrow_token)
bot = CommentBot(name='ursabot', handler=ursabot, token=arrow_token)
bot.handle(event_name, event_payload)


Expand Down

0 comments on commit 035024f

Please sign in to comment.