Skip Navigation
Show nav
Heroku Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
  • Documentation
  • Changelog
  • More
    Additional Resources
    • Home
    • Elements
    • Products
    • Pricing
    • Careers
    • Help
    • Status
    • Events
    • Podcasts
    • Compliance Center
    Heroku Blog

    Heroku Blog

    Find out what's new with Heroku on our blog.

    Visit Blog
  • Log inorSign up
View categories

Categories

  • Heroku Architecture
    • Dynos (app containers)
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
  • Command Line
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery
    • Continuous Integration
  • Language Support
    • Node.js
    • Ruby
      • Working with Bundler
      • Rails Support
    • Python
      • Background Jobs in Python
      • Working with Django
    • Java
      • Working with Maven
      • Java Database Operations
      • Working with Spring Boot
      • Java Advanced Topics
    • PHP
    • Go
      • Go Dependency Management
    • Scala
    • Clojure
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
    • Heroku Data For Redis
    • Apache Kafka on Heroku
    • Other Data Stores
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
    • Compliance
  • Heroku Enterprise
    • Private Spaces
      • Infrastructure Networking
    • Enterprise Accounts
    • Enterprise Teams
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
    • Single Sign-on (SSO)
  • Patterns & Best Practices
  • Extending Heroku
    • Platform API
    • App Webhooks
    • Heroku Labs
    • Building Add-ons
      • Add-on Development Tasks
      • Add-on APIs
      • Add-on Guidelines & Requirements
    • Building CLI Plugins
    • Developing Buildpacks
    • Dev Center
  • Accounts & Billing
  • Troubleshooting & Support
  • Integrating with Salesforce
  • Continuous Delivery
  • Heroku ChatOps (Slack Integration)

Heroku ChatOps (Slack Integration)

English — 日本語に切り替える

Last updated December 13, 2022

Table of Contents

  • How it works
  • Getting started
  • Deploying code to an app
  • Deploying
  • Promoting
  • Viewing latest releases
  • Pipeline information
  • Deployable pipelines
  • Connecting CI and other pipeline events to your Slack
  • Uninstalling
  • Known Limitations
  • Frequently Asked Questions

How it works

Heroku ChatOps uses the power of Heroku Pipelines to bring a collaborative deploy workflow to Slack.

Heroku ChatOps also provides some additional features over a traditional Heroku deploy. When you deploy using Heroku ChatOps, we’ll check the commit’s status checks on GitHub to ensure that you’re only deploying code with passing tests. We’ll also notify GitHub that your code has been deployed so that your pull requests will have a record of successful or failed deploys.

Getting started

Prerequisites

Installation and setup of Heroku ChatOps requires Slack permissions to add and approve apps. More information on Slack app management is available here.

Since Heroku ChatOps is built around pipelines, your applications need to be in a pipeline to take advantage of ChatOps features.

Click here to get started:

Add to Slack

Setup your account

/h login

screenshot 2017-05-01 15 48 12

Permissions

To use Heroku ChatOps, you need to sign in to Heroku and GitHub. Any permission you have in ChatOps comes directly from the permissions you have in Heroku and GitHub.

Heroku

If you’re either the owner or a collaborator on an app, you have all the required permissions to use ChatOps on that app.

If you’re member of a Heroku Enterprise Team, you need to have the deploy permission to use ChatOps on an app.

GitHub

Ensure the GitHub repository is connected to your pipeline via the pipeline’s Settings tab.

If you’re either the owner or a collaborator on the GitHub repository that is linked to your pipeline, you have all the required permissions to use ChatOps on that pipeline.

If you’re member of a GitHub Organization, you need to have the write permission to use ChatOps on that pipeline.

Deploying code to an app

There are two ways to deploy your code to an app using Heroku ChatOps, the deployment flow or Pipeline promotions. With both deploys and promotions, we’ll use Slack threads to provide updates along the way, from when the deployment or promotion starts, to when your last dyno has finished restarting.

screenshot 2017-05-01 16 08 29

Each step is saved in a thread: screenshot 2017-05-01 16 08 55

Deploying

Basic deployments

/h deploy PIPELINE_NAME to STAGE_NAME

deploying to a stage

Deploying a specific branch

/h deploy PIPELINE_NAME/BRANCH_NAME to STAGE_NAME

deploying a specific branch

Deploying when you have multiple apps in a stage

/h deploy PIPELINE_NAME to STAGE_NAME/APP_NAME

deploying to specific app

Forcing a deployment even if pre-deploy checks are failing

If you try to deploy an app when a status check is failing , it will refuse to deploy. deploying broken ref

You need to force the deployment using deploy!.

/h deploy! PIPELINE_NAME to STAGE_NAME

forcing a deploy

Promoting

Pipeline promotions have a few additional benefits over manual deployment workflows. For example, they ensure that a release to production contains the exact same compiled code as a release to staging, and promotions will also be faster than recompiling the slug.

Basic promotions

By default, it will promote from staging to production.

/h promote PIPELINE_NAME

promoting

You can also specify an upstream stage. It will promote from the specific upstream stage to production.

/h promote PIPELINE_NAME from UPSTREAM_STAGE

promote from a specific upstream

Multiple apps in a stage

If you have multiple apps in your upstream stage, you’ll need to specify a source app to promote from.

/h promote PIPELINE_NAME from UPSTREAM_STAGE/APP_NAME to DOWNSTREAM_STAGE

screenshot 2017-04-11 14 09 47

If you have multiple apps in the downstream stage, you’ll need to specify which downstream app you’d like to promote to.

/h promote PIPELINE_NAME from UPSTREAM_STAGE/APP_NAME to DOWNSTREAM_STAGE/APP_NAME

screenshot 2017-04-11 14 11 21

Or you have multiple apps in the downstream stage, you can also specify a list of target app separated by a comma.

/h promote PIPELINE_NAME from UPSTREAM_STAGE/APP_NAME to DOWNSTREAM_STAGE/APP_NAME,APP_NAME2

promoting to multiple downstreams

Or another way to promote to multiple apps in a downstream stage is by specifying that you’d like to promote to all downstream apps.

/h promote PIPELINE_NAME from UPSTREAM_STAGE/APP_NAME to DOWNSTREAM_STAGE/all

promoting to all

Forcing a promotion even if pre-deploy checks are failing

If you try to promote an app without having successful status checks, it will refuse to promote. You need to force the promotion to bypass the check.

/h promote! PIPELINE_NAME

forcing a promotion

Viewing latest releases

You can view the latest code deploys and configuration changes for the default stage.

Releases for production stage

/h releases PIPELINE_NAME

latest releases in default stage

Releases for a specific stage

You can also specify a stage, like staging or production.

/h releases PIPELINE_NAME in STAGE_NAME

releases only in staging

Pipeline information

/h info PIPELINE_NAME

pipeline info

Deployable pipelines

You can obtain a list of deployable pipelines.

/h pipelines

List of pipelines

Connecting CI and other pipeline events to your Slack

If you’d like to be notified about pipeline events, like a pull request opening, a Heroku dashboard deploy or promotion occuring, or your CI tests passing, you can route notifications to any public Slack channel.

Route pipeline notifications to a channel

/h route PIPELINE_NAME to #CHANNEL_NAME

Route a pipeline

Once you route your pipeline notifications to your channel, you’ll start receiving notifications. Here’s an example of a CI notification:

CI Passing Notification

Pipeline notification routing currently only supports a single Slack channel. Pipeline events initiated from the CLI are not displayed.

Stop routing Pipeline’s notifications to a channel

You can also disable notifications for a pipeline.

/h route:disable PIPELINE_NAME

Disable route

List Pipelines routed to a channel

/h route

Dropdown list of pipelines

Change notification settings of pipelines routed to your channel

Run /h route inside the channel you wish to configure and select the pipeline from the dropdown. You can customize the messages in your channel by toggling ChatOps’ notifications settings

Each pipeline routed to your channel has the following settings: Notification configuration

App deployments

Receive notifications when your pipeline is deployed or promoted from other slack channels. You’ll still receive updates inside the channel where you run the Heroku ChatOps command.

App health

App health threshold alerts allow you to monitor application health by sending a notification if the p95 response time or error rate for your app’s web dynos exceeds your configured threshold setting for a specified period of time. Once you have a pipeline routed, you’ll can receive Threshold Alert notifications for any alerts configured for pipeline apps.

Alert monitors are configurable in Application Metrics. alertconfig

Within Slack you’ll see receive a notification for the alert and when app health returns to an acceptable state. Clicking on the message links will take you to Application Metrics for further investigation or to adjust alert threshold settings.

screen shot 2017-09-29 at 11 44 36 am

Github Activity

Receive notifications about Github events such as pull request changes or commit status updates.

Uninstalling

To remove Heroku ChatOps from a Slack channel, navigate to the app’s settings page in Slack and select Remove App. You can get to the settings page by selecting the Apps header on the sidebar, View Heroku, then selecting Settings. For details, see Slack’s help center article.

Known Limitations

ChatOps does not support routing notifications to private Slack channels or teams using Github Enterprise.

Frequently Asked Questions

What permissions does ChatOps require?

Heroku account permissions: when you /h login to connect your Heroku account to Heroku ChatOps, it asks for the following permissions: Read and write access to all of your account, apps and resources. Those permissions are required to perform operations such as listing your pipelines and deploying or promoting an app.

GitHub account permissions: when you /h login to connect your Heroku account to GitHub, it asks for the following permissions: access to your account, your public and private repositories. Those permissions are required to perform operations such as checking status checks on commit statuses or creating deployments on a Pull Request.

Can I limit the Heroku Apps or GitHub repositories that ChatOps has access to?

Heroku ChatOps allows you to control any Heroku app that you personally have access to but there are no finer grained controls beyond that. It also does not allow other people in your Slack to control those apps unless they also have permission to access the apps.

GitHub Apps allow for finer grained control on repositories, but that has not been integrated into Heroku ChatOps yet. We cannot commit to a timeline but it’s definitely on our radar. Keep an eye on the Heroku Changelog.

Does Slack have access to my GitHub or Heroku account?

No, only Heroku ChatOps has access to your GitHub and Heroku account. Your GitHub access token and your Heroku access token are never shared with Slack.

Why do I get this “Please make sure you have access to this GitHub repository" error?

You are the owner of the GitHub organization or repository and when you try to use ChatOps to deploy, you get the following error:

Unable to access XXX
Please make sure you have access to this GitHub repository.
Read more about permissions and try to sign in to GitHub again.

Normally that error gets triggered when the user’s GitHub token gets a 404 accessing the connected repository. In some cases, tighter restrictions on the GitHub side can make it so a configured pipeline is unable to be accessed by a user in ChatOps. It appears that permissions are likely not correct.

Please follow those 3 steps:

  • in Slack, type /h logout then /h login. Connect your Heroku and GitHub accounts then try again.
  • make sure that the GitHub user has Admin privileges in the GitHub UI > repository_name > Settings > Collaborators & teams for the repository.
  • visit the OAuth Application authorizations in https://github.com/settings/applications > Authorized OAuth Apps > Heroku ChatOps and make sure the appropriate Organizations have a green checkmark.

Keep reading

  • Continuous Delivery

Feedback

Log in to submit feedback.

Review Apps (Old) Maintenance Mode

Information & Support

  • Getting Started
  • Documentation
  • Changelog
  • Compliance Center
  • Training & Education
  • Blog
  • Podcasts
  • Support Channels
  • Status

Language Reference

  • Node.js
  • Ruby
  • Java
  • PHP
  • Python
  • Go
  • Scala
  • Clojure

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing

Subscribe to our monthly newsletter

Your email address:

  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Heroku Podcasts
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Facebook
  • Instagram
  • Github
  • LinkedIn
  • YouTube
Heroku is acompany

 © Salesforce.com

  • heroku.com
  • Terms of Service
  • Privacy
  • Cookies
  • Cookie Preferences