-
Notifications
You must be signed in to change notification settings - Fork 8
Setup CI
🤖 SmartTodo is meant to be run on your CI alongside your tests. However, each time a new CI build is triggered, it will potentially send a Slack message to TODO's assignees in case their TODO is expired. If you work in a large organisation and trigger thousands of CI builds per day, I let you imagine ...
This is why running the SmartTodo command line without the ENABLE_SMART_TODO
environment variable, won't do anything.
Instead, SmartTodo was meant to be run on your CI on a schedule. Most, if not all CI (Travis, Circle CI, Buildkite ...) have the ability to trigger builds on a schedule.
When configuring your schedule, you should have a way to export environment variables only for scheduled builds, not regular ones.
This is where you should export the ENABLE_SMART_TODO
environment variable.
Refer to your CI provider documentation to know how to setup a schedule.
SmartTodo also needs a Slack token in order to send message to TODO assignees. Refer to the Slack Token page to know how to get a Slack token with the needed scopes.
You have two ways to provide the SmartTodo CLI the token.
- Pass it to the command line options:
smart_todo --slack_token <your_token> --fallback_channel '#general'
- Export the
SMART_TODO_SLACK_TOKEN
env variable:SMART_TODO_SLACK_TOKEN=1 smart_todo --fallback_channel '#general'
Depending on your CI, one or the other can be more convenient.