fix(ci): respect exempt labels when closing stale items#26475
fix(ci): respect exempt labels when closing stale items#26475gundermanc merged 1 commit intomainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request improves the reliability of the stale item management process by ensuring that items marked with specific exempt labels are protected from being closed. By applying the existing exemption criteria to the closing step, the system prevents accidental closure of items that have been flagged as maintainer-only or otherwise exempt after being marked as stale. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the stale item closure logic in the GitHub lifecycle manager script to include an exemption query, ensuring that items with specific labels are protected from automatic closure. Feedback indicates that this exemption logic should be consistently applied to other closure paths in the script, specifically the 'No-Response' and 'PR Contribution Policy' steps, which currently lack this check.
| // 3. Handle Stale Close (14 days with stale label) | ||
| await processItems( | ||
| `repo:${owner}/${repo} is:open label:"${STALE_LABEL}" updated:<${closeThreshold.toISOString()}`, | ||
| `repo:${owner}/${repo} is:open label:"${STALE_LABEL}" ${exemptQuery} updated:<${closeThreshold.toISOString()}`, |
There was a problem hiding this comment.
While this change correctly protects stale items from being closed, the 'No-Response' closure logic (Step 1, line 110) and the 'PR Contribution Policy' closure logic (Step 4, line 217) still lack this exemptQuery check. To fully satisfy the PR's goal of protecting exempt items (such as those labeled security or pinned) from automatic closure, the same logic should be applied to all closure paths. Note that you will need to move the definition of exemptQuery (currently at line 133) to the top of the function to make it available for Step 1.
|
Size Change: -4 B (0%) Total Size: 34 MB
ℹ️ View Unchanged
|
Summary
Adds
exemptQueryto the "Stale Close" step of the lifecycle manager to ensure that items marked with exempt labels (like🔒 maintainer onlyandhelp wanted) are protected from being closed, even if they were previously marked asstale.Details
Previously, the
exemptQuerywas correctly applied when marking inactive items as stale, preventing exempt items from being automatically marked as stale. However, the query used to close stale items was missing this check. This meant that if an item had both thestaleand🔒 maintainer onlylabels (e.g. if a maintainer manually added the exempt label later to save it), the item could still be closed. This PR brings the close logic into alignment with the stale logic.Related Issues
None.
How to Validate
Review the source code change in
.github/scripts/gemini-lifecycle-manager.cjs. The query for "Handle Stale Close" now includes${exemptQuery}.Pre-Merge Checklist