8000 Trigger variables ignored with v4 API · Issue #333 · python-gitlab/python-gitlab · GitHub
[go: up one dir, main page]

Skip to content
Trigger variables ignored with v4 API #333
Closed
@jeromerobert

Description

@jeromerobert

Since I switched to v4 API, the variables I pass to triggers are ignored. Here is a sample of code:

from httplib import HTTPConnection
HTTPConnection.debuglevel = 2
my_project.trigger_pipeline('gitlabci', 'XXXXX', {'variables[GITLAB_TEST]': 'ThisIsATest'})

From httplib debug output it's equivalent to:

curl --request POST https://gitlab.com/api/v4/projects/XXXX/trigger/pipeline -H "Content-Type: application/json" -d '{"token": "XXXXX", "ref": "gitlabci", "variables[GITLAB_TEST]": "ThisIsATest"}'

which also ignore variables. Doing the same without JSON does work:

curl --request POST https://gitlab.com/api/v4/projects/XXXX/trigger/pipeline  --form token=XXXXX --form ref=gitlabci --form "variables[GITLAB_TEST]=ThisIsATest"

Would it be possible that Gitlab expect the JSON payload to have an other structure ?

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

      0