diff --git a/dr_botzo/gitlab_bot/lib.py b/dr_botzo/gitlab_bot/lib.py index d4caf40..edecdea 100644 --- a/dr_botzo/gitlab_bot/lib.py +++ b/dr_botzo/gitlab_bot/lib.py @@ -142,6 +142,10 @@ class GitlabBot(object): 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") 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] 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: log.debug("unsetting the needs_accepter flag, the request is already assigned to one") 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__)