Git Product home page Git Product logo

pm-timeline-generator's Introduction

Post-mortem Timeline Generator

Mark messages in a public slack channel with a reaction emoji such as :small_blue_diamond: and export them to a file sent via DM.

Trigger with: /timeline :small_blue_diamond:

Here's what it looks like when used:

ux

and here's the backend:

architecture

To deploy:

Set up pre-requisites

  • Python3
  • pip install --user awscli aws-sam-cli pipenv
  • Valid AWS credentials
  • Slack permission to create a Slack application.

Create a Slack App

  • Start here: https://api.slack.com/apps and create an App.

  • add a Bot user, and hit Install App. Customise the name and preference :)

  • Note down the App and Bot OAuth tokens, and the Signing Secret to set as variables later.

  • In OAuth and Permissions, add these:

    • channels:history (to parse the channel’s messages for reactions)
    • chat:write:bot (to message the user as the bot)
    • chat:write:user (to write ephemeral user-only messages to the user)
    • im:read (to handle the slash command and fail gracefully in dm’s)
    • files:write:user (to send the file)
    • users:read (to read the user directory and work out username to user id to make the output legible).
  • You'll need your API Gateway URL to enable the slash command: we'll come back to this.

Set AWS parameters

Create S3 bucket if required:

aws s3 mb s3://deploy-timeline-<uniquename>

Set:

BUCKET='deploy-timeline' # Bucket to hold .yml in AWS for SAM
STACK_NAME='timeline-tool' # CF stack name
BOT_TOKEN=<slack bot token> # From slack app
SLACK_TOKEN=<slack app token> # From slack app
SIGNING_SECRET=<slack signing secret> # From slack app
LOGGING_DESTINATION=<arn of logging resource>
LOGGING_FORMAT=<desired logging format>

Deploy

From this repo's directory, deploy deploy.yml using SAM CLI (a Cloudformation transform) to create the AWS resources required. The below will upload requirements to S3, create a new .yml, push to AWS then clean up after itself.

Run:

./package.sh
sam package --template-file deploy.yml \
 --s3-bucket $BUCKET --output-template-file packaged.yml --region eu-west-1
sam deploy --template-file packaged.yml \
 --stack-name $STACK_NAME --capabilities CAPABILITY_NAMED_IAM \
 --region eu-west-1 --parameter-overrides SigningSecret=$SIGNING_SECRET \
 SlackBotToken=$BOT_TOKEN SlackAppToken=$SLACK_TOKEN \
 LoggingDestinationArn=$LOGGING_DESTINATION LoggingFormat=$LOGGING_FORMAT \
 --confirm-changeset
./package_cleanup.sh

You can now create your Slack App's slash command (I went with /timeline) and add the created API Gateway's URL to it! 🎉

pm-timeline-generator's People

Contributors

connelldave avatar katebee-kaluza avatar takac avatar

Stargazers

Christopher Lai avatar Colin But avatar Vince Fulco--Bighire.tools avatar Andy Hall avatar

Watchers

Pravin Paratey avatar Rosario Grosso avatar James Cloos avatar Ed avatar Ian White avatar  avatar  avatar Andy Hall avatar

pm-timeline-generator's Issues

Daylight savings not accounted for

During BST, the timeline tool continues to output UTC timestamps.
This is problematic especially for long timelines - updating the output for use in the PM is time-consuming to do by hand.
Using automated methods can cause timings quoted by people in Slack to be updated incorrectly.

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.