gitlab bot: add a class to track review scanning

the code to scan all merge request notes for reviews is getting messy,
going to try moving most of the state into a class. still unsure this is
final
This commit is contained in:
Brian S. Stephan 2016-06-24 14:32:59 -05:00
parent 1a428e7d29
commit fca69b1994
1 changed files with 14 additions and 0 deletions

View File

@ -161,3 +161,17 @@ class GitlabBot(object):
self.client.update(merge_request, assignee_id=new_approver_obj.id)
else:
log.warning("no approvers left to approve %s, doing nothing", merge_request.title)
class _MergeRequestScanningState(object):
"""Track the state of a merge request as it is scanned and appropriate action identified."""
def __init__(self):
"""Set default flags/values."""
self.approver_list = []
self.unlogged_approval_reset = False
self.unlogged_approval = False
self.needs_reviewer = False
self.needs_accepter = False