Skip to content

Measure stale PR age from the latest reopen - #7282

Merged
ymichael merged 1 commit into
mainfrom
bb/investigate-premature-pr-closure-thr_6fus9m3d6c
Nov 9, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/investigate-premature-pr-closure-thr_6fus9m3d6c

Conversation

@ymichael

@ymichael ymichael commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

The nightly stale-PR cleanup (.github/workflows/close-stale-prs.yml) measured age from created_at only. A PR reopened after its first closure was therefore closed again at the next scheduled run. #6215 was created Oct 24, closed Oct 27, reopened Nov 7, and closed by the bot on Nov 8 with "open for more than two weeks" after less than a day open.

What changed

Before closing a candidate, the job reads the PR's issue events and treats the PR as open since its latest reopened event (or created_at if never reopened). PRs reopened within the fourteen-day window are skipped and logged as "Recently reopened". The creation-date prefilter is unchanged, so events are fetched only for PRs older than fourteen days.

How you verified

AGENT GENERATED

🤖 Generated with Claude Code

The nightly cleanup aged pull requests from creation, so a PR reopened
after its first closure was closed again at the next run (#6215 was
reopened on Nov 7 and closed on Nov 8). Skip PRs whose latest reopen is
inside the fourteen-day window.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ymichael
ymichael merged commit 8774705 into main Nov 9, 2026
50 checks passed
@ymichael
ymichael deleted the bb/investigate-premature-pr-closure-thr_6fus9m3d6c branch November 9, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant