-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[ci] add bot to lock inactive issues and PRs #6037
Conversation
on: | ||
schedule: | ||
# midnight UTC, every Wednesday | ||
- cron: '0 0 * * 3' |
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.
Running once a week should be plenty. I want to be respectful of GitHub's resources, and minimize the impact on our GitHub Actions quota for this specific repo.
github-token: ${{ github.token }} | ||
# after how many days of inactivity should a closed issue/PR be locked? | ||
issue-inactive-days: '90' | ||
pr-inactive-days: '90' |
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.
Note that we use to close issues after only 60 days of inactivity: #4251.
I think 90 is a good balance of allowing for recent discussions to be revived while also encouraging the creation of new discussions.
Please also note that this about locking 90 days AFTER an issue/PR is closed, and that we have a separate bot that automatically closes issues after 30 days waiting for a response:
daysUntilClose: 30 |
remove-issue-labels: 'awaiting response,awaiting review,blocking,in progress' | ||
remove-pr-labels: 'awaiting response,awaiting review,blocking,in progress' |
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.
Not sure if this will work with labels with spaces in the names... but I think the only way to test iis to merge to master
.
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 think it'll work. I just ran this (GH CLI):
gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/microsoft/LightGBM/issues/6033
and this is the labels section
"labels": [
{
"id": 466962712,
"node_id": "MDU6TGFiZWw0NjY5NjI3MTI=",
"url": "https://api.github.com/repos/microsoft/LightGBM/labels/feature%20request",
"name": "feature request",
"color": "1d76db",
"default": false,
"description": ""
}
],
and it seems that this action takes the name of the label:
https://github.com/dessant/lock-threads/blob/be8aa5be94131386884a6da4189effda9b14aa21/src/index.js#L93
But yeah, we'll have to see it in action haha.
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.
oh cool idea to use the GitHub CLI! I'd never used that before.
Surprisingly this should fail due to the bug of quantized training... It's my bad.
Link #5982. |
Thanks for linking that issue and pasting the logs here! I agree, it looks like that issue. No problem, it doesn't need to block this PR... I just retriggered the job, hopefully it will pass on a second run. We should try to fix that, but as long as it usually succeeds and a retry gets past the occasional failure, it isn't high-urgency. |
remove-issue-labels: 'awaiting response,awaiting review,blocking,in progress' | ||
remove-pr-labels: 'awaiting response,awaiting review,blocking,in progress' |
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 think it'll work. I just ran this (GH CLI):
gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/microsoft/LightGBM/issues/6033
and this is the labels section
"labels": [
{
"id": 466962712,
"node_id": "MDU6TGFiZWw0NjY5NjI3MTI=",
"url": "https://api.github.com/repos/microsoft/LightGBM/labels/feature%20request",
"name": "feature request",
"color": "1d76db",
"default": false,
"description": ""
}
],
and it seems that this action takes the name of the label:
https://github.com/dessant/lock-threads/blob/be8aa5be94131386884a6da4189effda9b14aa21/src/index.js#L93
But yeah, we'll have to see it in action haha.
I just triggered a run right now with https://github.com/microsoft/LightGBM/actions/runs/5871302631 |
It somewhat worked. I saw about 100 things get locked, and the comment posted looks correct. And the bot did remove labels correctly! For example, #5800 had problem 1: it only locked some things I'd expected it to be a lot more. There have been more than 100 issues closed + PRs merged in the last 2 years here! I see a mix of PRs (e.g. #5665) and issues (e.g. #5574), so it's not like it's "just locked PRs" or "just locked issues". I just triggered a new run, to see if maybe there's some limit in the number of issues/PRs it'll touch per run (to avoid hitting GitHub API limits, maybe?). problem 2: it locked some issues with Like this one: #3200. |
Ok yes! Triggered https://github.com/microsoft/LightGBM/actions/runs/5871480057/job/15920921845 and it locked around another 100 issues. So I guess there must be a per-run limit in that job. I'll stop manually triggering runs for now, so we can maybe use future runs to test fixes for the problems I stated above |
This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this. |
Proposes adding a bot that runs once a week and does the following for any closed issues and PRs that have not had any new activity in the previous 90 days, and which don't have the
feature request
label...awaiting response
awaiting review
blocking
in progress
Benefit of this change
Keeps focus on active conversations and PRs, that everyone looking at the repo can see.
Prevents the situation where people ask questions by commenting on old, closed discussions like this: #4803 (comment). In those situations, only people who were already subscribed to that particular conversation are notified.
Notes for Reviewers
We used to run a bot for this purpose in LightGBM, but it was turned off over 2 years ago, in #4251.
At the time, I recommended that we might switch from https://github.com/dessant/lock-threads-app (archived in 2021) to https://github.com/dessant/lock-threads (active): #4251 (comment)
But then we just never did that... I got busy with other things and forgot 😅
This PR proposes finally doing that. https://github.com/dessant/lock-threads is actively maintained (most recent rerlease in June 2023), and importantly doesn't require any new permissions changes in the repo, since it is able to run as a GitHub Actions workflow.
See https://github.com/dessant/lock-threads/blob/main/README.md#available-input-parameters for documentation on this configuration.