fix(ci): prevent stale PR closer from incorrectly closing new PRs#18069
Merged
fix(ci): prevent stale PR closer from incorrectly closing new PRs#18069
Conversation
This fixes a bug where PRs from maintainers (or any PR) could be
immediately closed as stale even when just opened. The root causes:
1. If team member fetch failed silently, maintainerLogins was empty
2. lastActivity was initialized to epoch (1970), so any PR without
detected maintainer activity appeared 50+ years old
3. No minimum age check - PRs created today could be marked stale
Changes:
- Add explicit check to skip PRs created < 30 days ago from staleness
- Initialize lastActivity to PR creation date instead of epoch
- Improve logging for team fetch success/failure with details
- Add error logging for reviews/comments fetch failures
Fixes issue where PR #18035 from a maintainer was incorrectly closed.
Contributor
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
|
Size Change: -2 B (0%) Total Size: 23.6 MB ℹ️ View Unchanged
|
yuvrajangadsingh
pushed a commit
to yuvrajangadsingh/gemini-cli
that referenced
this pull request
Feb 4, 2026
sidwan02
pushed a commit
to sidwan02/gemini-cli-gemma
that referenced
this pull request
Feb 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a bug in the stale PR closer workflow where new PRs could be incorrectly closed due to
lastActivitybeing initialized to epoch and a lack of a minimum age check.Details
lastActivitytopr.created_atinstead ofnew Date(0).How to Validate
.github/workflows/gemini-scheduled-stale-pr-closer.yml.thirtyDaysAgois correctly calculated.if (prCreatedAt > thirtyDaysAgo) continue;correctly skips young PRs.Pre-Merge Checklist