-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Conversation
Signed-off-by: GitHub <[email protected]>
Signed-off-by: GitHub <[email protected]>
Signed-off-by: GitHub <[email protected]>
.github/workflows/stale_labeler.yaml
Outdated
- 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." |
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.
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.
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.
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 |
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.
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?
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.
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]>
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.
I reworded it a bit to be more focused on the user rather than the process.
.github/workflows/stale_labeler.yaml
Outdated
- 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." |
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.
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. |
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.
That's much better 👍
Co-authored-by: Tully Foote <[email protected]>
I think this should work as it is. This PR does the following:
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.