-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CI: Add stale PR action #36336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI: Add stale PR action #36336
Conversation
neat idea |
Might want to make exemptions for works in progress or PRs awaiting review, seems both are possible with this action |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we just close PRs and not issues?
looking at the options https://github.com/actions/stale/blob/main/action.yml there is a debug option and rate limit, maybe try with these.
.github/workflows/stale-pr.yml
Outdated
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
stale-pr-message: "This pull request is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days." | ||
days-before-stale: 30 | ||
days-before-close: 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we set this to -1 to start, so that issues and PRs are just labelled in the first instance and not closed?
yeah let's just label to start |
Yes, I believe if we don't specify a |
Updated to never close PRs for now and use debug only (I'm assuming this means we would see what actions would have occurred within the logs). Rate limiting I think is handled by default with occurences-per-run set to 30. |
.github/workflows/stale-pr.yml
Outdated
name: "Close stale pull requests" | ||
on: | ||
schedule: | ||
- cron: "0 0 * * *" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this runs once a day? (could be more frequent while in debug mode)
also could add https://docs.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events as a comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about every 6 hours during debugging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can easily run builds manually in GitHub actions afaik. I'd say once a day is good enough, also for debug, but doesn't make a difference.
@datapythonista if you'd have a quick look. |
I also think it could be interesting to automatically label new PRs with "Needs review" (similar to new issues being flagged with "Needs triage"), and in addition exempt these from becoming stale |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks @dsaxton
I guess days-before-close: -1
means that we'll just label PRs, and not actually close them, right? That sounds good to me.
Added few ideas, but happy with it.
.github/workflows/stale-pr.yml
Outdated
name: "Close stale pull requests" | ||
on: | ||
schedule: | ||
- cron: "0 0 * * *" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can easily run builds manually in GitHub actions afaik. I'd say once a day is good enough, also for debug, but doesn't make a difference.
.github/workflows/stale-pr.yml
Outdated
- uses: actions/stale@v3 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
stale-pr-message: "This pull request is stale because it has been open for 30 days with no activity. Please update to prevent this from being closed." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it could be good that the message is a bit friendlier, instead of being straight to the point (I guess this is copied from the action documentation).
Like explaining why we close stale PRs, letting the user know that they can always ping us later if they need it reopen...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, it does sound a bit blunt. I'll try to use softer wording; open to suggestions as well.
.github/workflows/stale-pr.yml
Outdated
@@ -0,0 +1,17 @@ | |||
name: "Manage stale pull requests" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other workflows are named as "Activate", "CI", "Assign". Not important, but something more compact like "Stale PRs" may look more consistent, and make things easier to find in the workflows list.
Yes, I think that essentially disables closing according to their documentation:
|
I don't directly find where we discussed this before (or at least where I raised this concern, some other short discussions at #23489, #23489), but my main concern with something like this is that this somewhat assumes that PRs are inactive because of the contributors being inactive. Looking at the 10 first PRs when sorting by "least recently updated", roughly 6 of them are actually waiting on review of a core developer, 2 first need discussion / a decision, and 2 are really waiting on changes of the contributor. Which doesn't mean that a bot cannot help improve our workflow, to be clear (it can also help us to be reminded to review, or at some point if no core dev has interest to review a PR, then the best solution is to actually close it). But at least that should somehow be reflected in the messaging of the bot. Comment from @TomAugspurger on gitter: "Are you aware of any bots that could check with the last comment was by a pandas maintainer / requested changes? Ideally we would only auto-close when we were the last one to comment." |
@jorisvandenbossche I think not automatically closing PRs partly addresses your concerns. but I agree the message seems targeted to the author. maybe just a terse |
According to https://github.com/actions/stale, there are ways to configure depending on labels already present on the PR. |
maybe we need another action in place first that labels PRs with "Needs review" when changes are pushed. |
Agree exempting some labels would make sense, I also opened #36349 to start trying to move towards that (this and exempting "Needs Review" would at least deal with the situation of someone opening a PR that doesn't get reviewed for a while). Regarding wording could add something asking the person to ping a team member if they're waiting for a review (or can contributors be given the ability to label as "Needs Review" themselves, and ask them to do this if they're still waiting?). That way the onus doesn't sound like it's being placed only on the contributor. |
I'm happy with this as-is, so just spitballing:
|
@jbrockmendel Maybe a generic "Blocked" label and add that to the exempt list here? I'm also assuming these labels should already exist (the action won't create them) so should I add "Stale" and "Blocked" to the current set? Edit: went ahead and added them |
This is the default, but just being explicit about it
ok let's give this a try, can always disable if its out of control. |
thanks @dsaxton |
for info.. from https://github.com/pandas-dev/pandas/runs/1116110678?check_suite_focus=true Marking issue #35514 - BUG: fix combine_first converting timestamp to int as stale |
#35292 has label:"Needs Discussion". maybe add to skip list. |
Marking issue #35292 - ENH: Add orient=tight format for dictionaries as stale |
Marking issue #35292 - ENH: Add orient=tight format for dictionaries as stale Top one should be ignored if / when #36382 gets merged |
Marking issue #35292 - ENH: Add orient=tight format for dictionaries as stale |
Adding a GitHub Action for
closing stale PRslabeling PRs as stale which I think could help in managing the backloghttps://github.com/actions/stale