Skip to content

feat: enable safe reopening of prs#2429

Merged
MonaaEid merged 2 commits into
hiero-ledger:mainfrom
exploreriii:feat/lifecycle-reopen-clock
Jul 11, 2026
Merged

feat: enable safe reopening of prs#2429
MonaaEid merged 2 commits into
hiero-ledger:mainfrom
exploreriii:feat/lifecycle-reopen-clock

Conversation

@exploreriii

Copy link
Copy Markdown
Contributor

Fixes #2428
Tested in dry run mode with some hypothetical scenarios

  • [x ] Tested (unit, integration, etc.)

Signed-off-by: exploreriii <133720349+exploreriii@users.noreply.github.com>
@github-actions github-actions Bot added approved Issue has been approved by team member skill: beginner Achievable by a fairly new comer that has already completed a couple of good first issues labels Jul 10, 2026
@exploreriii
exploreriii marked this pull request as ready for review July 10, 2026 21:07
@exploreriii
exploreriii requested review from a team as code owners July 10, 2026 21:07
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@exploreriii, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 43 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4c3f67b2-8150-4dd5-99fd-09dafc8968f7

📥 Commits

Reviewing files that changed from the base of the PR and between 985ecb5 and d26954a.

📒 Files selected for processing (2)
  • .github/scripts/__tests__/jest/bot-contributor-lifecycle.test.js
  • .github/scripts/bot-contributor-lifecycle.js

Walkthrough

The 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.

Changes

Reopened PR lifecycle

Layer / File(s) Summary
Reopen-aware inactivity timing
.github/scripts/bot-contributor-lifecycle.js
Adds reopen-event lookup and recalculates PR inactivity age when a newer reopen occurs.
Reopened lifecycle test coverage
.github/scripts/__tests__/jest/bot-contributor-lifecycle.test.js
Extends the fake GitHub client with reopened events and tests fresh, reminder, and closure outcomes.

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
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: safely handling reopened PRs in the lifecycle bot.
Description check ✅ Passed The description is related to the PR and mentions fixing #2428 with dry-run testing.
Linked Issues check ✅ Passed The changes treat reopened PRs as active and reset the inactivity clock, matching #2428.
Out of Scope Changes check ✅ Passed The diff stays focused on reopened-PR lifecycle behavior and related tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
📋 Issue Planner

Built with CodeRabbit's Coding Plans for faster development and fewer bugs.

View plan used: #2428

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1040cfb9-0415-4bfb-ad2a-f0bdc2695975

📥 Commits

Reviewing files that changed from the base of the PR and between 92e7bcd and 985ecb5.

📒 Files selected for processing (2)
  • .github/scripts/__tests__/jest/bot-contributor-lifecycle.test.js
  • .github/scripts/bot-contributor-lifecycle.js

Comment thread .github/scripts/bot-contributor-lifecycle.js Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 latest reopened timestamp.
  • 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.

Comment thread .github/scripts/bot-contributor-lifecycle.js Outdated
Comment thread .github/scripts/bot-contributor-lifecycle.js Outdated
Comment thread .github/scripts/__tests__/jest/bot-contributor-lifecycle.test.js
Signed-off-by: exploreriii <133720349+exploreriii@users.noreply.github.com>
@github-actions github-actions Bot added open to community review PR is open for community review and feedback queue:junior-committer PR awaiting initial quality review labels Jul 10, 2026
@github-actions github-actions Bot added queue:committers PR awaiting committer technical review and removed queue:junior-committer PR awaiting initial quality review labels Jul 11, 2026
@MonaaEid
MonaaEid merged commit fd3c405 into hiero-ledger:main Jul 11, 2026
13 checks passed
@github-actions

Copy link
Copy Markdown

👋 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! 🚀
— Hiero Python SDK Team

@MonaaEid MonaaEid added this to the v0.2.9 milestone Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Issue has been approved by team member open to community review PR is open for community review and feedback queue:committers PR awaiting committer technical review skill: beginner Achievable by a fairly new comer that has already completed a couple of good first issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: lifecycle bot should treat a reopened PR as active (reset the inactivity clock)

5 participants