gitlab: don't reassign MR if assigned to author
This commit is contained in:
parent
0b332f79c9
commit
2761e2315e
|
@ -142,6 +142,10 @@ class GitlabBot(object):
|
||||||
if request_state.needs_reviewer and merge_request.assignee.username in review_candidates:
|
if request_state.needs_reviewer and merge_request.assignee.username in review_candidates:
|
||||||
log.debug("unsetting the needs_reviewer flag, the request is already assigned to one")
|
log.debug("unsetting the needs_reviewer flag, the request is already assigned to one")
|
||||||
request_state.needs_reviewer = False
|
request_state.needs_reviewer = False
|
||||||
|
elif request_state.needs_reviewer and merge_request.assignee.username == merge_request.author.username:
|
||||||
|
log.info("unsetting the needs_reviewer flag, the request is assigned to the author")
|
||||||
|
log.info("in this case we are assuming that the author has work to do, and will re/unassign")
|
||||||
|
request_state.needs_reviewer = False
|
||||||
|
|
||||||
excluded_accept_candidates = [merge_request.author.username]
|
excluded_accept_candidates = [merge_request.author.username]
|
||||||
accept_candidates = [x for x in project.code_review_final_merge_assignees.split(',') if x not in excluded_accept_candidates]
|
accept_candidates = [x for x in project.code_review_final_merge_assignees.split(',') if x not in excluded_accept_candidates]
|
||||||
|
@ -149,6 +153,10 @@ class GitlabBot(object):
|
||||||
if request_state.needs_accepter and merge_request.assignee.username in accept_candidates:
|
if request_state.needs_accepter and merge_request.assignee.username in accept_candidates:
|
||||||
log.debug("unsetting the needs_accepter flag, the request is already assigned to one")
|
log.debug("unsetting the needs_accepter flag, the request is already assigned to one")
|
||||||
request_state.needs_accepter = False
|
request_state.needs_accepter = False
|
||||||
|
elif request_state.needs_accepter and merge_request.assignee.username == merge_request.author.username:
|
||||||
|
log.info("unsetting the needs_accepter flag, the request is assigned to the author")
|
||||||
|
log.info("in this case we are assuming that the author has work to do, and will re/unassign")
|
||||||
|
request_state.needs_accepter = False
|
||||||
|
|
||||||
log.debug("%s", request_state.__dict__)
|
log.debug("%s", request_state.__dict__)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue