Slack integration for Ambition
This project is hosted on Heroku and provides various integrations for Ambition's Slack service.
-
Add a
SlackUser
for the account; use the slack username for theusername
field. -
Specify the timezone
-
Set the
expects_morning_digest
field toTrue
if the user should receive a morning digest -
Create a
GithubUser
record with the github username and point it to toward to the newSlackUser
record -
Create a "Personal API Token" in Github and add it to the new
GithubUser
record
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!
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.
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.
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.