Skip to content

feat: Slack Integration #5

@research-developer

Description

@research-developer

Overview

Add Slack integration for notifications and slash commands.

Webhook Support ✅

Slack provides multiple webhook mechanisms:

Events API

  • app_mention - Bot mentioned in channel
  • message - New message in channel
  • reaction_added - Emoji reaction added

Slash Commands

Custom commands like /pr-agent review <url>

Identification

  • Header: X-Slack-Signature (HMAC SHA256)
  • Header: X-Slack-Request-Timestamp
  • Payload: Contains team_id, api_app_id
  • Challenge: URL verification returns challenge field

Signature Verification

sig_basestring = f"v0:{timestamp}:{body}"
expected = "v0=" + hmac.new(secret, sig_basestring, sha256).hexdigest()

Event Payload

{
  "type": "event_callback",
  "team_id": "T123",
  "api_app_id": "A123",
  "event": {
    "type": "app_mention",
    "user": "U123",
    "text": "<@bot> /review https://github.com/...",
    "channel": "C123"
  }
}

Slash Command Payload

{
  "command": "/pr-agent",
  "text": "review https://github.com/...",
  "response_url": "https://hooks.slack.com/...",
  "trigger_id": "xxx",
  "user_id": "U123",
  "channel_id": "C123"
}

Tasks

  • Add Slack Events API webhook handler
  • Implement slash commands (/pr-agent review, /pr-agent describe)
  • Send PR notifications to Slack channels
  • Interactive buttons for PR actions
  • Thread replies for PR updates

Use Cases

  1. Notifications: Alert channel when PR needs review
  2. Commands: /pr-agent review from Slack
  3. Summaries: Daily PR summary in channel
  4. Approvals: Approve PRs via Slack buttons

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions