Skip to content

Update merge request widget to accommodate post-merge pipelines

What does this MR do?

Updates the merge request widget to handle the four new cases mentioned in the Merge request widget section here: https://gitlab.com/gitlab-org/gitlab-ee/issues/7380#merge-request-widget. The relevant UI mockups from this issue have been copied below for convenience:

Requirements Mockups
Merge request is merge-able
  • We will show merge widget as normal (no changes)
Merge request is not merge-able
  • We will show merge widget as normal (no changes)
Merge request is being merged
  • Merge button has spinner and states Merging (no changes)
Fork merge request
  • Warning Merge request pipelines are enabled but will not activate due to this being a fork merge request
  • Warning merge button (Merge when pipeline succeeds will also be warning colored as we rely on a normal branch pipeline in those cases)
fork
Invalid merge request as target-branch advanced (linear history)
  • merge button disabled
  • warning target branch has advanced, update source branch and retry merge
invalid-prospective-merge-pipeline-target-branch-advanced-linear
Invalid merge request pipeline as target-branch advanced (non-linear history)
  • merge when pipeline succeeds button (which triggers new pipeline when pressed)
  • warning target branch has advanced, retry merge
invalid-prospective-merge-pipeline-target-branch-advanced-non-linear
Merge request pipeline failed
  • merge when pipeline succeeds button (which triggers new pipeline when pressed)
  • warning pipeline failed, retry merge or fix failure
prospective-merge-pipeline-failed
Merge request is converted from WIP to non-WIP
  • Merge request pipeline is automatically triggered
  • merge when pipeline succeeds button is shown (no changes)

This MR assumes the pipeline API will be updated as described in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/25679.

What are the relevant issue numbers?

https://gitlab.com/gitlab-org/gitlab-ee/issues/7380

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/25679

Does this MR meet the acceptance criteria?

Edited by Nathan Friend

Merge request reports