Skip to content
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

Merged
merged 1 commit into from
Sep 8, 2023

Conversation

cbbayburt
Copy link
Contributor

@cbbayburt cbbayburt commented Aug 16, 2023

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:

  • No changelog needed

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:

  • Re-run test "changelog_test"
  • Re-run test "backend_unittests_pgsql"
  • Re-run test "java_pgsql_tests"
  • Re-run test "schema_migration_test_pgsql"
  • Re-run test "susemanager_unittests"
  • Re-run test "javascript_lint"
  • Re-run test "spacecmd_unittests"

@cbbayburt cbbayburt requested review from renner and admd August 16, 2023 13:46
@agraul
Copy link
Member

agraul commented Aug 17, 2023

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.

Copy link
Member

@renner renner left a 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!

Comment on lines +30 to +28
# Delete its branch after closing a PR
delete-branch: true
Copy link
Member

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.

Copy link
Contributor Author

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.'
Copy link
Member

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?

Copy link
Contributor Author

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.

Comment on lines 27 to 28
# Only consider 'community' PRs
only-labels: 'community'
Copy link
Member

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.

@cbbayburt cbbayburt merged commit 0b6699f into uyuni-project:master Sep 8, 2023
2 checks passed
@cbbayburt cbbayburt deleted the stale-ping-action branch September 8, 2023 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants