GitLab Learning Scripts API

class gitlab_course.GLCMergeRequest(author: str, title: str, state: str, draft: bool, approved: list[str] = <factory>)
approved: list[str]

list of approver user names

author: str

the user name of the author of the merge request

draft: bool

whether the merge request has been approved

classmethod from_gl(mr)

instantiate object from data structure returned by gitlab module

state: str

the state of the merge request

title: str

the title of the merge request

class gitlab_course.GLCUser(sysID: str, glID: str = '', _ID: int = -1, name: str = '', status: str = '', hasKeys: bool = False)
classmethod from_gl(user, glu=None)

instantiate object from data structure returned by gitlab module

glID: str = ''

the user name in gitlab (might be different from sysID)

hasKeys: bool = False

whether the user has any keys

name: str = ''

the name of the user

status: str = ''

the status of the user

sysID: str

the user name on the system

class gitlab_course.GitlabCourse(gitlab_id=None)

class used for managing a course in gitlab

Parameters:

gitlab_id (optional, str) – the ID of the gitlab instance configured

getMergeRequests(project)

iterator over the merge request of a project

Parameters:

project (gitlab project object) – the project for which to obtain merge requests

Returns:

iterator over merge requests

Return type:

iterator(GLCMergeRequest)

getUser(name, raw=False)

get a a gitlab user

Parameters:
  • name (str) – the user name of the gitlab user

  • raw (optional, bool) – when set to True return gitlab user object. Default: False.

Returns:

the user

Return type:

GLCUser

getUserList(users, raw=False)

get a list of users

Parameters:
  • users (list(str)) – list of user names

  • raw (optional, bool) – when set to True return gitlab user object. Default: False.

Returns:

list of users

Return type:

list(GLCUser)

get_group(group_name, parent_group=None, create=False)

get a gitlab group

Parameters:
  • group_name (str) – the name of the group

  • parent_group (optional, str) – the name of the parent group

  • create (optional, bool) – when set to True, create the group if it does not exist. Default: False

Returns:

gitlab group object

property gl

the gitlab handle