Skip to content

Latest commit

 

History

History
143 lines (103 loc) · 5.32 KB

README.md

File metadata and controls

143 lines (103 loc) · 5.32 KB

Harvest Notifier

Build Status Maintained - Yes MIT

Deploy

The Harvest Notifier app is an integration between Harvest and Slack which automatically reminds users who forget to mark their working hours in Harvest.

Information

  • This is a Ruby 3.3.5 application.
  • Meant for installation on Heroku triggered by Daily Heroku Scheduler.
  • Notification is determined by time data from the Harvest V2 API.

Features

There are two types of reports: Daily and Weekly.

  • The Daily Report is generated on all weekdays (except Monday) and shows those users who did not fill in their time for that day.
  • The Weekly Report is generated every Monday and shows those users who still need to report the required working hours for previous week.

This app integration allows:

  • Configure a whitelist of Harvest users who don't need to be notified in Slack.
  • Mention users in the Slack channel.
  • Quickly report the working hours from the included link.
  • Refresh report results.
  • Set up a custom report schedule.

Example

Quick Start

Prepare integration access tokens

Deploy to Heroku

The easiest way to deploy this app is to use the Heroku button.

Configure ENV Variables

# heroku config:set [email protected]
# EMAILS_WHITELIST is a list of emails separated by commas, which don't need to be notified in Slack.
heroku config:set HARVEST_ACCOUNT_ID=harvest-account-id
heroku config:set HARVEST_TOKEN=harvest-token
# HARVEST_URL is the link used when clicking on the "Report Time" button in Slack.
heroku config:set HARVEST_URL=https://augustash.harvestapp.com/time
# MISSING_HOURS_THRESHOLD indicates the minimum threshold of hours at which the employee will not be notified in Slack.
heroku config:set MISSING_HOURS_THRESHOLD=4.0
heroku config:set SLACK_CHANNEL=slack-notifications-channel
heroku config:set SLACK_TOKEN=slack-bot-user-oauth-token
heroku config:set [email protected], [email protected], [email protected]
# ROLLBAR_ACCESS_TOKEN is a token for Rollbar error tracking.
# heroku config:set ROLLBAR_ACCESS_TOKEN=rollbar-access-token
# DEADMANSSNITCH_API_KEY is a token for Dead Man Snitch to monitor Heroku Scheduler runs.
# heroku config:set DEADMANSSNITCH_API_KEY=dead-mean-snitch-access-token

Configure Add-ons

heroku addons:create deadmanssnitch:the-lone-snitch -a <app-name>
heroku addons:create rollbar:trial-5k -a <app-name>
heroku addons:create scheduler:standard -a <app-name>

Configure Heroku Scheduler

  • bin/rake reports:daily for daily report
  • bin/rake reports:weekly for weekly report

For more fine-grained control, edit the Clockfile and enable a clock dyno:

heroku ps:scale clock=1 -a <app-name>

Quality tools

  • bin/quality based on RuboCop
  • .rubocop.yml describes active checks

Local Development

Сlone the GitHub Repo

git clone [email protected]:augustash/harvest-notifier.git
cd harvest-notifier

Prepare and Run the Environment

docker build -t heroku-notifier .
docker run -it -v .:/app --rm heroku-notifier /bin/bash

Setup Project

bin/setup

Check Specs and Run Quality Tools

bin/build

Credits

It was written by Flatstack with the help of our contributors.