Commit 730ace4f authored by Robert Speicher's avatar Robert Speicher

Merge branch...

Merge branch '14853-disable-pipeline-retry-button-for-merge-train-pipelines-for-merged-results' into 'master'

Hide pipeline retry button for Merge Train/Pipelines

Closes #14853

See merge request gitlab-org/gitlab!17065
parents 7079d62a 88df99f1
...@@ -15,7 +15,8 @@ module Ci ...@@ -15,7 +15,8 @@ module Ci
:merge_request_ref?, :merge_request_ref?,
:source_ref, :source_ref,
:source_ref_slug, :source_ref_slug,
:legacy_detached_merge_request_pipeline?, to: :pipeline :legacy_detached_merge_request_pipeline?,
:merge_train_pipeline?, to: :pipeline
end end
end end
end end
...@@ -122,6 +122,12 @@ is unavailable when ...@@ -122,6 +122,12 @@ is unavailable when
Follow [this issue](https://gitlab.com/gitlab-org/gitlab/issues/12267) to Follow [this issue](https://gitlab.com/gitlab-org/gitlab/issues/12267) to
track progress on this issue. track progress on this issue.
### Merge Train Pipeline cannot be retried
A Merge Train pipeline cannot be retried because the merge request is dropped from the merge train upon failure. For this reason, the retry button does not appear next to the pipeline icon.
In the case of pipeline failure, you should [re-enqueue](#how-to-add-a-merge-request-to-a-merge-train) the merge request to the merge train, which will then initiate a new pipeline.
### Merge Train disturbs your workflow ### Merge Train disturbs your workflow
First of all, please check if [merge immediately](#immediately-merge-a-merge-request-with-a-merge-train) First of all, please check if [merge immediately](#immediately-merge-a-merge-request-with-a-merge-train)
......
...@@ -107,6 +107,10 @@ module EE ...@@ -107,6 +107,10 @@ module EE
metrics_report metrics_report
end end
def retryable?
!merge_train_pipeline? && super
end
private private
def name_in?(names) def name_in?(names)
......
...@@ -98,6 +98,10 @@ module EE ...@@ -98,6 +98,10 @@ module EE
source_bridge&.dependent? source_bridge&.dependent?
end end
def retryable?
!merge_train_pipeline? && super
end
def update_bridge_status! def update_bridge_status!
raise ArgumentError unless bridge_triggered? raise ArgumentError unless bridge_triggered?
raise BridgeStatusError unless source_bridge.active? raise BridgeStatusError unless source_bridge.active?
......
---
title: Inactivate pipeline retries for Merge Trains
merge_request: 17065
author:
type: added
...@@ -61,6 +61,25 @@ describe 'User adds a merge request to a merge train', :js do ...@@ -61,6 +61,25 @@ describe 'User adds a merge request to a merge train', :js do
end end
end end
context 'when pipeline for merge train succeeds' do
before do
visit project_merge_request_path(project, merge_request)
merge_request.merge_train.pipeline.builds.map(&:success!)
end
it 'displays pipeline control' do
expect(page).to have_selector('.mini-pipeline-graph-dropdown-toggle')
end
it 'does not allow retry for merge train pipeline' do
find('.mini-pipeline-graph-dropdown-toggle').click
page.within '.ci-job-component' do
expect(page).to have_selector('.ci-status-icon')
expect(page).not_to have_selector('.retry')
end
end
end
context "when user clicks 'Remove from merge train' button" do context "when user clicks 'Remove from merge train' button" do
before do before do
click_link 'Remove from merge train' click_link 'Remove from merge train'
......
...@@ -333,4 +333,22 @@ describe Ci::Build do ...@@ -333,4 +333,22 @@ describe Ci::Build do
end end
end end
end end
describe '#retryable?' do
subject { build.retryable? }
let(:pipeline) { merge_request.all_pipelines.last }
let!(:build) { create(:ci_build, :canceled, pipeline: pipeline) }
context 'with pipeline for merged results' do
let(:merge_request) { create(:merge_request, :with_merge_request_pipeline) }
it { is_expected.to be true }
end
context 'with pipeline for merge train' do
let(:merge_request) { create(:merge_request, :on_train, :with_merge_train_pipeline) }
it { is_expected.to be false }
end
end
end end
...@@ -527,4 +527,22 @@ describe Ci::Pipeline do ...@@ -527,4 +527,22 @@ describe Ci::Pipeline do
it { is_expected.to be_falsy } it { is_expected.to be_falsy }
end end
end end
describe '#retryable?' do
subject { pipeline.retryable? }
let(:pipeline) { merge_request.all_pipelines.last }
let!(:build) { create(:ci_build, :canceled, pipeline: pipeline) }
context 'with pipeline for merged results' do
let(:merge_request) { create(:merge_request, :with_merge_request_pipeline) }
it { is_expected.to be true }
end
context 'with pipeline for merge train' do
let(:merge_request) { create(:merge_request, :on_train, :with_merge_train_pipeline) }
it { is_expected.to be false }
end
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment