Repository navigation
Stale PR closure workflow/script - #9883
Jose Alvarez (jpalvarezl) merged 12 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The script can close previously labeled PRs without issuing the new closure warning or allowing its required grace period.
3 open issues
What changed in this PR
Replaces label-triggered issue and PR reminders with a deterministic lifecycle for warning and closing inactive external pull requests.
Changes:
- Uses default-branch CODEOWNERS for maintainer classification, with exemptions for maintainer-authored and
dont-closePRs. - Adds warning and closure stages with configurable inactivity thresholds, retries, and dry-run support.
- Replaces the previous tests with coverage for lifecycle eligibility, actions, exemptions, and failures.
| File | Description |
|---|---|
.github/workflows/stale-pr-ping.yml |
Runs the new PR lifecycle script and updates input descriptions. |
.github/tests/test_stale_pr_ping.py |
Adds tests for the new lifecycle and configuration. |
.github/tests/test_stale_issue_pr_ping.py |
Removes tests for the previous reminder process. |
.github/scripts/stale_pr_ping.py |
Implements maintainer classification, warnings, and automatic closure. |
.github/scripts/stale_issue_pr_ping.py |
Removes the label-triggered issue and PR reminder script. |
Review effort: Balanced
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: Findings reported
Scope: full PR (7 commit(s)): ab71f8c24907, b15a77a06b12, 7c2e255cf245, cdae2eb18610, 22eff9b7dffe, bf4054c40115, 25249828df46
Model: gpt-5.6-sol
Overview
The PR replaces the label-gated issue/PR reminder with an open-PR-only two-stage lifecycle and adds useful safeguards: CODEOWNER and dont-close exemptions, dry-run support, comment-before-mutation ordering, retries, and focused tests. Four lifecycle gaps remain: the shared label can close previously labeled PRs without the new warning, contributor activity does not cancel the closing state, a partial warning cannot recover across runs, and unbounded comment enumeration lets hostile PRs repeatedly consume shared automation resources.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
4 verified findings remained after source verification (4 medium) across 1 file. Details are attached to the affected lines below.
Affected areas: .github/scripts/stale_pr_ping.py


Motivation & Context
The existing stale automation only checks pull requests carrying a manually applied label, sends a single reminder, and does not close inactive pull requests. In practice, the required label is not being applied, so the scheduled workflow scans no candidates.
This change provides a deterministic, PR-only process for warning external contributors and closing pull requests that remain inactive after a maintainer response. It intentionally avoids AI-based classification and includes maintainer-controlled exemptions and dry-run support.
Description & Review Guide
stale_pr_pingand restricts it to open pull requests.CODEOWNERSon the repository's default branch.requested-info.dont-closelabel.DAYS_THRESHOLDas a shared configuration override for the warning and closing periods.python -m pytest .github\tests\test_stale_pr_ping.py -qpasses with 40 tests.requested-info; continued inactivity then results in a fixed closing comment and closure.updated_attimestamp.dont-close.Related Issue
N/A - repository automation. Updates
.github/workflows/stale-pr-ping.yml.AI Assistance
AI assistance details: GitHub Copilot assisted with the design discussion, implementation, tests, and PR description.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and the title prefix in sync automatically.