botkube icon indicating copy to clipboard operation
botkube copied to clipboard

Refactor Bots in `bot` package

Open pkosiec opened this issue 2 years ago • 0 comments

Overview

Currently, Bot package contains merged Bot and Notifier functionality as a part of https://github.com/kubeshop/botkube/issues/596 (specifically #658 - PR: #662). Both notifier and bot code is quite hard to maintain, and contains unnecessary complexity.

Acceptance Criteria

  • For each bot in the bot package:
    • split it to multiple files in a separate package,
    • handle and send methods from discord/slack/mattermostMessage should be defined on Bot level,
    • review all the methods and see if they can be simplified.
    • maybe there also some unnecessary fields? For example, as discovered in #666, there were 4 unused fields. There might be even more
  • Additionally, For MS Teams:
    • see if we cannot set conversation ref without waiting for @BotKube notify start message.
    • see if a public endpoint can be avoided to handle Teams messages.

Reason

The current codebase could be improved to improve maintability - increase pace of shipping new features etc.

pkosiec avatar Jul 28 '22 11:07 pkosiec