diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2018-07-15 18:08:32 +0200 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2018-07-15 18:08:32 +0200 |
commit | 32ae92469f13fe2cbeb87361a4608dd5d95b3a70 (patch) | |
tree | fd62daf7e09d3b9733b1fdd223ad343afa257650 | |
parent | 0379efaa641d22ccdb530214c56ec72891f73c4a (diff) | |
download | gitlab-32ae92469f13fe2cbeb87361a4608dd5d95b3a70.tar.gz |
Implement MR.pipelines()
Closes #555
-rw-r--r-- | docs/gl_objects/mrs.rst | 8 | ||||
-rw-r--r-- | gitlab/v4/objects.py | 18 |
2 files changed, 26 insertions, 0 deletions
diff --git a/docs/gl_objects/mrs.rst b/docs/gl_objects/mrs.rst index 02b2e02..7fdf4d8 100644 --- a/docs/gl_objects/mrs.rst +++ b/docs/gl_objects/mrs.rst @@ -116,6 +116,14 @@ List commits of a MR:: commits = mr.commits() +List the changes of a MR:: + + changes = mr.changes() + +List the pipelines for a MR:: + + pipelines = mr.pipelines() + List issues that will close on merge:: mr.closes_issues() diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index 7f50440..71dd90c 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -2157,6 +2157,24 @@ class ProjectMergeRequest(SubscribableMixin, TodoMixin, TimeTrackingMixin, path = '%s/%s/changes' % (self.manager.path, self.get_id()) return self.manager.gitlab.http_get(path, **kwargs) + @cli.register_custom_action('ProjectMergeRequest') + @exc.on_http_error(exc.GitlabListError) + def pipelines(self, **kwargs): + """List the merge request pipelines. + + Args: + **kwargs: Extra options to send to the server (e.g. sudo) + + Raises: + GitlabAuthenticationError: If authentication is not correct + GitlabListError: If the list could not be retrieved + + Returns: + RESTObjectList: List of changes + """ + path = '%s/%s/pipelines' % (self.manager.path, self.get_id()) + return self.manager.gitlab.http_get(path, **kwargs) + @cli.register_custom_action('ProjectMergeRequest', tuple(), ('merge_commit_message', 'should_remove_source_branch', |