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

chore: a stalebot to close inactive issues and PRs #29134

Merged
merged 1 commit into from
Dec 8, 2022

Conversation

steveluscher
Copy link
Contributor

@steveluscher steveluscher commented Dec 7, 2022

Problem

We just crested 1K issues, and stalebot is nowhere in sight. Let's add stalebot back in, gradually, to get abandoned issues and PRs under control.

Summary of Changes

I will annotate all of the changes inline. Comment under those annotations.

Test plan

Here's a debug run: https://github.com/solana-labs/solana/actions/runs/3635088973/jobs/6133857914

Fixes #29093.

@steveluscher steveluscher force-pushed the stalebot-the-return branch 3 times, most recently from 0e094a2 to ad2a9fe Compare December 7, 2022 01:55
Copy link
Contributor Author

@steveluscher steveluscher left a comment

Choose a reason for hiding this comment

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

The debug logs for this action are lovely. See a debug run, here: https://github.com/solana-labs/solana/actions/runs/3635088973/jobs/6133857914

Comment on lines +3 to +5
# Chosen to be just before London wakes up and way past San Francisco's bedtime.
schedule:
- cron: "0 8 * * 1-5" # This is in UTC.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If emails are to be sent at all, I figured it best to send them when as few people as possible are likely to be interrupted/nerdsniped by them.

Comment on lines +6 to +12
# Do a dry-run (debug-only: true) whenever this workflow itself is changed.
pull_request:
paths:
- .github/workflows/manage-stale-issues-and-prs.yml
types:
- opened
- synchronize
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because we also run this workflow on pull requests – but only pull requests that change the workflow file itself – we can easily test out tweaks to the config.

Comment on lines +24 to +26
close-issue-message: "" # Leave no comment when closing
close-pr-message: "" # Leave no comment when closing
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I feel less strongly about this one as I do about stale-issue-message and stale-pr-message. You could make the case that an email should be sent when the thing is ultimately closed. My preference is for the bot to be silent, but deadly.

Comment on lines +26 to +29
days-before-issue-stale: 7
days-before-pr-stale: 14
days-before-close: 7
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was replicated from the old config at .github/stale.yml.

Copy link
Contributor

Choose a reason for hiding this comment

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

It used to be a year before stale-bot marked issues as stale. Here's one example: #16270 and you can see them all at https://github.com/solana-labs/solana/issues?q=is%3Aissue+is%3Aclosed+label%3Astale+

Maybe a year is too much, but let's start with the old configuration

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, oops. I didn't see this before landing it. I'll update it!

…let's start with the old configuration

But isn't the deleted stale.yml the old configuration? If not, do you know where to find said old configuration?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

and if I'm reading this right, days-before-pr-stale should probably be 7 to match the old config

edit: oops, apparently GH defaults to "you want to do a review, right?" post merge, so this wasn't submitted

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah. I was following the recommendation here, which I gave preference over the olde config.

days-before-issue-stale: 7
days-before-pr-stale: 14
days-before-close: 7
debug-only: ${{ github.event_name == 'pull_request' }} # Dry-run when true.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When running on a PR, the bot logs to the workflow logs without actually taking any actions.

Comment on lines +30 to +33
exempt-issue-labels: blocked,do-not-close,feature-gate,security
exempt-pr-labels: blocked,do-not-close,feature-gate,security
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are copied from the old .github/stale.yml workflow. I added do-not-close as a way to exempt an issue/PR from stalebot's clutches.

# No actual changes get made in debug-only mode, so we can raise the operations ceiling.
operations-per-run: ${{ github.event_name == 'pull_request' && 2000 || 30}}
stale-issue-label: stale
stale-issue-message: "" # Leave no comment when marking as stale
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think becoming stale is a comment-worthy event, nor should it send an email. My position is that stalebot shouldn't be your reminders app; if you think you will need reminding about an open issue, you can set a reminder in a way that makes sense for you.

# Time immemorial when in debug-only mode (ie. on pull requests).
# `STALEBOT_START_DATE` otherwise.
# You can use this as a killswitch by setting `STALEBOT_START_DATE` in the far future.
start-date: ${{ github.event_name == 'pull_request' && '1970-01-01T00:00:00Z' || secrets.STALEBOT_START_DATE }} # ISO 8601 or RFC 2822
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a strategy for introducing this thing gradually. I will set myself a reminder to back this off slowly, so that we don't end up with every notification, all at once.

@steveluscher steveluscher marked this pull request as ready for review December 7, 2022 02:09
@steveluscher steveluscher force-pushed the stalebot-the-return branch 2 times, most recently from f2452c4 to b11156e Compare December 7, 2022 19:15
@steveluscher
Copy link
Contributor Author

This whole effort might be dead in the water if what this person claims is true: actions/stale#792

Seems that the overhead of checking a large number of issues can exhaust your API operations rate limit before you have examined all of the open issues/PRs in a repository of this size.

Maybe we can pay money for a slightly higher rate limit?

@steveluscher steveluscher merged commit 8a0a578 into master Dec 8, 2022
@steveluscher steveluscher deleted the stalebot-the-return branch December 8, 2022 22:17
steveluscher added a commit that referenced this pull request Dec 8, 2022
…stalebot

I got this wrong in #29134. The original config set this at 365 days, not 7.
steveluscher added a commit that referenced this pull request Dec 8, 2022
…stalebot (#29157)

I got this wrong in #29134. The original config set this at 365 days, not 7.
gnapoli23 pushed a commit to gnapoli23/solana that referenced this pull request Dec 16, 2022
gnapoli23 pushed a commit to gnapoli23/solana that referenced this pull request Dec 16, 2022
…stalebot (solana-labs#29157)

I got this wrong in solana-labs#29134. The original config set this at 365 days, not 7.
nickfrosty pushed a commit to nickfrosty/solana that referenced this pull request Jan 4, 2023
nickfrosty pushed a commit to nickfrosty/solana that referenced this pull request Jan 4, 2023
…stalebot (solana-labs#29157)

I got this wrong in solana-labs#29134. The original config set this at 365 days, not 7.
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.

Re-enable some sort of stalebot, to close stale PRs, if not also stale issues
2 participants