-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Overview
Add Slack integration to the bump CLI tool to send notifications about version bumps, releases, and changelog updates. The integration should use Slack webhooks for simplicity, avoiding the complexity of managing Slack API tokens and OAuth flows.
Core Requirements
Slack Webhook Integration
- Webhook-based approach: Use Slack Incoming Webhooks instead of Slack API
- Simpler setup: only requires a webhook URL
- No token management or OAuth complexity
- Easy to configure via environment variable or CLI flag
- Webhook URL Configuration:
- Support via environment variable:
SLACK_WEBHOOK_URL - Support via CLI flag:
--slack-webhook <url> - Support via config file (optional):
.bump/config.tomlor similar
- Support via environment variable:
Notification Types
The CLI should send Slack notifications for:
-
Version Bump Notifications:
- When a new version is detected or created
- Include: old version → new version
- Package name
- Registry source (public/private)
-
Git Tag Creation:
- When a new version tag is created
- Include: tag name, commit hash, author
-
Changelog Generation:
- When changelog is generated
- Include: summary of changes (number of commits, files changed)
- Link to changelog file location (if applicable)
-
Full Release Workflow:
- Combined notification for complete release process
- Include: version, tag, changelog summary, and any relevant links
Message Format
- Rich formatting: Use Slack's Block Kit or markdown formatting
- Structured messages: Include:
- Title/header with emoji indicators
- Key information in structured sections
- Links to relevant resources (GitHub, changelog, etc.)
- Color coding (success = green, info = blue, warning = yellow)
- Optional attachments: Include changelog preview or summary
Command Integration
Add Slack notification support to existing commands:
# Version command with Slack notification
bump version --slack-webhook <url>
# or use environment variable
SLACK_WEBHOOK_URL=<url> bump version
# Tag command with Slack notification
bump tag --version 1.2.3 --slack-webhook <url>
# Changelog with Slack notification
bump changelog --slack-webhook <url> --output ./CHANGELOG.md
# Full workflow with Slack notification
bump full --slack-webhook <url> --output ./changelog.mdConfiguration Options
- Enable/disable notifications:
--slackflag to enable, or auto-detect from webhook URL presence - Customize message format: Optional config for message templates
- Channel targeting: Support for different webhook URLs per channel (via config)
- Quiet mode:
--no-slackflag to explicitly disable notifications
Technical Requirements
Implementation
- HTTP Client: Use
reqwest(already in requirements) to POST to webhook URL - Error Handling:
- Graceful failure: if Slack notification fails, don't fail the entire bump operation
- Log errors but continue with version/tag/changelog operations
- Clear error messages if webhook URL is invalid
- Non-blocking: Consider async notification (don't block main operation)
- Retry logic: Optional retry for failed webhook requests (with backoff)
Message Payload
Use Slack's webhook payload format:
{
"text": "Release Notification",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "🚀 New Release: v1.2.3"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Package:* `@circlesac/bump`"
},
{
"type": "mrkdwn",
"text": "*Version:* `1.2.0` → `1.2.3`"
}
]
}
]
}Security Considerations
- Webhook URL protection: Don't log or expose webhook URLs in error messages
- Sensitive data: Be careful not to include sensitive information in notifications
- Optional validation: Validate webhook URL format before sending
Usage Examples
# Set webhook URL via environment variable
export SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR/WEBHOOK/URL
bump full --output ./changelog.md
# Use webhook URL via CLI flag
bump version --slack-webhook https://hooks.slack.com/services/YOUR/WEBHOOK/URL
# Disable Slack notifications explicitly
bump full --no-slack --output ./changelog.md
# Different webhooks for different operations
bump tag --version 1.2.3 --slack-webhook https://hooks.slack.com/services/RELEASE/WEBHOOK
bump changelog --slack-webhook https://hooks.slack.com/services/CHANGELOG/WEBHOOKIntegration Points
CI/CD Integration
- GitHub Actions: Easy to set webhook URL as secret and pass to CLI
- Non-interactive mode: Works seamlessly in automated workflows
- Exit codes: Slack failures don't affect exit codes (operations succeed even if notification fails)
Config File Support (Optional)
Support configuration via .bump/config.toml:
[slack]
webhook_url = "https://hooks.slack.com/services/YOUR/WEBHOOK/URL"
enabled = true
channel = "#releases"Success Criteria
- ✅ Successfully sends Slack notifications via webhook for version bumps
- ✅ Supports webhook URL via environment variable and CLI flag
- ✅ Gracefully handles webhook failures without breaking main operations
- ✅ Provides rich, formatted messages with relevant information
- ✅ Integrates seamlessly with existing bump commands
- ✅ Works in CI/CD environments (non-interactive mode)
- ✅ Supports enabling/disabling notifications via flags
- ✅ Clear error messages for invalid webhook URLs
Implementation Notes
- Start simple: Begin with basic text messages, then add Block Kit formatting
- Error handling: Make Slack notifications non-blocking - if they fail, the bump operation should still succeed
- Testing: Consider adding a
--slack-testflag to send a test notification - Documentation: Document how to set up Slack webhooks in the README
- Optional feature: Make Slack integration optional (don't require it for core functionality)
Why Webhooks Instead of Slack API
- Simplicity: No OAuth flow, token management, or app installation required
- Ease of setup: Just create a webhook URL in Slack and use it
- Less complexity: No need to handle token refresh, scopes, or API rate limits
- Sufficient for notifications: Webhooks are perfect for one-way notifications
- CI/CD friendly: Easy to store webhook URLs as secrets in CI systems
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request