-
Notifications
You must be signed in to change notification settings - Fork 0
feat: distinguish issue close reasons (completed vs not planned) #91
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
WalkthroughAdded support for issue closure reasons. The IssuesPayloadSchema now includes an optional 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: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (2)
🧰 Additional context used📓 Path-based instructions (2)**/*.ts📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧬 Code graph analysis (1)src/formatters/webhook-events.ts (1)
🔇 Additional comments (3)
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: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/formatters/events-api.ts(1 hunks)src/formatters/shared.ts(1 hunks)src/formatters/webhook-events.ts(1 hunks)src/types/events-api.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/types/events-api.tssrc/formatters/shared.tssrc/formatters/events-api.tssrc/formatters/webhook-events.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/types/events-api.tssrc/formatters/shared.tssrc/formatters/events-api.tssrc/formatters/webhook-events.ts
🧬 Code graph analysis (2)
src/formatters/events-api.ts (1)
src/formatters/shared.ts (2)
getIssueEventEmoji(79-90)getIssueEventHeader(95-106)
src/formatters/webhook-events.ts (1)
src/formatters/shared.ts (2)
getIssueEventEmoji(79-90)getIssueEventHeader(95-106)
🔇 Additional comments (4)
src/formatters/webhook-events.ts (1)
77-78: LGTM!The changes correctly propagate
issue.state_reasonto the helper functions, enabling proper emoji and header selection based on the issue closure reason.src/formatters/events-api.ts (1)
77-78: LGTM!The changes correctly propagate
issue.state_reasonto the helper functions, maintaining consistency with the webhook event formatter.src/formatters/shared.ts (2)
76-90: LGTM!The function correctly handles the new
stateReasonparameter, distinguishing between issues closed as "not_planned" (⚪) and those completed or with unspecified reason (✅). The optional parameter maintains backward compatibility.
92-106: LGTM!The function correctly implements differentiated header text based on the
stateReason, providing clear user-facing labels that distinguish between planned closures and those marked as not planned.
- Add state_reason parameter to getIssueEventEmoji/Header - Show ⚪ "Issue Closed as Not Planned" for not_planned - Show ✅ "Issue Closed" for completed or unspecified - Add state_reason field to IssuesPayloadSchema 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
bfc58ba to
4228137
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.