Automations Cookbook
To more easily start using Sleuth Custom Automations, here are several recipes that you can either try today or if labeled with "(coming soon)", may be available in the future. To vote for these proposed use cases or suggest new ones, please let us know
Deployment promotion
Auto-promote staging deploys to production
When code is deployed to the Staging environment and has been determined to be healthy by Sleuth, auto approve any manual approval steps in the associated build.
Auto-promote quickfix staging deploys to production
When you want your code shipped quickly or know you are shipping something can't break production, add a 'quickfix' label to your pull/merge request and it'll automatically be promoted to production.
Auto-approve a specific job
When you want to auto-approve a specific job in your build, because you have several approvals in your workflow.
Slack approvals-based promotion
Auto-promote after soak time
When code is deployed to staging for at least 4 hours and is still healthy, then promote to production.
Separate approval workflow for third-party PRs (coming soon)
Pull/merge request merges, from non-trusted developers, aren't autopromoted from staging to production, but instead send a Slack message to the #deploy-requests
channel for someone to promote it for them.
Note that the slack message is markdown and created with the Jinja template language.
Deployment notifications
Custom message to author when deploy is unhealthy
When a deployment to production is determined by Sleuth to be unhealthy, notify any author involved in the deployment, usually commit and pull request authors. Send them a personal slack notification with a custom message containing links to key dashboards, logging systems, runbooks, and whatever other resources they need to resolve the incident.
Notify the project lead on certain deploys (coming soon)
Sleuth can tag deploys, either based on file paths matched from the contents of the deploy, or via tags passed explicitly when registering the deploy. In this rule, when production deployment is created and the deploy is tagged with api_change
or database_migration
, notify the team lead with a personal slack message.
Notify key issues on certain deploys (currently for Jira and Linear only)
When a blocker issue is resolved with a deployment to production, add a comment on the issue to notify any watchers of that issue that it has been fixed.
Notify support team on bugs and new features that impact them (coming soon)
When code is deployed to production, find any issues that are either bugs or labeled with support
, and send them to the Slack #support
channel to notify the support team so that they can update the customer.
Notify in Slack when drift is too high
When a deploy hits staging, and staging is more than 10 deploys different than production, send a Slack channel notification to #dev
warning them that they need to promote to production soon.
Notify an internal app when code is deployed
When a deploy hits production, send a webhook to an internal system. See webhook for more information.
Deployment miscellaneous
Transition issues on deploy (currently for Jira and Linear only)
When code is deployed to production, find any referenced issues and transition them into the Deployed
state.
Create revert PR when unhealthy (coming soon)
When a deployment to production is unhealthy, create a pull/merge request that reverts the deployment. Send a personal Slack message to the authors of the deployment with a link to the revert PR so that they can quickly fix the deployment.
Create backport PR on deploy (coming soon)
When a deployment goes to production, create a pull/merge request that backports the changes to staging. Useful if hot fixes were applied directly to the production branch and need to be backported to the staging branch.
Slow rollout of feature flags after delivery (coming soon)
When code is shipped to production, and it comes from a pull/merge request that has the auto-flag-rollout
label, and is healthy, then gradually enable related feature flags over a period of time.
Last updated