Skip to content

Commit

Permalink
merging PR Chaosthebot#389: Mission - find bugs
Browse files Browse the repository at this point in the history
Chaosthebot#389: Mission - find bugs

Description:
We are on a journey of finding out why the issue command system isn't working. Join me on this journey!

:ok_woman: PR passed with a vote of 13 for and 0 against, a weighted total of 13.0 and a threshold of 6.5, and a current meritocracy review.

Vote record:
@DaveFerBear: 1
@Leigende: 1
@SylvainThrd: 1
@andrewda: 1
@anythingbot: 1
@cthulhuely: 1
@davidak: 1
@eukaryote31: 1
@hongaar: 1
@phil-r: 1
@rhengles: 1
@rudehn: 1
@viktorsec: 1
  • Loading branch information
rudehn authored and chaosbot committed May 30, 2017
1 parent 51e16a8 commit 4b65bd1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cron/poll_read_issue_comments.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,11 @@ def handle_comment(api, issue_comment):

comment_text = re.sub('\s+', ' ', comment_text)
parsed_comment = list(map(lambda x: x.lower(), comment_text.split(' ')))

orig_parsed = parsed_comment[:]
command = parsed_comment.pop(0)
if command in COMMAND_LIST:
__log.debug("Got command: {command}, parsed: {parsed}".format(command=comment_text,
parsed=orig_parsed))
votes = get_command_votes(api, settings.URN, global_comment_id)
set_time_remaining(api, global_comment_id, comment_text)
can_run = can_run_vote_command(api, votes, global_comment_id)
Expand All @@ -224,12 +226,16 @@ def handle_comment(api, issue_comment):
command = db_fields["command"]
body = "> {command}\n\nVote failed".format(command=command)
gh.comments.edit_comment(api, settings.URN, resp_id, body)
else:
__log.debug("comment: {comment} is not a command, " +
"parsed: {parsed}".format(comment=comment_text, parsed=orig_parsed))


def poll_read_issue_comments(api):
__log.info("looking for issue comments")

issue_comments = gh.comments.get_all_issue_comments(api, settings.URN)
__log.info("found {count} issue comments".format(count=len(issue_comments)))

for issue_comment in issue_comments:
handle_comment(api, issue_comment)
Expand Down

0 comments on commit 4b65bd1

Please sign in to comment.