-
Notifications
You must be signed in to change notification settings - Fork 0
feat: include PR conversation comments for review_comments subscribers #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When user subscribes to review_comments, PR conversation comments (from the Conversation tab) are now also delivered. This matches user expectation that review_comments covers all PR comments. - Issue comments still only match "comments" subscribers - Inline code review comments still only match "review_comments" - PR conversation comments now match both 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
WalkthroughThe PR updates event routing so an Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/github-app/event-processor.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
**/*.ts: Store context externally - maintain stateless bot architecture with no message history, thread context, or conversation memory
Use<@{userId}>for mentions in messages AND add mentions in sendMessage options - do not use @username format
Implement event handlers for onMessage, onSlashCommand, onReaction, onTip, and onInteractionResponse to respond to Towns Protocol events
Define slash commands in src/commands.ts as a const array with name and description properties, then register handlers using bot.onSlashCommand()
Set ID in interaction requests and match ID in responses to correlate form submissions, button clicks, and transaction/signature responses
Use readContract for reading smart contract state, writeContract for SimpleAccount operations, and execute() for external contract interactions
Fund bot.appAddress (Smart Account) for on-chain operations, not bot.botId (Gas Wallet/EOA)
Use bot.* handler methods directly (outside event handlers) for unprompted messages via webhooks, timers, or tasks - requires channelId, spaceId, or other context stored externally
Always check permissions using handler.hasAdminPermission() before performing admin operations like ban, redact, or pin
User IDs are hex addresses in format 0x..., not usernames - use them consistently throughout event handling and message sending
Slash commands do not trigger onMessage - register slash command handlers using bot.onSlashCommand() instead
Use getSmartAccountFromUserId() to retrieve a user's wallet address from their userId
Include required environment variables: APP_PRIVATE_DATA (bot credentials) and JWT_SECRET (webhook security token)
Files:
src/github-app/event-processor.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Provide alt text for image attachments and use appropriate MIME types for chunked attachments (videos, screenshots)
Files:
src/github-app/event-processor.ts
Add unit tests verifying: - comments subscribers receive PR conversation comments - review_comments subscribers receive PR conversation comments - review_comments subscribers do NOT receive issue comments Update README to document comment routing behavior. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
c0624a9 to
6bfd54f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
README.md(2 hunks)tests/unit/github-app/event-processor.test.ts(2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
**/*.ts: Store context externally - maintain stateless bot architecture with no message history, thread context, or conversation memory
Use<@{userId}>for mentions in messages AND add mentions in sendMessage options - do not use @username format
Implement event handlers for onMessage, onSlashCommand, onReaction, onTip, and onInteractionResponse to respond to Towns Protocol events
Define slash commands in src/commands.ts as a const array with name and description properties, then register handlers using bot.onSlashCommand()
Set ID in interaction requests and match ID in responses to correlate form submissions, button clicks, and transaction/signature responses
Use readContract for reading smart contract state, writeContract for SimpleAccount operations, and execute() for external contract interactions
Fund bot.appAddress (Smart Account) for on-chain operations, not bot.botId (Gas Wallet/EOA)
Use bot.* handler methods directly (outside event handlers) for unprompted messages via webhooks, timers, or tasks - requires channelId, spaceId, or other context stored externally
Always check permissions using handler.hasAdminPermission() before performing admin operations like ban, redact, or pin
User IDs are hex addresses in format 0x..., not usernames - use them consistently throughout event handling and message sending
Slash commands do not trigger onMessage - register slash command handlers using bot.onSlashCommand() instead
Use getSmartAccountFromUserId() to retrieve a user's wallet address from their userId
Include required environment variables: APP_PRIVATE_DATA (bot credentials) and JWT_SECRET (webhook security token)
Files:
tests/unit/github-app/event-processor.test.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Provide alt text for image attachments and use appropriate MIME types for chunked attachments (videos, screenshots)
Files:
tests/unit/github-app/event-processor.test.ts
🪛 GitHub Actions: CI
tests/unit/github-app/event-processor.test.ts
[warning] 1-1: Code style issues found in file by Prettier. Run 'prettier --write' to fix.
🔇 Additional comments (7)
README.md (2)
71-72: Clear documentation of comment routing behavior.The explanation effectively clarifies how PR conversation comments are routed to both
commentsandreview_commentssubscribers, and provides useful context on the use case for PR-focused subscriptions.
114-116: Event routing documentation is accurate and consistent.The descriptions of
issue_commentandpull_request_review_commentevents align well with the routing behavior explained in the note above.tests/unit/github-app/event-processor.test.ts (5)
145-165: Well-structured test helper for PR comment payloads.The
createIssueCommentPayloadhelper correctly mimics GitHub's behavior of including thepull_requestfield only for PR comments, making the test setup clear and accurate.
168-200: Excellent mock service setup.The
createMockshelper provides clean, reusable test infrastructure that captures delivery behavior for verification while keeping test cases focused and readable.
202-210: Test correctly verifies comments subscriber receives PR comment.
212-230: Critical test coverage for new routing behavior.These tests correctly verify that:
- PR conversation comments are now delivered to
review_commentssubscribers (the new feature)- Regular issue comments remain excluded from
review_commentssubscriptions (preserving the intended filtering)
232-254: Comprehensive edge case coverage.These tests validate important scenarios:
- Multiple subscribers with different event types both receive the same PR comment
- Channels without comment-related subscriptions are properly filtered out
The test suite now provides excellent coverage of the PR comment routing feature.
When user subscribes to review_comments, PR conversation comments (from the Conversation tab) are now also delivered. This matches user expectation that review_comments covers all PR comments.
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Documentation
Tests
✏️ Tip: You can customize this high-level summary in your review settings.