feat: automate stale and abandon PR detection and labeling#41
feat: automate stale and abandon PR detection and labeling#41pemamian wants to merge 11 commits into
Conversation
feat: automate stale and abandon PR detection and labeling
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
| ADDITIONAL_ABANDON_DAYS = 30 | ||
| ABANDON_THRESHOLD_DAYS = STALE_THRESHOLD_DAYS + ADDITIONAL_ABANDON_DAYS | ||
|
|
||
| # Label Constants |
There was a problem hiding this comment.
Make sure to create the labels before merging :)
There was a problem hiding this comment.
I think github automatically creates labels that don't exist. (based on small tests I've done)
| is_stale = updated_at < stale_limit | ||
| is_abandon_candidate = updated_at < abandon_limit | ||
|
|
||
| # Determine matching category |
There was a problem hiding this comment.
Should we have a label removal logic too? If the PR is active again?
|
|
||
| # Determine matching category | ||
| is_stale_review = is_stale and (LABEL_UNDER_REVIEW in labels) | ||
| is_blocked_abandon = is_abandon_candidate and (LABEL_BLOCKED in labels) |
There was a problem hiding this comment.
Is abandon just for blocked PRs?
|
|
||
| if missing_labels: | ||
| print(f'[ACTION] PR #{pr.number} "{pr.title}" is inactive. Adding missing labels: {missing_labels}') | ||
| # PyGithub add_to_labels accepts iterable of strings or label objects |
There was a problem hiding this comment.
Since iterables are accepted, why not pass them instead of making multiple API calls?
There was a problem hiding this comment.
reduces unnecessary 'add' calls that could cause a notification.
…ff-peak cron scheduling, and robust error handling
Description
Category (Required)
Please select one or more categories that apply to this change.
ucp-schematool (resolver, linter, validator). (Requires Maintainer approval)Related Issues
Checklist
!for breaking changes).Screenshots / Logs (if applicable)