Slack Integration
Get real-time test result notifications in your Slack workspace.
Gaffer's Slack integration sends notifications to your team when test runs complete. Stay informed about test failures without leaving Slack, and quickly navigate to detailed reports when issues arise.
Features
- Real-time notifications - Get notified immediately when test runs finish
- Smart message updates - Multiple test runs for the same commit update a single message instead of spamming your channel
- Branch filtering - Only receive notifications for branches you care about (e.g.,
main,release/*) - Configurable triggers - Choose to be notified on all runs, only failures, or after consecutive failures
- Quick links - Jump directly to the full test report from the notification
Connecting Slack
- Navigate to Settings > Slack in your Gaffer dashboard
- Click "Connect Slack" to start the OAuth flow
- Select the Slack workspace you want to connect
- Authorize Gaffer to post messages
- You'll be redirected back to Gaffer with Slack connected
After connecting, you'll need to configure which channels receive notifications and customize your notification preferences.
Configuration Options
Channels
Select one or more channels where Gaffer should post notifications. The Gaffer bot must be a member of any private channels you want to use.
Tip: Consider creating a dedicated #test-results channel to keep notifications organized without cluttering general channels.
Branch Filters
By default, Gaffer sends notifications for all branches. You can restrict notifications to specific branches using patterns:
main- Exact match for the main branchrelease/*- All release branches (e.g.,release/v1.0,release/2024-01)feature/*- All feature branches
Leave the branch filters empty to receive notifications for all branches.
Notification Triggers
Control when notifications are sent:
- All test runs - Notify on every completed test run (good for high-visibility branches like
main) - Failures only - Only notify when tests fail (reduces noise while keeping you informed of problems)
- Consecutive failures - Only notify after multiple consecutive failures (useful for catching real issues vs. one-off flakes)
For the consecutive failures option, you can set the threshold (e.g., notify after 3 consecutive failures).
Notification Format
Slack notifications include:
- Project name and branch
- Test summary (passed, failed, skipped counts)
- Commit SHA (when available)
- List of failed test names (up to 5, with "and X more" if there are additional failures)
- Direct link to the full report in Gaffer
When multiple test runs complete for the same commit (e.g., Vitest unit tests and Playwright E2E tests), Gaffer updates the existing message instead of posting a new one. This keeps your channel tidy and gives you a consolidated view of all test results for that commit.
Disconnecting Slack
To disconnect Slack:
- Go to Settings > Slack
- Click "Disconnect"
- Confirm the disconnection
This removes the Slack integration and deletes all notification history. You can reconnect at any time by going through the OAuth flow again.
Troubleshooting
Not receiving notifications?
- Check channel membership - For private channels, ensure the Gaffer bot has been added to the channel
- Verify branch filters - If you have branch filters configured, make sure your branch matches one of the patterns
- Check notification trigger - If set to "failures only", you won't receive notifications for passing test runs
- Confirm notifications are enabled - The toggle in Settings > Slack must be enabled
Token expired or revoked?
If your Slack token is revoked (e.g., if someone removes the Gaffer app from your workspace), notifications will stop. You'll need to reconnect Slack by going through the OAuth flow again.
Security
Gaffer requests minimal Slack permissions:
chat:write- Post messages to channelschannels:read- List public channels for selectiongroups:read- List private channels for selection
OAuth tokens are encrypted at rest using AES-256-GCM. Gaffer uses Slack's token rotation feature, automatically refreshing tokens before they expire.