Skip to content

Slack

sfdx-hardis-slack-logo

Slack Integration

You can receive notifications on slack channels when sfdx-hardis events are happening:

  • Deployment from a major branch to a major Salesforce org (ex: integration git branch to Integration Org)
  • Salesforce Org Monitoring
    • Latest updates
    • Failing apex tests
    • Monitoring checks notifications

slack-notifs

Configure Slack Application

All the following steps are summarized in this video tutorial

Create slack app

Process only if a sfdx-hardis bot has not yet been configured on your slack. Otherwise, just request the slack token value to your slack administrator

Create a slack app here -> https://api.slack.com/apps

  • Name it sfdx-hardis bot or any nickname you like, like your guinea pig name !
  • Go to permissions and add the following scopes
    • chat-write
    • chat-write.customize
    • chat-write.public
  • Create auth token and copy its values

Configure sfdx-hardis for slack

  • Create a secret value named SLACK_TOKEN with auth token value in your Git provider configuration
  • Create a slack channel that will receive all notifications (ex: #notifs-sfdx-hardis)
  • Open the channel info, copy its ID and create a secret value named SLACK_CHANNEL_ID in your git provider configuration
  • Invite the sfdx-hardis bot user to the channel (ex: /invite @sfdx-hardis-bot)
  • Additionally, you can create branch-scoped channels by creating new channels and create appropriate variables
    • Example: Channel #notifs-sfdx-hardis-integration and variable SLACK_CHANNEL_ID_INTEGRATION
  • You can also define an additional channel to receive only warning, error and critical notifications in another channel
    • Example: Channel #notifs-monitor-hot and variable SLACK_CHANNEL_ID_ERRORS_WARNINGS
  • Make sure all those variables are visible to your CI/CD pipelines

That's all, you're all set !