Skip to content

feat: add Slack/Discord webhook notifications and attribution footer#22

Open
bestdev9369-oss wants to merge 5 commits intoGodsBoy:mainfrom
bestdev9369-oss:feat/webhook-notifications
Open

feat: add Slack/Discord webhook notifications and attribution footer#22
bestdev9369-oss wants to merge 5 commits intoGodsBoy:mainfrom
bestdev9369-oss:feat/webhook-notifications

Conversation

@bestdev9369-oss
Copy link
Copy Markdown

Description

This PR implements optional webhook notifications for RepoKeeper, sending messages to Slack or Discord when issues are triaged or PRs are reviewed.
It also fixes attribution footer handling in AI-generated comments to match the expected: "Powered by [RepoKeeper]"

Changes included

1. Configuration

  • Added notifications.webhookUrl to config.ts and repokeeper.config.example.ts.
  • Follows RepoKeeper’s config system (no direct process.env calls outside config).

2. Notifications Module

  • Created src/notifications/notifier.ts with sendWebhookNotification() function.
  • Sends formatted messages including:
    • Issue/PR link
    • Classification (for issues)
    • PR summary
  • Returns success/failure so calling code can handle errors.

3. Integration with Triage

  • responder.ts now calls sendWebhookNotification after:
    • Issue classification
    • Duplicate detection (no footer added here for duplicates)
  • AI-generated fallback comments and successful comments now include: "Powered by [RepoKeeper]"

4. Tests

  • Added src/notifications/notifier.test.ts with:
    • Successful notification
    • Missing webhook URL
    • Fetch failure simulation
  • Updated responder.test.ts to match standardized attribution footer.

5. Cleanup

  • Removed old Generated by [RepoKeeper] footer in comments.
  • No breaking changes to existing GitHub operations or triage logic.

Testing

  • Run pnpm test — all tests pass.
  • Verified attribution footer appears on AI-generated comments.
  • Verified duplicate detection comments do not include attribution footer.
  • Verified notifications module handles missing webhook URLs and fetch errors gracefully.

Next Steps / Optional Improvements

  • Add platform-specific formatting for Slack vs Discord.
  • Add filtering options (e.g., only notify certain categories or PR sizes).
  • Retry failed webhook notifications for transient network issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant