yetibot / yetibot

🤖 Extreme chatops bot for Slack, Discord, Mattermost, IRC 🔧 New contributors welcome 🏗

Home Page:https://yetibot.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Jira Observer Stuck in Infinite Loop

stratog opened this issue · comments

Describe the bug
When you paste a jira id in chat, yetibot will respond with the details of the issue. Yetibot again parses the issue from it's own response and responds again, triggering the loop.

To Reproduce
Steps to reproduce the behavior:

  1. !channel set jira-project MESGPLAT
  2. MESGPLAT-8718

Expected behavior
Yetibot should only respond once and ignore itself

Screenshots
Screen Shot 2022-12-09 at 3 04 35 PM
Additional context
I think slack no longer returns the bot name, which causes the hook to fail filtering:
https://github.com/yetibot/core/blob/master/src/yetibot/core/hooks.clj#L251

Sample log:

22-12-09 22:36:44 yetibot-788955c686-c7s5b INFO [yetibot.core.commands.observe:39] - obs-handler {:body "✓ Set jira-project = MESGPLAT for this channel.", :thread-ts "1670625404.031669", :chat-source {:adapter :slack, :uuid :ebayeng, :room "#", :is-private true}, :settings {"broadcast" "false", "jira-project" "MESGPLAT", "jenkins-default" "", "karma-observers-enabled" "false", "locs" "59101,98103,95125"}, :event-type :message}
22-12-09 22:36:44 yetibot-788955c686-c7s5b INFO [yetibot.core.db.util:154] - db query ["SELECT * FROM yetibot_channel WHERE chat_source_adapter=? AND chat_source_channel=?" ":ebayeng" "#"]
22-12-09 22:36:44 yetibot-788955c686-c7s5b INFO [yetibot.core.db.util:154] - db query ["SELECT * FROM yetibot_channel WHERE chat_source_adapter=? AND chat_source_channel=?" ":ebayeng" "#"]
22-12-09 22:36:44 yetibot-788955c686-c7s5b INFO [yetibot.core.db.util:154] - db query ["SELECT * FROM yetibot_channel WHERE chat_source_adapter=? AND chat_source_channel=?" ":ebayeng" "#"]
22-12-09 22:36:44 yetibot-788955c686-c7s5b INFO [yetibot.core.db.util:154] - db query ["SELECT * FROM yetibot_channel WHERE chat_source_adapter=? AND chat_source_channel=?" ":ebayeng" "#"]
22-12-09 22:36:44 yetibot-788955c686-c7s5b INFO [yetibot.api.jira:100] - channel-projects "MESGPLAT"
22-12-09 22:36:44 yetibot-788955c686-c7s5b INFO [yetibot.observers.jira:33] - found issues #{}
22-12-09 22:36:44 yetibot-788955c686-c7s5b INFO [yetibot.core.db.util:154] - db query ["SELECT * FROM yetibot_channel WHERE chat_source_adapter=? AND chat_source_channel=?" ":ebayeng" "#"]
22-12-09 22:36:54 yetibot-788955c686-c7s5b INFO [yetibot.core.adapters.slack:220] - on-message {:source_team "E3U2DUYG4", :event_ts "1670625413.972719", :channel "C04ESPL7XKK", :type "message", :ts "1670625413.972719", :team "T0M05TDH6", :client_msg_id "00b8aff3-b7bc-4fac-80c8-e71d3d1ee1e3", :blocks [{:type "rich_text", :block_id "QYlJZ", :elements [{:type "rich_text_section", :elements [{:type "text", :text "MESGPLAT-8718"}]}]}], :user_team "E3U2DUYG4", :user "W3YMUF23F", :suppress_notification false, :text "MESGPLAT-8718"}
22-12-09 22:36:54 yetibot-788955c686-c7s5b INFO [yetibot.core.adapters.slack:254] - {:thread-ts nil, :ts "1670625413.972719"}
22-12-09 22:36:54 yetibot-788955c686-c7s5b INFO [yetibot.core.db.util:154] - db query ["SELECT * FROM yetibot_channel WHERE chat_source_adapter=? AND chat_source_channel=?" ":ebayeng" "#"]
22-12-09 22:36:54 yetibot-788955c686-c7s5b INFO [yetibot.core.commands.observe:39] - obs-handler {:body "MESGPLAT-8718", :thread-ts "1670625413.972719", :chat-source {:adapter :slack, :uuid :ebayeng, :room "#", :is-private true}, :settings {"broadcast" "false", "jira-project" "MESGPLAT", "jenkins-default" "", "karma-observers-enabled" "false", "locs" "59101,98103,95125"}, :event-type :message}
22-12-09 22:36:54 yetibot-788955c686-c7s5b INFO [yetibot.core.db.util:154] - db query ["SELECT * FROM yetibot_channel WHERE chat_source_adapter=? AND chat_source_channel=?" ":ebayeng" "#"]
22-12-09 22:36:54 yetibot-788955c686-c7s5b INFO [yetibot.core.db.util:154] - db query ["SELECT * FROM yetibot_channel WHERE chat_source_adapter=? AND chat_source_channel=?" ":ebayeng" "#"]
22-12-09 22:36:54 yetibot-788955c686-c7s5b INFO [yetibot.core.db.util:154] - db query ["SELECT * FROM yetibot_channel WHERE chat_source_adapter=? AND chat_source_channel=?" ":ebayeng" "#"]
22-12-09 22:36:54 yetibot-788955c686-c7s5b INFO [yetibot.core.db.util:154] - db query ["SELECT * FROM yetibot_channel WHERE chat_source_adapter=? AND chat_source_channel=?" ":ebayeng" "#"]
22-12-09 22:36:54 yetibot-788955c686-c7s5b INFO [yetibot.api.jira:100] - channel-projects "MESGPLAT"
22-12-09 22:36:54 yetibot-788955c686-c7s5b INFO [yetibot.observers.jira:33] - found issues #{"MESGPLAT-8718"}
22-12-09 22:36:54 yetibot-788955c686-c7s5b DEBUG [yetibot.core.chat:99] - chat-data-structure 
 "[unassigned] [Closed] [Support Request] [P4] [Template] - Message Studio Onboarding request https://jirap.corp.ebay.com/browse/MESGPLAT-8718" 
 "C04ESPL7XKK"
22-12-09 22:36:54 yetibot-788955c686-c7s5b DEBUG [yetibot.core.chat:107] - formatted: "[unassigned] [Closed] [Support Request] [P4] [Template] - Message Studio Onboarding request https://jirap.corp.ebay.com/browse/MESGPLAT-8718"
22-12-09 22:36:54 yetibot-788955c686-c7s5b DEBUG [yetibot.core.adapters.slack:99] - send-msg {:img? false, :target "C04ESPL7XKK", :thread-ts nil}
22-12-09 22:36:55 yetibot-788955c686-c7s5b DEBUG [yetibot.core.adapters.slack:117] - slack response {:ok true, :channel "C04ESPL7XKK", :ts "1670625415.171869", :message {:bot_id "BEVP6R404", :type "message", :text "[unassigned] [Closed] [Support Request] [P4] [Template] - Message Studio Onboarding request <https://jirap.corp.ebay.com/browse/MESGPLAT-8718>", :user "WEW4M672R", :ts "1670625415.171869", :team "T0M05TDH6", :bot_profile {:id "BEVP6R404", :app_id "A0F7YS25R", :name "bot", :icons {:image_36 "https://a.slack-edge.com/80588/img/services/bots_36.png", :image_48 "https://a.slack-edge.com/80588/img/plugins/bot/service_48.png", :image_72 "https://a.slack-edge.com/80588/img/services/bots_72.png"}, :deleted false, :updated 1595385981, :team_id "T0M05TDH6"}}}
22-12-09 22:36:55 yetibot-788955c686-c7s5b INFO [yetibot.core.db.util:154] - db query ["SELECT * FROM yetibot_channel WHERE chat_source_adapter=? AND chat_source_channel=?" ":ebayeng" "#"]
22-12-09 22:36:55 yetibot-788955c686-c7s5b INFO [yetibot.core.adapters.slack:220] - on-message {:source_team "E3U2DUYG4", :bot_profile {:id "BEVP6R404", :deleted false, :name "bot", :updated 1595385981, :app_id "A0F7YS25R", :icons {:image_36 "https://a.slack-edge.com/80588/img/services/bots_36.png", :image_48 "https://a.slack-edge.com/80588/img/plugins/bot/service_48.png", :image_72 "https://a.slack-edge.com/80588/img/services/bots_72.png"}, :team_id "T0M05TDH6"}, :event_ts "1670625415.171869", :channel "C04ESPL7XKK", :type "message", :ts "1670625415.171869", :team "T0M05TDH6", :user_team "E3U2DUYG4", :user "WEW4M672R", :suppress_notification false, :text "[unassigned] [Closed] [Support Request] [P4] [Template] - Message Studio Onboarding request <https://jirap.corp.ebay.com/browse/MESGPLAT-8718>", :bot_id "BEVP6R404"}
22-12-09 22:36:55 yetibot-788955c686-c7s5b INFO [yetibot.core.adapters.slack:254] - {:thread-ts nil, :ts "1670625415.171869"}
22-12-09 22:36:55 yetibot-788955c686-c7s5b INFO [yetibot.core.db.util:154] - db query ["SELECT * FROM yetibot_channel WHERE chat_source_adapter=? AND chat_source_channel=?" ":ebayeng" "#"]
22-12-09 22:36:55 yetibot-788955c686-c7s5b INFO [yetibot.core.commands.observe:39] - obs-handler {:body "[unassigned] [Closed] [Support Request] [P4] [Template] - Message Studio Onboarding request https://jirap.corp.ebay.com/browse/MESGPLAT-8718", :thread-ts "1670625415.171869", :chat-source {:adapter :slack, :uuid :ebayeng, :room "#", :is-private true}, :settings {"broadcast" "false", "jira-project" "MESGPLAT", "jenkins-default" "", "karma-observers-enabled" "false", "locs" "59101,98103,95125"}, :event-type :message}
22-12-09 22:36:55 yetibot-788955c686-c7s5b INFO [yetibot.core.db.util:154] - db query ["SELECT * FROM yetibot_channel WHERE chat_source_adapter=? AND chat_source_channel=?" ":ebayeng" "#"]
22-12-09 22:36:55 yetibot-788955c686-c7s5b INFO [yetibot.core.db.util:154] - db query ["SELECT * FROM yetibot_channel WHERE chat_source_adapter=? AND chat_source_channel=?" ":ebayeng" "#"]
22-12-09 22:36:55 yetibot-788955c686-c7s5b INFO [yetibot.core.db.util:154] - db query ["SELECT * FROM yetibot_channel WHERE chat_source_adapter=? AND chat_source_channel=?" ":ebayeng" "#"]
22-12-09 22:36:55 yetibot-788955c686-c7s5b INFO [yetibot.core.db.util:154] - db query ["SELECT * FROM yetibot_channel WHERE chat_source_adapter=? AND chat_source_channel=?" ":ebayeng" "#"]
22-12-09 22:36:55 yetibot-788955c686-c7s5b INFO [yetibot.api.jira:100] - channel-projects "MESGPLAT"
22-12-09 22:36:55 yetibot-788955c686-c7s5b INFO [yetibot.observers.jira:33] - found issues #{"MESGPLAT-8718"}
22-12-09 22:36:56 yetibot-788955c686-c7s5b DEBUG [yetibot.core.chat:99] - chat-data-structure 
 "[unassigned] [Closed] [Support Request] [P4] [Template] - Message Studio Onboarding request https://jirap.corp.ebay.com/browse/MESGPLAT-8718" 
 "C04ESPL7XKK"
22-12-09 22:36:56 yetibot-788955c686-c7s5b DEBUG [yetibot.core.chat:107] - formatted: "[unassigned] [Closed] [Support Request] [P4] [Template] - Message Studio Onboarding request https://jirap.corp.ebay.com/browse/MESGPLAT-8718"
22-12-09 22:36:56 yetibot-788955c686-c7s5b DEBUG [yetibot.core.adapters.slack:99] - send-msg {:img? false, :target "C04ESPL7XKK", :thread-ts nil}
22-12-09 22:36:56 yetibot-788955c686-c7s5b DEBUG [yetibot.core.adapters.slack:117] - slack response {:ok true, :channel "C04ESPL7XKK", :ts "1670625416.342019", :message {:bot_id "BEVP6R404", :type "message", :text "[unassigned] [Closed] [Support Request] [P4] [Template] - Message Studio Onboarding request <https://jirap.corp.ebay.com/browse/MESGPLAT-8718>", :user "WEW4M672R", :ts "1670625416.342019", :team "T0M05TDH6", :bot_profile {:id "BEVP6R404", :app_id "A0F7YS25R", :name "bot", :icons {:image_36 "https://a.slack-edge.com/80588/img/services/bots_36.png", :image_48 "https://a.slack-edge.com/80588/img/plugins/bot/service_48.png", :image_72 "https://a.slack-edge.com/80588/img/services/bots_72.png"}, :deleted false, :updated 1595385981, :team_id "T0M05TDH6"}}}
22-12-09 22:36:56 yetibot-788955c686-c7s5b INFO [yetibot.core.db.util:154] - db query ["SELECT * FROM yetibot_channel WHERE chat_source_adapter=? AND chat_source_channel=?" ":ebayeng" "#"]
22-12-09 22:36:56 yetibot-788955c686-c7s5b INFO [yetibot.core.adapters.slack:220] - on-message {:source_team "E3U2DUYG4", :bot_profile {:id "BEVP6R404", :deleted false, :name "bot", :updated 1595385981, :app_id "A0F7YS25R", :icons {:image_36 "https://a.slack-edge.com/80588/img/services/bots_36.png", :image_48 "https://a.slack-edge.com/80588/img/plugins/bot/service_48.png", :image_72 "https://a.slack-edge.com/80588/img/services/bots_72.png"}, :team_id "T0M05TDH6"}, :event_ts "1670625416.342019", :channel "C04ESPL7XKK", :type "message", :ts "1670625416.342019", :team "T0M05TDH6", :user_team "E3U2DUYG4", :user "WEW4M672R", :suppress_notification false, :text "[unassigned] [Closed] [Support Request] [P4] [Template] - Message Studio Onboarding request <https://jirap.corp.ebay.com/browse/MESGPLAT-8718>", :bot_id "BEVP6R404"}
22-12-09 22:36:56 yetibot-788955c686-c7s5b INFO [yetibot.core.adapters.slack:254] - {:thread-ts nil, :ts "1670625416.342019"}
22-12-09 22:36:56 yetibot-788955c686-c7s5b INFO [yetibot.core.db.util:154] - db query ["SELECT * FROM yetibot_channel WHERE chat_source_adapter=? AND chat_source_channel=?" ":ebayeng" "#"]
22-12-09 22:36:56 yetibot-788955c686-c7s5b INFO [yetibot.core.commands.observe:39] - obs-handler {:body "[unassigned] [Closed] [Support Request] [P4] [Template] - Message Studio Onboarding request https://jirap.corp.ebay.com/browse/MESGPLAT-8718", :thread-ts "1670625416.342019", :chat-source {:adapter :slack, :uuid :ebayeng, :room "#", :is-private true}, :settings {"broadcast" "false", "jira-project" "MESGPLAT", "jenkins-default" "", "karma-observers-enabled" "false", "locs" "59101,98103,95125"}, :event-type :message}
22-12-09 22:36:56 yetibot-788955c686-c7s5b INFO [yetibot.core.db.util:154] - db query ["SELECT * FROM yetibot_channel WHERE chat_source_adapter=? AND chat_source_channel=?" ":ebayeng" "#"]
22-12-09 22:36:56 yetibot-788955c686-c7s5b INFO [yetibot.core.db.util:154] - db query ["SELECT * FROM yetibot_channel WHERE chat_source_adapter=? AND chat_source_channel=?" ":ebayeng" "#"]
22-12-09 22:36:56 yetibot-788955c686-c7s5b INFO [yetibot.core.db.util:154] - db query ["SELECT * FROM yetibot_channel WHERE chat_source_adapter=? AND chat_source_channel=?" ":ebayeng" "#"]
22-12-09 22:36:56 yetibot-788955c686-c7s5b INFO [yetibot.core.db.util:154] - db query ["SELECT * FROM yetibot_channel WHERE chat_source_adapter=? AND chat_source_channel=?" ":ebayeng" "#"]
22-12-09 22:36:56 yetibot-788955c686-c7s5b INFO [yetibot.api.jira:100] - channel-projects "MESGPLAT"
22-12-09 22:36:56 yetibot-788955c686-c7s5b INFO [yetibot.observers.jira:33] - found issues #{"MESGPLAT-8718"}
22-12-09 22:36:57 yetibot-788955c686-c7s5b DEBUG [yetibot.core.chat:99] - chat-data-structure 
 "[unassigned] [Closed] [Support Request] [P4] [Template] - Message Studio Onboarding request https://jirap.corp.ebay.com/browse/MESGPLAT-8718" 
 "C04ESPL7XKK"
22-12-09 22:36:57 yetibot-788955c686-c7s5b DEBUG [yetibot.core.chat:107] - formatted: "[unassigned] [Closed] [Support Request] [P4] [Template] - Message Studio Onboarding request https://jirap.corp.ebay.com/browse/MESGPLAT-8718"
22-12-09 22:36:57 yetibot-788955c686-c7s5b DEBUG [yetibot.core.adapters.slack:99] - send-msg {:img? false, :target "C04ESPL7XKK", :thread-ts nil}
22-12-09 22:36:57 yetibot-788955c686-c7s5b DEBUG [yetibot.core.adapters.slack:117] - slack response {:ok true, :channel "C04ESPL7XKK", :ts "1670625417.304599", :message {:bot_id "BEVP6R404", :type "message", :text "[unassigned] [Closed] [Support Request] [P4] [Template] - Message Studio Onboarding request <https://jirap.corp.ebay.com/browse/MESGPLAT-8718>", :user "WEW4M672R", :ts "1670625417.304599", :team "T0M05TDH6", :bot_profile {:id "BEVP6R404", :app_id "A0F7YS25R", :name "bot", :icons {:image_36 "https://a.slack-edge.com/80588/img/services/bots_36.png", :image_48 "https://a.slack-edge.com/80588/img/plugins/bot/service_48.png", :image_72 "https://a.slack-edge.com/80588/img/services/bots_72.png"}, :deleted false, :updated 1595385981, :team_id "T0M05TDH6"}}}
22-12-09 22:36:57 yetibot-788955c686-c7s5b INFO [yetibot.core.db.util:154] - db query ["SELECT * FROM yetibot_channel WHERE chat_source_adapter=? AND chat_source_channel=?" ":ebayeng" "#"]
22-12-09 22:36:57 yetibot-788955c686-c7s5b INFO [yetibot.core.adapters.slack:220] - on-message {:source_team "E3U2DUYG4", :bot_profile {:id "BEVP6R404", :deleted false, :name "bot", :updated 1595385981, :app_id "A0F7YS25R", :icons {:image_36 "https://a.slack-edge.com/80588/img/services/bots_36.png", :image_48 "https://a.slack-edge.com/80588/img/plugins/bot/service_48.png", :image_72 "https://a.slack-edge.com/80588/img/services/bots_72.png"}, :team_id "T0M05TDH6"}, :event_ts "1670625417.304599", :channel "C04ESPL7XKK", :type "message", :ts "1670625417.304599", :team "T0M05TDH6", :user_team "E3U2DUYG4", :user "WEW4M672R", :suppress_notification false, :text "[unassigned] [Closed] [Support Request] [P4] [Template] - Message Studio Onboarding request <https://jirap.corp.ebay.com/browse/MESGPLAT-8718>", :bot_id "BEVP6R404"}