Skip to content

Trigger mergeRequestMergeStatusUpdated when pipeline state changes

Patrick Bajao requested to merge 372524-trigger-merge-status-pipeline into master

What does this MR do and why?

When Pipelines must succeed setting is enabled, pipeline state affects the mergeability of the MR.

In order for the frontend to show updated status of merge widget in real-time when pipeline state changes, we need to trigger the mergeRequestMergeStatusUpdated GraphQL subscription for the following state transitions:

  • running
  • success
  • failed
  • canceled
  • skipped

This is behind the pipeline_trigger_merge_status feature flag.

Screenshots

Success

success

Running

running

Failed, Canceled or Skipped (when not considered as successful)

failed-canceled-skipped

How to set up and validate locally

  1. Enable pipeline_trigger_merge_status and realtime_mr_status_change (this is so frontend can update in real-time) feature flags.
  2. Create a project with pipeline that runs on MRs.
  3. Enable Pipelines must succeed under Settings > Merge requests.
  4. Create a MR.
  5. On a separate window or terminal, push some changes to the MR's branch.
  6. See the merge widget update its state in real-time depending on the status of the pipeline.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #372524 (closed)

Edited by Patrick Bajao

Merge request reports