SQuaRE Bot#

SQuaRE Bot is the third-generation of SQuaRE’s distributed Slack bot for Rubin Observatory.

SQuaRE Bot receives events (Slack messages, reactions, button actions, and more) from the Slack event and interaction APIs and passes those on as messages in corresponding Kafka topics published within the Roundtable platform. Other microservices in Roundtable can subscribe to those topics and act on on them. Typically those microservices will use Slack’s Web API to post responses. This architecture separates the Slack bot itself from the domain-specific concerns of user-facing SQuaRE Bot features. You can deploy new ChatOps automations without having to update or modify SQuaRE Bot’s codebase.

flowchart LR subgraph Slack message[Slack message] interaction[Slack interaction] end subgraph sqrbot ["Squarebot"] eventapi["/slack/event"] interactionapi["/slack/interaction"] message -->|HTTP POST| eventapi interaction -->|HTTP POST| interactionapi end subgraph kafka ["Kafka Topics"] topicmention["lsst.square-events.squarebot.slack.app.mention"] topicchannel["lsst.square-events.squarebot.slack.message.channel"] topicgroup["lsst.square-events.squarebot.slack.message.group"] topicim["lsst.square-events.squarebot.slack.message.im"] topicmpim["lsst.square-events.squarebot.slack.message.mpim"] topicinteraction["lsst.square-events.squarebot.slack.interaction"] end eventapi --> topicmention eventapi --> topicchannel eventapi --> topicgroup eventapi --> topicim eventapi --> topicmpim interactionapi --> topicinteraction subgraph backends ["Backends"] backend1["Backend 1"] backend2["Backend 2"] end topicchannel --> backend1 topicgroup --> backend1 topicmention --> backend2 topicinteraction --> backend2

Slack sends payloads for message and interaction events to SQuaRE Bot’s REST API. SQuaRE Bot republishes those events into corresponding Kafka topics. Backends subscribe to individual topics to act on relevant events.#