Skip to content

Commit 787f8db

Browse files
committed
API MergeRequest.get_commits, Project.get_comments
Add new API actions for retrieving commits belonging to a merge request and commit comments.
1 parent 910bc60 commit 787f8db

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

gitlab3/_api_definition.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ class GetBlobAction(ExtraActionDefinition):
169169
required_params = [
170170
'filepath',
171171
]
172+
class GetCommentsAction(ExtraActionDefinition):
173+
"""gl.Project.get_comments"""
174+
url = '/repository/commits/:sha_or_ref_name/comments'
175+
method = _HTTP_GET
172176
class ProtectBranchAction(ExtraActionDefinition):
173177
"""gl.Project.protect_branch()"""
174178
url = '/repository/branches/:branch/protect'
@@ -214,6 +218,7 @@ class DeactivateGitlabCIAction(ExtraActionDefinition):
214218
ForkFromAction,
215219
DeleteForkAction,
216220
GetBlobAction,
221+
GetCommentsAction,
217222
ProtectBranchAction,
218223
UnprotectBranchAction,
219224
SetGitlabCIAction,
@@ -332,8 +337,12 @@ class PostCommentAction(ExtraActionDefinition):
332337
required_args = [
333338
'note',
334339
]
340+
class GetCommitsAction(ExtraActionDefinition):
341+
"""gl.Project.MergeRequest.get_commits()"""
342+
url = '/commits'
343+
method = _HTTP_GET
335344

336-
extra_actions = [ PostCommentAction ]
345+
extra_actions = [ PostCommentAction, GetCommitsAction ]
337346
sub_apis = [ Note ]
338347

339348
class Milestone(APIDefinition):

0 commit comments

Comments
 (0)