Commit c37003aa authored by drew cimino's avatar drew cimino

Remove merge_base_pipelines feature flag

Remove the existing flag, add a changelog entry for the final
feature implementation, and refactor the associated specs
parent a7537882
......@@ -151,6 +151,10 @@ class MergeRequestWidgetEntity < Grape::Entity
can?(current_user, :create_pipeline, merge_request.source_project)
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)
object.head_pipeline&.present(current_user: current_user)
&.downloadable_path_for_report_type(file_type)
......@@ -161,11 +165,6 @@ class MergeRequestWidgetEntity < Grape::Entity
&.downloadable_path_for_report_type(file_type)
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)
object.merge_base_pipeline&.present(current_user: current_user)
&.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,29 +106,16 @@ RSpec.describe MergeRequestWidgetEntity do
let(:merge_base_job_id) { merge_base_pipeline.builds.first.id }
it 'has head_path and base_path entries' do
expect(subject[:codeclimate][:head_path]).to be_present
expect(subject[:codeclimate][:base_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 include("/jobs/#{generic_job_id}/artifacts/download?file_type=codequality")
end
context 'on pipelines for merged results' do
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
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")
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
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][:base_path]).to include("/jobs/#{merge_base_job_id}/artifacts/download?file_type=codequality")
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