Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit324f81b

Browse files
author
Gauvain Pocentek
committed
MR: add support for time tracking features
Fixes#248
1 parent391417c commit324f81b

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

‎gitlab/objects.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1850,6 +1850,58 @@ def time_stats(self, **kwargs):
18501850
raise_error_from_response(r,GitlabGetError)
18511851
returnr.json()
18521852

1853+
deftime_estimate(self,**kwargs):
1854+
"""Set an estimated time of work for the merge request.
1855+
1856+
Raises:
1857+
GitlabConnectionError: If the server cannot be reached.
1858+
"""
1859+
url= ('/projects/%(project_id)s/merge_requests/%(mr_id)s/'
1860+
'time_estimate'%
1861+
{'project_id':self.project_id,'mr_id':self.id})
1862+
r=self.gitlab._raw_post(url,**kwargs)
1863+
raise_error_from_response(r,GitlabTimeTrackingError,201)
1864+
returnr.json()
1865+
1866+
defreset_time_estimate(self,**kwargs):
1867+
"""Resets estimated time for the merge request to 0 seconds.
1868+
1869+
Raises:
1870+
GitlabConnectionError: If the server cannot be reached.
1871+
"""
1872+
url= ('/projects/%(project_id)s/merge_requests/%(mr_id)s/'
1873+
'reset_time_estimate'%
1874+
{'project_id':self.project_id,'mr_id':self.id})
1875+
r=self.gitlab._raw_post(url,**kwargs)
1876+
raise_error_from_response(r,GitlabTimeTrackingError,200)
1877+
returnr.json()
1878+
1879+
defadd_spent_time(self,**kwargs):
1880+
"""Set an estimated time of work for the merge request.
1881+
1882+
Raises:
1883+
GitlabConnectionError: If the server cannot be reached.
1884+
"""
1885+
url= ('/projects/%(project_id)s/merge_requests/%(mr_id)s/'
1886+
'add_spent_time'%
1887+
{'project_id':self.project_id,'mr_id':self.id})
1888+
r=self.gitlab._raw_post(url,**kwargs)
1889+
raise_error_from_response(r,GitlabTimeTrackingError,200)
1890+
returnr.json()
1891+
1892+
defreset_spent_time(self,**kwargs):
1893+
"""Set an estimated time of work for the merge request.
1894+
1895+
Raises:
1896+
GitlabConnectionError: If the server cannot be reached.
1897+
"""
1898+
url= ('/projects/%(project_id)s/merge_requests/%(mr_id)s/'
1899+
'reset_spent_time'%
1900+
{'project_id':self.project_id,'mr_id':self.id})
1901+
r=self.gitlab._raw_post(url,**kwargs)
1902+
raise_error_from_response(r,GitlabTimeTrackingError,200)
1903+
returnr.json()
1904+
18531905

18541906
classProjectMergeRequestManager(BaseManager):
18551907
obj_cls=ProjectMergeRequest

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp