From fca69b1994ca72f5c98eaa591d01b0dcdb0dc0ef Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Fri, 24 Jun 2016 14:32:59 -0500 Subject: [PATCH] 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 --- dr_botzo/gitlab_bot/lib.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dr_botzo/gitlab_bot/lib.py b/dr_botzo/gitlab_bot/lib.py index 5df85f1..15fd9dd 100644 --- a/dr_botzo/gitlab_bot/lib.py +++ b/dr_botzo/gitlab_bot/lib.py @@ -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