feat: Deadlines Incentive Plugin - Bounty #66#84
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 59 minutes and 35 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR introduces a new Possibly related issues
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
🧹 Nitpick comments (6)
proposals/deadlines-incentive/package.json (1)
6-10: Consider adding a test script.No test infrastructure defined. For a plugin handling rewards and deadlines, tests would help prevent regressions.
proposals/deadlines-incentive/README.md (1)
19-21: Add language specifier to code block.Per markdownlint MD040, fenced code blocks should have a language. Use
textormathfor formulas.Proposed fix
-``` +```text reward = baseTaskValue × max(0, 1 + (deadlineRewardRatio × (1 - actualTime/deadlineTime)) - penalty)</details> </blockquote></details> <details> <summary>proposals/deadlines-incentive/src/scheduler.ts (1)</summary><blockquote> `98-100`: **Empty catch blocks hide errors.** Silent failures make debugging difficult. At minimum, log the error. <details> <summary>Proposed fix</summary> ```diff } catch { - // Label may not exist, non-critical + // Label may not exist, non-critical - but log for visibility + ctx.logger?.debug?.("Failed to add label"); }Also applies to: 130-132
proposals/deadlines-incentive/src/index.ts (3)
159-166: Weak typing withany[].Use a proper type for labels to enable type-checking.
Proposed fix
-function extractTaskValue(labels: any[]): number { +function extractTaskValue(labels: Array<string | { name?: string }>): number {
197-198: Module-level side effect.
startDeadlineScheduler()runs on import. This complicates testing and may cause issues if the module is imported multiple times.Consider lazy initialization
Move scheduler start into the handler or export an explicit
init()function that consumers call when ready.
70-75: No validation for past deadlines.
parseDeadlineCommandaccepts any valid date, including dates in the past. Consider warning users or rejecting past dates.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 552e8528-d99a-49f3-a04c-266efc72293b
📒 Files selected for processing (6)
proposals/deadlines-incentive/README.mdproposals/deadlines-incentive/manifest.jsonproposals/deadlines-incentive/package.jsonproposals/deadlines-incentive/src/index.tsproposals/deadlines-incentive/src/scheduler.tsproposals/deadlines-incentive/tsconfig.json
- Register deadlines with scheduler after setting them - Fix handleCompletion to read metadata from issue comments instead of placeholders - Fix handleExpiry to accept user config instead of always using defaults - Import registerDeadline in index.ts
…remove module-level side effect, error handling
Deadlines Incentive
Issue: #66
Features
Reward Formula
Configuration