@@ -638,7 +638,6 @@ class ProjectBranch(GitlabObject):
638
638
canUpdate = False
639
639
requiredUrlAttrs = ['project_id' ]
640
640
requiredCreateAttrs = ['branch_name' , 'ref' ]
641
- _constructorTypes = {'commit' : 'ProjectCommit' }
642
641
643
642
def protect (self , protect = True , ** kwargs ):
644
643
url = self ._url % {'project_id' : self .project_id }
@@ -832,8 +831,23 @@ class ProjectNoteManager(BaseManager):
832
831
obj_cls = ProjectNote
833
832
834
833
834
+ class ProjectTagRelease (GitlabObject ):
835
+ _url = '/projects/%(project_id)s/repository/tags/%(tag_name)/release'
836
+ canDelete = False
837
+ canList = False
838
+ requiredUrlAttrs = ['project_id' , 'tag_name' ]
839
+ requiredCreateAttrs = ['description' ]
840
+ shortPrintAttr = 'description'
841
+
842
+
843
+ class ProjectTagReleaseManager (BaseManager ):
844
+ obj_cls = ProjectTagRelease
845
+
846
+
835
847
class ProjectTag (GitlabObject ):
836
848
_url = '/projects/%(project_id)s/repository/tags'
849
+ _constructorTypes = {'release' : 'ProjectTagRelease' ,
850
+ 'commit' : 'ProjectCommit' }
837
851
idAttr = 'name'
838
852
canGet = 'from_list'
839
853
canUpdate = False
@@ -842,6 +856,17 @@ class ProjectTag(GitlabObject):
842
856
optionalCreateAttrs = ['message' ]
843
857
shortPrintAttr = 'name'
844
858
859
+ def set_release_description (self , description ):
860
+ url = '/projects/%s/repository/tags/%s/release' % (self .project_id ,
861
+ self .name )
862
+ if self .release is None :
863
+ r = self .gitlab ._raw_post (url , data = {'description' : description })
864
+ raise_error_from_response (r , GitlabCreateError , 201 )
865
+ else :
866
+ r = self .gitlab ._raw_put (url , data = {'description' : description })
867
+ raise_error_from_response (r , GitlabUpdateError , 200 )
868
+ self .release = ProjectTagRelease (self , r .json ())
869
+
845
870
846
871
class ProjectTagManager (BaseManager ):
847
872
obj_cls = ProjectTag
0 commit comments