Skip to content

Add source and merge_request fields to pipeline event webhook

What does this MR do?

Add source and merge_request fields to pipeline event webhook.

  • source shows why this pipeline is triggered, eg: push, merge_request_event, schedule
  • merge_request contains the merge request info which triggered the pipeline.
    • Only available when the pipeline is triggered by merge request event
    • For brevity, only several fields of merge request are included. Users could use merge request API or follow the merge request url to find more information.

Resolve #63338 (moved).

Use case

Pipeline event webhook is often used to notify developers of the pipeline status/result.

When received the notification, developers want to know why this pipeline is triggered, and who is responsible for the pipeline failure.

When the pipeline is triggered by merge request event:

  • On pipeline failure: Developers want to whether it is my merge request that caused the failure. The webhook already contains ref and user, but they are not very clearly associated with merge request.
  • On pipeline success: Code reviewers want to know which merge request can be reviewed/merged now. And it'll be great to include the merge request url in notification so reviewers can just click to navigate to the merge request.

Currently there isn't any API we can make use to find the merge request of a pipeline, so including the merge request (at least its iid) in webhook is the most simple and straightforward solution.

Does this MR meet the acceptance criteria?

Conformity

Performance and Testing

I'm new to GitLab source code and have no idea where and how to write tests. Please help.

Edited by Mayra Cabrera

Merge request reports