Skip to content

Improve pipeline triggers API

What does this MR do?

This introduces /api/v4/projects/:id/trigger/pipeline that replaces /api/v3/projects/:id/trigger/builds.

Previous build trigger was user-less, the new pipeline trigger is user-aware. This MR introduces backend changes to make it user aware. The new create token with API will have a user assigned.

This MR also introduces trigger description and slightly improves API:

  1. POST /api/v4/projects/:id/triggers - creates a trigger with permission of current user and requires description,
  2. PUT /api/v4/projects/:id/triggers/:trigger_id - updates a trigger description,
  3. POST /api/v4/projects/:id/triggers/:trigger_id/take - takes ownership of trigger,
  4. POST /api/v4/projects/:id(/ref/:ref)/trigger/pipeline - returns Entities::Pipeline instead of Entities::TriggerRequest

This also contains a part of changes that are introduced in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9277. And it's there to solve this story: https://gitlab.com/gitlab-org/gitlab-ce/issues/27156.

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Merge request reports