feat: enable safe reopening of prs#2429
Conversation
Signed-off-by: exploreriii <133720349+exploreriii@users.noreply.github.com>
|
Warning Review limit reached
Next review available in: 43 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThe lifecycle bot now treats the latest PR reopen event as activity, resetting inactivity timing before reminder or closure decisions. Tests add synthetic reopen events and cover fresh, reminder-threshold, and close-threshold behavior. ChangesReopened PR lifecycle
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant LifecycleBot
participant GitHubEvents
participant PullRequest
LifecycleBot->>PullRequest: evaluate inactivity
LifecycleBot->>GitHubEvents: fetch issue events
GitHubEvents-->>LifecycleBot: return latest reopened timestamp
LifecycleBot->>LifecycleBot: reset activity baseline and age
LifecycleBot->>PullRequest: remind or close based on recalculated age
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
📋 Issue PlannerBuilt with CodeRabbit's Coding Plans for faster development and fewer bugs. View plan used: ✨ 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: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 1040cfb9-0415-4bfb-ad2a-f0bdc2695975
📒 Files selected for processing (2)
.github/scripts/__tests__/jest/bot-contributor-lifecycle.test.js.github/scripts/bot-contributor-lifecycle.js
There was a problem hiding this comment.
Pull request overview
This PR updates the contributor-lifecycle GitHub Action bot so that a PR “reopen” event is treated as activity, preventing intentionally revived PRs from being immediately re-closed for inactivity (per #2428).
Changes:
- Add a
lastReopenedDate()helper that queries the PR’s issue events and finds the latestreopenedtimestamp. - Incorporate the reopen timestamp into PR “last activity” calculation (currently applied only in the close-path).
- Add Jest coverage for reopened PR scenarios.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
.github/scripts/bot-contributor-lifecycle.js |
Implements reopen-aware activity detection for reviewed PRs and updates the top-level behavior documentation. |
.github/scripts/__tests__/jest/bot-contributor-lifecycle.test.js |
Extends the fake Octokit env and adds tests for reopened PR behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: exploreriii <133720349+exploreriii@users.noreply.github.com>
|
👋 Hi @exploreriii! Great work completing a Beginner issue! 🎉 Thanks for your contribution! 🚀 Here are some issues you might want to explore next:
🌟 Stay connected: Happy coding! 🚀 |
Fixes #2428
Tested in dry run mode with some hypothetical scenarios