Commit d7c47fb1 authored by drew cimino's avatar drew cimino

Globally enable better generic metrics comparison

Use merge base pipeline instead of diff base pipeline.
When using pipelines for merged results, the comparison
will be truer to the semantic diff of the merge request.

Changelog: changed
parent 4b939871
......@@ -37,7 +37,7 @@ class MergeRequest < ApplicationRecord
SORTING_PREFERENCE_FIELD = :merge_requests_sort
ALLOWED_TO_USE_MERGE_BASE_PIPELINE_FOR_COMPARISON = {
'Ci::CompareMetricsReportsService' => ->(project) { ::Gitlab::Ci::Features.merge_base_pipeline_for_metrics_comparison?(project) },
'Ci::CompareMetricsReportsService' => ->(project) { true },
'Ci::CompareCodequalityReportsService' => ->(project) { true }
}.freeze
......
---
name: merge_base_pipeline_for_metrics_comparison
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/61282
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/330809
milestone: '13.12'
type: development
group: group::testing
default_enabled: false
......@@ -18,10 +18,6 @@ module Gitlab
Feature.enabled?(:ci_pipeline_status_omit_commit_sha_in_cache_key, project, default_enabled: true)
end
def self.merge_base_pipeline_for_metrics_comparison?(project)
Feature.enabled?(:merge_base_pipeline_for_metrics_comparison, project, default_enabled: :yaml)
end
# NOTE: The feature flag `disallow_to_create_merge_request_pipelines_in_target_project`
# is a safe switch to disable the feature for a particular project when something went wrong,
# therefore it's not supposed to be enabled by default.
......
......@@ -3880,14 +3880,6 @@ RSpec.describe MergeRequest, factory_default: :keep do
let(:service_class) { 'Ci::CompareMetricsReportsService' }
it { is_expected.to be_truthy }
context 'with the metrics report flag disabled' do
before do
stub_feature_flags(merge_base_pipeline_for_metrics_comparison: false)
end
it { is_expected.to be_falsey }
end
end
context 'when service class is Ci::CompareCodequalityReportsService' 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