This repository has been archived on 2023-07-17. You can view files and clone it, but cannot push or open issues or pull requests.
pushee/gitlab_provider.py

47 lines
990 B
Python
Raw Normal View History

2020-04-03 14:10:37 +02:00
#!/usr/bin/env python3
from ogr.services.gitlab import GitlabService
class Gitlab:
def __init__(self, namespace, repo, token):
self.ogr_service = GitlabService(
2020-06-08 17:39:36 +02:00
token=token, instance_url="https://gitlab.fi.muni.cz"
2020-04-03 14:10:37 +02:00
)
2020-06-08 17:39:36 +02:00
self.ogr_project = self.ogr_service.get_project(repo=repo, namespace=namespace)
2020-04-03 14:10:37 +02:00
def post_mr(
self,
source_branch,
target_branch,
title,
description,
labels,
remove_source_branch,
assignee_ids,
):
self.ogr_project.create_pr(
title=title,
body=description,
target_branch=target_branch,
2020-06-08 17:39:36 +02:00
source_branch=source_branch,
2020-04-03 14:10:37 +02:00
)
def get_mrs_for_branch(self, branch):
# TODO
pass
def merge_mr(self, iid):
# TODO
pass
def set_assignees(self, iid, assignee_ids):
# TODO
pass
def get_comments(self, iid, page=1):
# TODO
pass