Skip to content

ambitioninc/ambition-slack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ambition-slack

Slack integration for Ambition

This project is hosted on Heroku and provides various integrations for Ambition's Slack service.

Adding a User

  1. Add a SlackUser for the account; use the slack username for the username field.

  2. Specify the timezone

  3. Set the expects_morning_digest field to True if the user should receive a morning digest

  4. Create a GithubUser record with the github username and point it to toward to the new SlackUser record

  5. Create a "Personal API Token" in Github and add it to the new GithubUser record

Getting Started in Development

Setup a Heroku account.

Have Wes add you as a collaborator on the project.

Install the Heroku Toolbelt

Fork and clone the repo github.com/ambitioninc/ambition-slack

Add heroku as a remote:

git remote add heroku https://git.heroku.com/ambition-slack.git

You're ready to go!

Slack

Add a SlackUser for every account in Ambition. The information for the account consists of the Slack username, the email, the full name of the person and their timezone. The timezone defaults to US/Eastern. The SlackUser model also has a boolean field, expects_morning_digest. This specifies if the user receives a morning digest.

Github

A Github hook is provided in the Github app and exists at the url http://ambition-slack.herokuapp.com/github/. This hook should be added as a webhook to every repo, and it should be sent every event from the repo. The hook searches for messages about pull requests and about comments on pull requests. If a user is tagged, they are notifed by their slack bot with the proper pull request URL.

To configure the Github integration, make a GithubUser model and point it to the proper SlackUser model. The GithubUser model must contain the appropriate username on Github.

In order to appropriately generate a morning digest, the GithubUser model also needs a user specific api token. Simply go to github, click the user icon in the top right, click 'settings', 'Personal access tokens', 'Generate new token' and select the 'repo' scope. Add the resultant token to the appropriate GithubUser model.

Digest

Every weekday morning, the digest app constructs a Morning Digest and sends it to all users at 10:00 AM in the users timezone. The digest includes a list of all assigned and @mentioned pull requests. Doing this requires pinging the github API and asking for current open issues for all users.

The morning digest is generated by the generate_morning_digests management command, which runs every hour as a Heroku scheduled job. Click here to view the scheduled job.

About

Slack integration for Ambition

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages