@@ -76,13 +76,7 @@ def create_issue(self, repo_id, title, body="", labels=None):
7676 # GitLab expects a comma-separated string for labels
7777 data ["labels" ] = "," .join (labels )
7878
79- response = self .session .post (
80- url ,
81- json = data ,
82- timeout = self .default_timeout ,
83- )
84- response .raise_for_status ()
85- return response .json ()
79+ return self .post (url , json = data )
8680
8781 def update_issue (self , repo_id , issue_id , title = None , body = None , state_event = None , labels = None ):
8882 """Update an existing GitLab issue."""
@@ -99,27 +93,15 @@ def update_issue(self, repo_id, issue_id, title=None, body=None, state_event=Non
9993 # GitLab expects a comma-separated string for labels
10094 data ["labels" ] = "," .join (labels )
10195
102- response = self .session .put (
103- url ,
104- json = data ,
105- timeout = self .default_timeout ,
106- )
107- response .raise_for_status ()
108- return response .json ()
96+ return self .put (url , json = data )
10997
11098 def post_comment (self , repo_id , issue_id , comment_body ):
11199 """Post a comment on an existing GitLab issue."""
112100 project_path = quote (repo_id , safe = "" )
113101 url = f"{ self .api_url } /projects/{ project_path } /issues/{ issue_id } /notes"
114102 data = {"body" : comment_body }
115103
116- response = self .session .post (
117- url ,
118- json = data ,
119- timeout = self .default_timeout ,
120- )
121- response .raise_for_status ()
122- return response .json ()
104+ return self .post (url , json = data )
123105
124106 @staticmethod
125107 def extract_gitlab_project_path (url ):
0 commit comments