- Notifications
You must be signed in to change notification settings - Fork673
Closed
Description
Description of the problem, including code/CLI snippet
Changing a a slack service integration wehbook is not possible throughslacksvc.properties['webhook']
, andslacksvc.webhook
is not available.
gl = gitlab.Gitlab('https://gitlab.******', private_token=os.environ['GITLAB_API_TOKEN'])svc = gl.projects.get('test').services.get('slack')slacksvc.properties['webhook'] = 'https://**************'slacksvc.save()
Expected Behavior
Success
Actual Behavior
send: b'PUT /api/v4/projects/33/services/slack HTTP/1.1\r\nHost: gitlab.****************\r\nUser-Agent: python-gitlab/2.5.0\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\nPRIVATE-TOKEN: P**************f\r\nContent-type: application/json\r\nContent-Length: 32\r\n\r\n'send: b'{"id": "slack"}'reply: 'HTTP/1.1 400 Bad Request\r\n'header: Server: nginxheader: Date: Sun, 13 Sep 2020 13:02:56 GMTheader: Content-Type: application/jsonheader: Content-Length: 30header: Connection: keep-aliveheader: Cache-Control: no-cacheheader: Vary: Originheader: X-Content-Type-Options: nosniffheader: X-Frame-Options: SAMEORIGINheader: X-Request-Id: **********header: X-Runtime: 0.017246DEBUG:urllib3.connectionpool:http://gitlab.**************:80 "PUT /api/v4/projects/33/services/slack HTTP/1.1" 400 30*** gitlab.exceptions.GitlabUpdateError: 400: webhook is missing
Workaround
Direct PUT request seems to be working fine:
gl = gitlab.Gitlab('https://gitlab.******', private_token=os.environ['GITLAB_API_TOKEN']) data = {'webhook': 'http://***************'} gl.http_put('/projects/{0}/services/slack'.format(gl.projects.get('test').id), post_data=data)
Specifications
- python-gitlab version: 2.5.0
- API version you are using (v3/v4): v4
- Gitlab server version (or gitlab.com): 13.3.2
Metadata
Metadata
Assignees
Labels
No labels