Disable Issue assignment by age of the issue.
* BOT has a logic to pick all old issues > 30 days and try to assign it to other user if it is not closed yet. But it assigns to same user on every run. While this issue is investigated and getting resolved, this feature is temporarily disabled. Change-Id: I50ea2af35320ef1decbf84ae8760d5508e31f793
This commit is contained in:
parent
51135cfb59
commit
7abd3b56cd
@ -100,18 +100,20 @@ def try_assign(issue: github.Issue):
|
||||
issue.create_comment(f'assigned {assignment_request.user.login}')
|
||||
return
|
||||
|
||||
if issue_age(issue) > 30:
|
||||
# If the issue is 1 months old and the original assignees haven't
|
||||
# closed it yet, let's assume that they've stopped working on it and
|
||||
# allow the new user to have this issue
|
||||
old_assignees = issue.assignees
|
||||
for assignee in old_assignees:
|
||||
issue.remove_from_assignees(assignee)
|
||||
issue.add_to_assignees(assignment_request.user)
|
||||
comment_body = f'unassigned: {", ".join([str(a) for a in old_assignees])}\n' + \
|
||||
f'assigned: {assignment_request.user.login}'
|
||||
issue.create_comment(comment_body)
|
||||
return
|
||||
# Disable this logic due to an issue. Will re-visit this logic
|
||||
# and will be re-enabled after testing
|
||||
#if issue_age(issue) > 30:
|
||||
# # If the issue is 1 months old and the original assignees haven't
|
||||
# # closed it yet, let's assume that they've stopped working on it and
|
||||
# # allow the new user to have this issue
|
||||
# old_assignees = issue.assignees
|
||||
# for assignee in old_assignees:
|
||||
# issue.remove_from_assignees(assignee)
|
||||
# issue.add_to_assignees(assignment_request.user)
|
||||
# comment_body = f'unassigned: {", ".join([str(a) for a in old_assignees])}\n' + \
|
||||
# f'assigned: {assignment_request.user.login}'
|
||||
# issue.create_comment(comment_body)
|
||||
# return
|
||||
|
||||
# If we've made it here, a user has requested to be assigned to a non-stale
|
||||
# issue which is already assigned. Just notify the core team and let them
|
||||
|
Loading…
x
Reference in New Issue
Block a user