Code Monkey home page Code Monkey logo

slack-incident-bot's Introduction

DfE Incident Bot ๐Ÿค–

Incident management.. all within Slack โ€“ /incident

Local Setup

  1. Request an invite to the Slack Bot Testing Grounds workspace & a copy of the secrets for your .env file
  2. Visit https://api.slack.com/apps and select DfE incident bot (test)
  3. Spin up a ngrok tunnel with ngrok http 3000 and take a copy of the forwarding URL
  4. Navigate to Interactivity & Shortcuts and add the following URL to Request URL:
  1. Navigate to Slash Commands and add the following URL to the four slash commands:
  1. Navigate to OAuth & Permissions and add the following URL to Redirect URLS:
  1. Update your .env file with the following URLs:
  • BASE_URL=https://example.ngrok.io
  • ENV_URL=example.ngrok.io
  1. Launch your rails server and test the connection in Slack with /ping

New App Setup

BASE_URL stands for https://your-slackbot-hosted-domain.com hereafter

  1. Create a new app here
  2. Navigate to the OAuth & Permissions page and add the following Bot Token Scopes:
  • channels:manage
  • channels:read
  • chat:write
  • commands
  • group:read
  • incoming-webhook
  • pins:write
  • team:read
  • users:read
  1. Activate Interactivity & Shortcuts and add this url: BASE_URL/api/slack/action
  2. Activate OAuth & Permissions and add BASE_URL to the Redirect URLs
  3. Activate Slash Commands add two slash commands, using BASE_URL/api/slack/command as the Request URL:
  • /ping
  • /incident - add: [ open | update | close | help ] to the usage hint field
  1. Grab the information needed for .env file from Basic Information section
  2. Navigate to the App Home page and toggle Always Show My Bot as Online (according to your reference)

slack-incident-bot's People

Contributors

benilovj avatar dankmitchell avatar dependabot[bot] avatar duncanjbrown avatar gpeng avatar jr-g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

benilovj ha36d

slack-incident-bot's Issues

Create incident Google doc

Upon declaring a new incident create a new incident doc from the template.
Upon closing an incident extract the incident channel messages (and timestamps) into the doc

Add a character limit for the incident description input

An incident was opened recently with a topic that exceed the 250 character limit. Fortunately everything else in the process still performed but it did result in the following error:

0.17.0/lib/slack/web/api/endpoints/conversations.rb:313:in `conversations_setTopic'
2021-10-26T13:35:07.395045+00:00 app[web.1]: 	from /app/bot/actions/slack_incident_actions.rb:26:in `block in open_incident'
2021-10-26T13:35:07.502640+00:00 app[web.1]: E, [2021-10-26T13:35:07.502564 #4] ERROR -- : Slack::Web::Api::Errors::TooLong: too_long

Changing the incident priority in the incident channel doesn't post any updates in the channel that the incident was raised

How to reproduce

  1. There is an existing incident that's at P2, say, that's been raised in an existing channel.
  2. I use the /incident update command in the incident channel (incident_...) to change its priority to P1. The bot correctly posts an update in the incident channel.

Expected: The bot posts an update of the incident priority in the existing channel.
Actual: no update is posted.

Create an info/help command

Sometimes people wonder how to use the bot. Perhaps it's worth having a /incident help command that messages the user with instructions on what to do

Improve the tests

Tests are currently quite basic and definitely don't cover the full functionality. They need some love.

Accept generic modals

Currently the bot will only work with a specific modal. In order to make in more generic we need to build functionality so it can accept a modal with n number of fields and handle different data types for each i.e. integer, string or even a slack handle.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.