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

Workflow to label and comment stale pull requests #13522

Merged
merged 1 commit into from Sep 22, 2022
Merged

Conversation

r0qs
Copy link
Member

@r0qs r0qs commented Sep 13, 2022

This PR supersedes #13499 and address some of the concerns of the issue #8969.

It adds a workflow to label PRs as stale after 14 days of inactivity, comments on them, and if they remain inactive for more than 7 days, it closes them. If an update occurs, the label is removed, and the timer restarted.

PRs labeled as external contribution, milestones, and draft PRs are ignored.
Issues are ignored (i.e., set to -1).
It runs every day at noon.

It is currently set for debugging only and can be triggered manually in the workflow dashboard, so we can check the expected behavior in the workflow logs without affecting the current open PRs.

Copy link
Collaborator

@nikola-matic nikola-matic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If my assumptions are correct, then this looks good to me, and if the debugging assumption specifically is correct, then I see no problem with merging this and trying it out.

@nikola-matic
Copy link
Collaborator

nikola-matic commented Sep 22, 2022

Also, please rebase against develop, the euler external test is fixed. I know it's not required, but I really like those ✔️ builds :)

Co-authored-by: Kamil Śliwak <cameel2@gmail.com>
Co-authored-by: Daniel Kirchner <daniel@ekpyron.org>
Copy link
Collaborator

@nikola-matic nikola-matic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like euler is broken again, so don't worry about it.

@nikola-matic
Copy link
Collaborator

Looks like euler is broken again, so don't worry about it.

Or not 😄

@r0qs r0qs merged commit d0103b5 into develop Sep 22, 2022
@r0qs r0qs deleted the gh-stale-actions branch September 22, 2022 14:00
close-pr-label: closed-due-inactivity
days-before-pr-stale: ${{ env.BEFORE_STALE }}
days-before-pr-close: ${{ env.BEFORE_CLOSE }}
exempt-pr-labels: 'external contribution'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This label actually has an emoji in it :) It should be external contribution :star:.

Comment on lines +31 to +32
stale-pr-label: stale
close-pr-label: closed-due-inactivity
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remember to actually create these labels before we run the bot. Github would create them automatically but without colors or description.

stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The action is producing this warning:

Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

Do they have a newer version that does not use set-output already?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, they released v6 some days ago which already upgrade to the new format: actions/stale#839

exempt-draft-pr: true
exempt-all-milestones: true
remove-stale-when-updated: true
operations-per-run: 60
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd increase this to 100 so that we can process all our current PRs in one go.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. But for some reason, this action is parsing issues even though we explicitly disable it. I'm thinking of using another one that I did in my tests that call the graphql api directly for the PRs instead of use this actions/stale, but it is still a bit incomplete (it does not do everything that the actions/stale does yet).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. It probably fetches from the API first and filters only then. Might be worth a feature request or something.

I'd keep it simple for now and stick to this action but yeah, in the longer term we might actually want to switch to the other one (or build a custom one) because I think that just marking as stale is not what we want in some cases. E.g. for unreviewed PRs we might want to instead assign someone randomly or ping the channel or something.

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.

None yet

4 participants