Skip to content

Commit

Permalink
Support 2-char Jira project names. Add 'krl_test' debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken Lowe committed May 26, 2020
1 parent ee6deb6 commit ec7bde4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from flask import Flask, request, jsonify, abort
import slack
import os
import re # KRLxxx
import time
import hmac
import hashlib
Expand Down Expand Up @@ -98,6 +99,9 @@ def process_event(event):
if 'thread_ts' in event:
post_args['thread_ts'] = event['thread_ts']

m = re.search(r'krl_test', text) # KRLxxx
if m: # KRLxxx
app.logger.info(f'Processing event: "{event}"') # KRLxxx
app.logger.debug(f'processing message from event: {description}')
for message in links_from_text(text):
SLACK_CLIENT.chat_postMessage(text=message, **post_args)
Expand All @@ -112,6 +116,9 @@ def process_command(command):
app.logger.error(f'tossing supposed command: {command_keys}')
return

m = re.search(r'krl_test', text) # KRLxxx
if m: # KRLxxx
app.logger.info(f'Processing command: "{command}"') # KRLxxx
text = '\n'.join(links_from_text(text))
if text:
data = dict(text=text, response_type='in_channel')
Expand Down
2 changes: 1 addition & 1 deletion linkbot/bots.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class JiraLinkBot(LinkBot):
"""Subclass LinkBot to customize response for JIRA links
"""
default_match = r'[A-Z]{3,}\-[0-9]+'
default_match = r'[A-Z]{2,}\-[0-9]+'

def __init__(self, conf):
if 'LINK' not in conf:
Expand Down

0 comments on commit ec7bde4

Please sign in to comment.