Brian S. Stephan e846502b48 gitlab bot: start refactoring code review methods
the code review logic to this point is kind of convoluted, and still is
for the moment, but this moves some of the stuff into a more coherent
spot in the expectation of reuse. most of the refactoring is still to
come
2016-06-24 13:50:09 -05:00

21 lines
579 B
Python

"""Find merge requests that need code reviewers."""
import logging
from django.core.management import BaseCommand
from gitlab_bot.lib import GitlabBot
from gitlab_bot.models import GitlabProjectConfig
log = logging.getLogger(__name__)
class Command(BaseCommand):
help = "Find merge requests needing code reviewers/assignees"
def handle(self, *args, **options):
bot = GitlabBot()
projects = GitlabProjectConfig.objects.filter(manage_merge_request_code_reviews=True)
for project in projects:
bot.scan_project_for_reviews(project)