Code Monkey home page Code Monkey logo

template-triage-bot's Introduction

Triage Bot and Channel Stats w/ Bolt for JS & Shortcuts ⚡️

Overview

This repository implements a 'triage bot' that can help you analyze messages in a public channel to make sure requests are being looked at and resolved. Learn more about what a triage channel is from Slack's help center here.

This application has a few entry points and features to help you keep track of requests in public channels:

Name and Description Visual
1. Scheduled Reminders
You can invite the bot to public channels and it will monitor for and remind the channel about messages that fit specific criteria on a scheduled basis.

All messages, except those posted by the app are counted, so this works great with Slack's Workflow Builder and any other monitoring integration that you use that uses the emojis you configure.
2. Ad-hoc Reporting
You can use the global shortcut ⚡ to create ad-hoc reports on any public channel. It'll give you top-line message counts by urgency and status and provide a CSV for offline analysis too. 
  1. Trigger the modal with a global shortcut and configure your report in the resulting modal
  2. Triage stats bot will be added to the specified channel and run its analysis
  3. Triage stats will be delivered to you in a DM from the bot
3. View Configuration
The app's Slack App Home offers users a view into the configuration of the application

Steps to get your own app running:

  • Head over to docs/SETUP.md for steps to get your app running on a traditional server or your laptop
  • Check out docs/DEPLOY_Heroku.md for instructions for deploying to Heroku, a platform-as-a-service, so you dont have to run anything locally.

Additional documentation

Additional documentation is available in the docs/ folder of this repository

Credits and acknowledgements

template-triage-bot's People

Contributors

colmdoyle avatar dependabot[bot] avatar filmaj avatar marks avatar seratch avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

template-triage-bot's Issues

[BUG] AuthorizationError

Describe the bug

A clear and concise description of what the bug is.

The bot doesn't respond

2022-05-20T09:58:56.256051+00:00 app[web.1]:     at new AuthorizationError (/app/node_modules/@slack/oauth/dist/errors.js:84:28)
2022-05-20T09:58:56.256051+00:00 app[web.1]:     at InstallProvider.<anonymous> (/app/node_modules/@slack/oauth/dist/index.js:253:31)
2022-05-20T09:58:56.256052+00:00 app[web.1]:     at step (/app/node_modules/@slack/oauth/dist/index.js:54:23)
2022-05-20T09:58:56.256052+00:00 app[web.1]:     at Object.throw (/app/node_modules/@slack/oauth/dist/index.js:35:53)
2022-05-20T09:58:56.256053+00:00 app[web.1]:     at rejected (/app/node_modules/@slack/oauth/dist/index.js:27:65)
2022-05-20T09:58:56.256053+00:00 app[web.1]:     at processTicksAndRejections (internal/process/task_queues.js:97:5) {
2022-05-20T09:58:56.256053+00:00 app[web.1]:   code: 'slack_bolt_authorization_error'
2022-05-20T09:58:56.256054+00:00 app[web.1]: }

Requirements (place an x in each of the [ ])**

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

To Reproduce

Steps to reproduce the behavior:

  1. Deploy via Heroku
  2. Integrate to Company Slack
  3. invite to channel
  4. use the triage command

Expected behavior

A clear and concise description of what you expected to happen.
It should show a triage

Screenshots

If applicable, add screenshots to help explain your problem.
Screenshot 2022-05-20 at 12 00 42

Reproducible in:

package version:
node version:
OS version(s):

Additional context

Add any other context about the problem here.

[FEATURE] Unify/standardize logging

Description

Unify/standardize logging

Consider winston, pino, etc.

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

[FEATURE] Track time to resolution

Description

Slack APIs do not provide a timestamp of when a reaction was placed on a message, so using the Events API to capture reaction_added events will be necessary.

This also means we will need to start tracking message (or at least reaction) state in the database.

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

[FEATURE] Check channel topic for user @mention and @mention them in scheduled reminders

Description

People often put the current on call alias or user in an @mention of the channel topic. This feature request would implement an option to @mention that user during scheduled reminders (probably only if there are requests that meet the criteria, not every time)

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

[FEATURE] Encrypt bot tokens in database

Description

Encrypt bot tokens in database

Will need to rework upserting as Mongo field encryption helpers dont seem to support this method

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

[FEATURE] Enhance App Home functionality 🏠

Description

Some ideas:

  • Allow changing of configurations (TBD: per team or per app server?)
  • List team channels the app is in
  • Allow triggering of the reminder ad-hoc (per channel?)

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

[FEATURE] Add 'freestyle' mode where any emoji is counted and reported

Description

In freestyle mode, I can get a CSV report for a channel that might have..

  • A row for each message in the past N hours/days with:
    • the timestamp for when the data was collected (we may want to append the data at a certain interval so we can see the trend of reactions/threaded replies)
    • basic metadata about the message such as channel, timestamp, author, message content (text, blocks, attachments)
    • The total number of reactions
    • An object with all reactions and their counts
    • The total number of threaded replies
    • An object with all threaded replies

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

[DOCS] Improve heroku docs to describe how to make and deploy code/config changes

Describe the bug

Add information to Heroku deploy docs on how to modify config.js.

Basically, you'll need to follow https://help.heroku.com/XOBUHLKQ/why-do-i-see-a-message-you-appear-to-have-cloned-an-empty-repository-when-using-heroku-git-clone. Or more specifically:

heroku git:clone -a YOUR_HEROKU_APP_NAME
cd YOUR_HEROKU_APP_NAME
git remote add origin https://github.com/slackapi/template-triage-bot
git pull origin main
# make changes to config.js
git add . && git commit -m "a useful commit message"
git push

Requirements (place an x in each of the [ ])**

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

[BUG] Bot Token Expires and Doesn't Reset on Re-Auth

Describe the bug

Hello, I've been chasing this one down for a bit, and think I found out what's going on.

When the underlying bot token for the triage bot expires (for whatever reason, it's still not entirely clear to me why Slack bot tokens go to account_inactive despite nobody doing anything or being deactivated), the solution is to re-auth. However, it looks like the new token doesn't save in MongoDB, and we still persist the other one.

Requirements (place an x in each of the [ ])**

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

To Reproduce

Steps to reproduce the behavior:

  1. Install the triage bot, persisting token xoxb-{...}
  2. Have the token go to account_inactive – presumably you can deactivate the first user that installed the bot, or in my case it was just a time-based thing I believe
  3. Re-install the bot
  4. See how the old token is still stored in the database, resulting in a persistent broken integration

Expected behavior

The new token should replace the old one in the database

Screenshots

After re-auth:

ERROR processing {redacted}...
Error: An API error occurred: account_inactive

Reproducible in:

package version: 1.0.1
node version: v20.10.0
OS version(s): Mac OS, Heroku

Additional context

N/A

[FEATURE] Single workspace mode

Description

If the app is only ever going to be based in a single workspace, we can probably branch the code such that we don't need a DB, instead storing the values in an environment variable.

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

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.