gitlab bot: command for reviewing one specific MR
This commit is contained in:
parent
feb3944380
commit
e48b7867fe
@ -0,0 +1,25 @@
|
||||
"""Run the code review process on a specific merge request."""
|
||||
|
||||
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 = "Assign code reviewers/accepters for a specific merge request"
|
||||
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument('project_id', type=int)
|
||||
parser.add_argument('merge_request_id', type=int)
|
||||
|
||||
def handle(self, *args, **options):
|
||||
project = GitlabProjectConfig.objects.get(pk=options['project_id'])
|
||||
merge_request_ids = [options['merge_request_id'], ]
|
||||
|
||||
bot = GitlabBot()
|
||||
bot.scan_project_for_reviews(project, merge_request_ids=merge_request_ids)
|
Loading…
Reference in New Issue
Block a user