Skip to content

Commit f8d1a76

Browse files
authored
Merge pull request #29 from lhelwerd/master
Add in the useful changes from Leon Helwerda
2 parents 910bc60 + 8a46bcc commit f8d1a76

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

gitlab3/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def _convert_dates(self, data):
345345

346346
def _convert_gitlab_date(self, datetime_str):
347347
"""Convert GitLab datetime string to datetime object"""
348-
fmt = '%Y-%m-%dT%H:%M:%S.%f'
348+
fmt = '%Y-%m-%dT%H:%M:%S'
349349
offset = None
350350
if datetime_str.endswith('Z'):
351351
datetime_str = datetime_str[:-1]

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)