Skip to content

Add option to send failed pipeline notification to notify-mr script

Reuben Pereira requested to merge rp/add-failed-notification into master

What

Add an option to the notify-mr script to post a "pipeline failed" notification to the MR.

Example notification: gitlab-com!2875 (comment 1476584861).

This is what the notification looks like: image

To test the notify-mr script locally, you can run the following. Replace the GITLAB_API_TOKEN with your gitlab.com token that has write permissions.

GITLAB_API_TOKEN=<token> CI_SERVER_URL='ops.gitlab.net' CI_COMMIT_SHA='b1ee8bb0e40f16134e3b7fd5a8f1b77a52cd6804' CI_COMMIT_SHORT_SHA='b1ee8bb0' CI_PROJECT_URL='https://ops.gitlab.net/gitlab-com/gl-infra/k8s-workloads/gitlab-com' CI_COMMIT_REF_NAME='rp/respect-changelocks' CI_PIPELINE_URL='https://ops.gitlab.net/gitlab-com/gl-infra/k8s-workloads/gitlab-com/-/pipelines/2128796' CI_PROJECT_PATH='gitlab-com/gl-infra/k8s-workloads/gitlab-com' ./bin/notify-mr -f 2882

gitlab-com/gl-infra/delivery#19466 (closed)

Why

Edited by Reuben Pereira

Merge request reports