Commit 122c9c2e authored by Jan Provaznik's avatar Jan Provaznik

Merge branch 'remove-merge-base-pipelines-feature-flag' into 'master'

Remove merge_base_pipelines feature flag

See merge request gitlab-org/gitlab!46384
parents a0a73005 c37003aa
...@@ -151,6 +151,10 @@ class MergeRequestWidgetEntity < Grape::Entity ...@@ -151,6 +151,10 @@ class MergeRequestWidgetEntity < Grape::Entity
can?(current_user, :create_pipeline, merge_request.source_project) can?(current_user, :create_pipeline, merge_request.source_project)
end end
def use_merge_base_with_merged_results?
object.actual_head_pipeline&.merge_request_event_type == :merged_result
end
def head_pipeline_downloadable_path_for_report_type(file_type) def head_pipeline_downloadable_path_for_report_type(file_type)
object.head_pipeline&.present(current_user: current_user) object.head_pipeline&.present(current_user: current_user)
&.downloadable_path_for_report_type(file_type) &.downloadable_path_for_report_type(file_type)
...@@ -161,11 +165,6 @@ class MergeRequestWidgetEntity < Grape::Entity ...@@ -161,11 +165,6 @@ class MergeRequestWidgetEntity < Grape::Entity
&.downloadable_path_for_report_type(file_type) &.downloadable_path_for_report_type(file_type)
end end
def use_merge_base_with_merged_results?
Feature.enabled?(:merge_base_pipelines, object.target_project) &&
object.actual_head_pipeline&.merge_request_event_type == :merged_result
end
def merge_base_pipeline_downloadable_path_for_report_type(file_type) def merge_base_pipeline_downloadable_path_for_report_type(file_type)
object.merge_base_pipeline&.present(current_user: current_user) object.merge_base_pipeline&.present(current_user: current_user)
&.downloadable_path_for_report_type(file_type) &.downloadable_path_for_report_type(file_type)
......
---
title: Use updated base report for CodeQuality MergeRequest widdget
merge_request: 46384
author:
type: changed
---
name: merge_base_pipelines
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/44648
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/263724
type: development
group: group::testing
default_enabled: false
...@@ -106,31 +106,18 @@ RSpec.describe MergeRequestWidgetEntity do ...@@ -106,31 +106,18 @@ RSpec.describe MergeRequestWidgetEntity do
let(:merge_base_job_id) { merge_base_pipeline.builds.first.id } let(:merge_base_job_id) { merge_base_pipeline.builds.first.id }
it 'has head_path and base_path entries' do it 'has head_path and base_path entries' do
expect(subject[:codeclimate][:head_path]).to be_present expect(subject[:codeclimate][:head_path]).to include("/jobs/#{generic_job_id}/artifacts/download?file_type=codequality")
expect(subject[:codeclimate][:base_path]).to be_present expect(subject[:codeclimate][:base_path]).to include("/jobs/#{generic_job_id}/artifacts/download?file_type=codequality")
end end
context 'on pipelines for merged results' do context 'on pipelines for merged results' do
let(:pipeline) { create(:ci_pipeline, :merged_result_pipeline, :with_codequality_report, project: project) } let(:pipeline) { create(:ci_pipeline, :merged_result_pipeline, :with_codequality_report, project: project) }
context 'with merge_base_pipelines enabled' do
it 'returns URLs from the head_pipeline and merge_base_pipeline' do it 'returns URLs from the head_pipeline and merge_base_pipeline' do
expect(subject[:codeclimate][:head_path]).to include("/jobs/#{generic_job_id}/artifacts/download?file_type=codequality") expect(subject[:codeclimate][:head_path]).to include("/jobs/#{generic_job_id}/artifacts/download?file_type=codequality")
expect(subject[:codeclimate][:base_path]).to include("/jobs/#{merge_base_job_id}/artifacts/download?file_type=codequality") expect(subject[:codeclimate][:base_path]).to include("/jobs/#{merge_base_job_id}/artifacts/download?file_type=codequality")
end end
end end
context 'with merge_base_pipelines disabled' do
before do
stub_feature_flags(merge_base_pipelines: false)
end
it 'returns URLs from the head_pipeline and base_pipeline' do
expect(subject[:codeclimate][:head_path]).to include("/jobs/#{generic_job_id}/artifacts/download?file_type=codequality")
expect(subject[:codeclimate][:base_path]).to include("/jobs/#{generic_job_id}/artifacts/download?file_type=codequality")
end
end
end
end end
context 'without artifacts' do context 'without artifacts' do
......
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