-
Notifications
You must be signed in to change notification settings - Fork 180
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
Add 'Stale PRs' GH action to label and close inactive community PRs #7426
Conversation
In the announcement email / discussion for this we should probably clarify how "community" contributors can remove the "stale" label. Some users will know it from other GH repositories, but maybe not everyone does. |
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.
Thanks a lot @cbbayburt, let's give it a try!
# Delete its branch after closing a PR | ||
delete-branch: true |
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 might not be possible in case of a fork, I guess, but community PRs would probably mostly be created from forks? In any case I am not completely sure if we wanted to delete any branches automatically, that could be painful in case a PR is closed accidentally if for example a person is on a longer leave or similar.
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.
Otherwise, we'll have to deal with all the zombie branches manually and that's a bit frustrating because we'll need to ping people, read through a lot of commit history etc. to be able to safely delete them.
AFAIK, GH backs up deleted branch heads so it should be possible to restore them.
Forked branches won't be deleted with this action, but since they're not in our domain, we shouldn't care about them. This setting is only meant as a cleanup for branches created in our repo, so it's only relevant for PRs from us.
- name: Label/close stale PRs | ||
uses: actions/stale@v8 | ||
with: | ||
stale-pr-message: 'This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 10 days.' |
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.
Do I understand correctly that when removing the stale label there will be another 60 days before this message will be added again?
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.
True, any kind of activity, including removing the label or simply commenting on the PR will reset the timer to 0.
.github/workflows/stale.yml
Outdated
# Only consider 'community' PRs | ||
only-labels: 'community' |
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.
Do we really want to consider only community PRs? From my perspective we could include org members' PRs as well, so we also get a better feeling of how this automation "feels" if you are the author.
6c7fd09
to
b4b2826
Compare
Add "Stale PRs" GH action to label and close inactive community PRs.
The action runs daily at 01:00 UTC to label any PR that is inactive for 60 days with
Stale
label.After further 10 days, the action closes the PR and deletes its branch. The author has the chance to update the PR or simply remove the
Stale
label to unmark the PR for closing.If needed, we can extend the action to issues as well.
Check out https://github.com/actions/stale for the full range of options this action supports.
Changelogs
Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository
If you don't need a changelog check, please mark this checkbox:
If you uncheck the checkbox after the PR is created, you will need to re-run
changelog_test
(see below)Re-run a test
If you need to re-run a test, please mark the related checkbox, it will be unchecked automatically once it has re-run: