@@ -858,7 +858,8 @@ class ProjectBranchManager(BaseManager):
858
858
class ProjectBuild (GitlabObject ):
859
859
_url = '/projects/%(project_id)s/builds'
860
860
_constructorTypes = {'user' : 'User' ,
861
- 'commit' : 'ProjectCommit' }
861
+ 'commit' : 'ProjectCommit' ,
862
+ 'runner' : 'Runner' }
862
863
requiredUrlAttrs = ['project_id' ]
863
864
canDelete = False
864
865
canUpdate = False
@@ -876,6 +877,18 @@ def retry(self, **kwargs):
876
877
r = self .gitlab ._raw_post (url )
877
878
raise_error_from_response (r , GitlabBuildRetryError , 201 )
878
879
880
+ def keep_artifacts (self , ** kwargs ):
881
+ """Prevent artifacts from being delete when expiration is set.
882
+
883
+ Raises:
884
+ GitlabConnectionError: If the server cannot be reached.
885
+ GitlabCreateError: If the request failed.
886
+ """
887
+ url = ('/projects/%s/builds/%s/artifacts/keep' %
888
+ (self .project_id , self .id ))
889
+ r = self .gitlab ._raw_post (url )
890
+ raise_error_from_response (r , GitlabGetError , 200 )
891
+
879
892
def artifacts (self , ** kwargs ):
880
893
"""Get the build artifacts.
881
894
0 commit comments