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

Cannot update Slack Integration's webhook #1188

Closed
@iTaybb

Description

@iTaybb

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp