Skip to content

Maintain API feature parity for triggering pipelines

Problem to solve

We support curl for triggering pipelines as follows, as described at https://docs.gitlab.com/ee/ci/triggers/README.html#when-used-with-multi-project-pipelines-premium:

curl --request POST --form "token=$CI_JOB_TOKEN" --form ref=master https://gitlab.example.com/api/v4/projects/9/trigger/pipeline

When we introduced https://gitlab.com/gitlab-org/gitlab-ee/issues/11238 which added a new strategy parameter, we didn't add it to the API. This prevents some users of the curl command (some of which are free users, and some of which are automating things outside of GitLab) from performing this basic task using the API.

Intended users

Pipeline authors

Further details

The trigger keyword is a paid feature that provides syntactic sugar for the curl command, but triggering pipelines itself is a free feature.

Proposal

Support the strategy parameter when triggering a pipeline:

curl --request POST --form "token=$CI_JOB_TOKEN" --form ref=master https://gitlab.example.com/api/v4/projects/9/trigger/pipeline?strategy=depend

Permissions and Security

This should follow the same rules and permissions as the trigger keyword.

Documentation

  • Update the API docs to call out how to use the trigger with a free account

Testing

What does success look like, and how can we measure that?

  • Increase in API calls to trigger pipelines by Free accounts

Links / references

Edited by James Heimbuck