-
Notifications
You must be signed in to change notification settings - Fork 2.3k
add actions workflow for closing stale issues #4561
Conversation
See https://github.com/allenai/allennlp/pull/4561/checks?check_run_id=986726261 to see what would be closed. This was a dry run, so nothing was actually closed. |
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.
LGTM! This is great. Seeing how easy it is makes me wonder if it's worth also having something that pings assignees if there has been no activity for some period of time. I imagine there are plenty of issues that have been assigned to me over the years that I have forgotten about.
.github/workflows/issues.yml
Outdated
# branches: | ||
# - master | ||
schedule: | ||
- cron: '5 16-23 * * 1,2,3,4,5' # 5 past the hour, every hour from 16-24 UTC, on Monday - Friday |
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.
Do we need it to run that often? Why not just once per day? I suppose it doesn't matter too much, if it's cheap to run.
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.
Yea, once a day probably makes more sense 👍
That would be pretty easy as well! I'll tack that on to this PR |
|
||
for issue in open_issues: | ||
if ( | ||
issue.milestone is None |
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.
Do we need this check, and the PR check? I'd be fine if it just said "is assigned and last updated more than two weeks ago".
I think Milestone issues don’t get forgotten, even though they tend not to
have activity for a while. And the PR check filters out actual pull
requests, which I guess are also considered issues in the GitHub API.
On Sat, Aug 15, 2020 at 9:53 AM Matt Gardner ***@***.***> wrote:
***@***.**** approved this pull request.
------------------------------
In scripts/ping_issue_assignees.py
<#4561 (comment)>:
> @@ -0,0 +1,28 @@
+from datetime import datetime as dt
+import os
+
+from github import Github
+
+
+def main():
+ g = Github(os.environ["GITHUB_TOKEN"])
+ repo = g.get_repo("allenai/allennlp")
+ open_issues = repo.get_issues(state="open")
+
+ for issue in open_issues:
+ if (
+ issue.milestone is None
Do we need this check, and the PR check? I'd be fine if it just said "is
assigned and last updated more than two weeks ago".
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4561 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACDHPKYXQIQ77HCVQVE4OV3SA24SFANCNFSM4P74DSBQ>
.
--
*Evan "Pete" Walsh* | Senior Research Engineer
|
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.
Very cool!
print("Closing", issue) | ||
issue.create_comment( | ||
"This issue is being closed due to lack of activity. " | ||
"If you think it still needs to be addressed, please comment on this thread 👇" |
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.
Will anyone see it if people add a comment?
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.
Anyone following the repo should still get notified about additional comments on closed issues
closes #4098.
Uses https://github.com/PyGithub/PyGithub