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 action to label inactive PRs as stale #37915

Merged
merged 5 commits into from
Jul 13, 2023
Merged

Conversation

audrow
Copy link
Contributor

@audrow audrow commented Jul 11, 2023

I think this should work as it is. This PR does the following:

  • Runs a bot everyday in the early morning, US time, to label PRs that have been inactive for 14 days as stale
  • When a PR is stale the PR gets a "stale" label with a comment
  • Doesn't label issues as "stale"
  • Doesn't close issues or PRs that have the "stale" label
  • Ignores PRs with the label "don't mark as stale"

Feel free to help me workshop the comment that users will see when their PR is stale.

I also created the "stale" and "don't mark as stale" labels.

- uses: actions/stale@v8 # https://github.com/marketplace/actions/close-stale-issues
with:
stale-pr-label: 'stale'
stale-pr-message: "This PR is being marked as stale because there hasn't been activity in 14 days. It may be closed by a rosdistro maintainer. If this label isn't appropriate, you can remove the label and add the \"don't mark as stale\" label. You can find our community contributing guidelines here: https://github.com/ros/rosdistro/blob/master/CONTRIBUTING.md."
Copy link
Contributor

Choose a reason for hiding this comment

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

One thing about this message is that users will typically not have the permissions to manipulate labels on rosdistro PRs. So that wording should be modified to "ask a maintainer to label it". Also, I'd prefer if the label were a bit shorter, and didn't have a negation in it; I like @tylerjw's suggestion of "persistent", but I'm open to other suggestions as well.

Copy link
Contributor Author

@audrow audrow Jul 11, 2023

Choose a reason for hiding this comment

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

Done in 0e782a8. I also updated the repos label to "persistent" from "don't mark as stale".

with:
stale-pr-label: 'stale'
stale-pr-message: "This PR is being marked as stale because there hasn't been activity in 14 days. It may be closed by a rosdistro maintainer. If this label isn't appropriate, you can remove the label and add the \"don't mark as stale\" label. You can find our community contributing guidelines here: https://github.com/ros/rosdistro/blob/master/CONTRIBUTING.md."
days-before-pr-stale: 14
Copy link
Contributor

Choose a reason for hiding this comment

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

The other concern I have is what was brought up in the meeting; i.e. that this won't add a new comment every two weeks. Can you verify whether that is the case or not?

Copy link
Contributor Author

@audrow audrow Jul 11, 2023

Choose a reason for hiding this comment

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

The docs say this, which doesn't fully answer the question:

If an update/comment occur on stale issues or pull requests, the stale label will be removed and the timer will restart

I've been looking at the code and it seems that its stateful enough to not comment again on a PR that has already been commented on and labeled as stale. For example, in the code below it filters out bots commenting on PRs, so it doesn't consider them, so it won't count its own comment as another comment and thus take the stale label off.
https://github.com/actions/stale/blob/465330b7e2524a0d9b3430795c7970658106bf5c/src/classes/issues-processor.ts#L798-L802

It's a surprisingly big codebase, but from poking around I feel pretty confident that it won't comment multiple times on a stale issue.

Signed-off-by: GitHub <[email protected]>
@audrow audrow requested a review from clalancette July 11, 2023 18:58
Copy link
Member

@tfoote tfoote left a comment

Choose a reason for hiding this comment

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

I reworded it a bit to be more focused on the user rather than the process.

- uses: actions/stale@v8 # https://github.com/marketplace/actions/close-stale-issues
with:
stale-pr-label: 'stale'
stale-pr-message: "This PR is being marked as stale because there hasn't been activity in 14 days. It may be closed by a rosdistro maintainer. If this label isn't appropriate, you can ask a maintainer to remove the label and add the 'persistent' label. You can find our community contributing guidelines here: https://github.com/ros/rosdistro/blob/master/CONTRIBUTING.md."
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
stale-pr-message: "This PR is being marked as stale because there hasn't been activity in 14 days. It may be closed by a rosdistro maintainer. If this label isn't appropriate, you can ask a maintainer to remove the label and add the 'persistent' label. You can find our community contributing guidelines here: https://github.com/ros/rosdistro/blob/master/CONTRIBUTING.md."
stale-pr-message: "This PR hasn't been activity in 14 days. If you are still are interested in getting it merged please provide an update. Otherwise it will likely be closed by a rosdistro maintainer following our [contributing policy](https://github.com/ros/rosdistro/blob/master/CONTRIBUTING.md). It's been labeled "stale" for visibility to the maintainers. If this label isn't appropriate, you can ask a maintainer to remove the label and add the 'persistent' label.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's much better 👍

Co-authored-by: Tully Foote <[email protected]>
@audrow audrow requested a review from tfoote July 11, 2023 21:35
@audrow audrow merged commit e46500d into master Jul 13, 2023
@audrow audrow deleted the audrow/add-stale-labler branch July 13, 2023 20:07
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