Add automatic release of inactive claimed assignments#2430
Conversation
| use tracing as log; | ||
|
|
||
| mod assign; | ||
| pub(crate) mod assign; |
There was a problem hiding this comment.
Jobs are not handlers, and even though I know that there are some jobs inside the handlers module currently, I don't find that very readable. What do you think about having a separate module (directory) for jobs?
There was a problem hiding this comment.
What do you think about having a separate module (directory) for jobs?
Conceptually I like the idea, but when the handler and the job is so tightly integrated into each other I think it's better to have them close to each other.
| Err(e) => return Err(e.into()), | ||
| } | ||
|
|
||
| if let Some(activity_config) = &config.check_activity { |
There was a problem hiding this comment.
If it's implemented like this, it won't help clippy much, because they will still have 100+ legacy assigned issues for which the check won't trigger.
With this implementation, the number of jobs will scale with the number of claimed issues, which means that over time we might have hundreds or thousands of jobs in the repo, and I don't think that's really necessary.
I would prefer a different system, where we have a single job per repo (which has the config activated), which runs e.g. once per day, and checks all claimed issues. I guess that the problem is that triagebot is probably not really architectured to have such jobs at the moment 🤔
There was a problem hiding this comment.
I though of doing a once per day job, but that has several issues:
- clippy currently has 2500 issues, just getting all the issues and assignees for them is probably going to cost us our 5000 req/h ratelimit, that not even counting getting the PRs, the pulls links, ...
- it also wouldn't scale for rust-lang/rust which I think we also want to handle, and it has >10 000 issues
- we only want to handle assignee's via
claim/assigncommands, not manual assignment, which would be difficult (impossible?) to support
So for those reason I think having small targeted jobs is better than cron-like job.
they will still have 100+ legacy assigned issues for which the check won't trigger
Yeah, that's unfortunate. I think someone is gonna have to go through all of them and unassigned them manually (with a copy/paste text should be "quick").
There was a problem hiding this comment.
Most of those issues are unassigned (https://github.com/rust-lang/rust-clippy/issues?q=is%3Aissue%20state%3Aopen%20no%3Aassignee), so maybe we could fetch only the assigned ones? https://docs.github.com/en/graphql/reference/issues#input-object-issuefilters
Or maybe better, simply record claimed issues in the DB, which makes the whole thing much simpler, and solves the issue 2. (which is annoying to deal with using GH API only, we'd have to check IssueData on each issue to see if it was claimed).
This comment has been minimized.
This comment has been minimized.
f519407 to
23b6994
Compare
This comment was marked as off-topic.
This comment was marked as off-topic.
|
I re-rewrote the whole logic as daily cron-job that checks all the opened issues. I haven't tested it, and it's a little rough on the edges. Unsure if it's simpler, I will let you be the judge of it. ;-) |
This PR adds a system to automatically release inactive claimed (
claimandassign <username>commands) assignments.The logic is loosely inspired by Zulip's bot. We check after
inactivity_reminderdays the last update on the issue and linked PRs (via the cross-references), we post the reminder message and if nothing movesinactivity_limit - inactivity_reminderdays later we remove the assignment and post a comment.It's configured like this:
Output for the reminder:
Output for the release assignment:
Context: #triagebot > Releasing lingering assignments
cc @samueltardieu