Metrics report Merge Request widget should use merge_base_pipeline
Overview
Several of the merge request widgets were basing their comparison on an imperfect commit if pipelines for merged results were turned on. This includes the Metrics widget. As a developer I want the comparison commit to point to the same commit that the code quality report comparison is now based on, so that my metrics report results are more accurate.
Proposal
We have seen good results from changing the base report comparison for the code quality report merge request widget. The Metrics report merge request widget has a similar problem with incorrect base comparisons when we are using merged results pipelines. We should use the new comparison to increase the relevancy of the Metrics report merge request widget.
With the work done in !54620 (merged), we have now a way to introduce more report comparison easily on our backend using merge result pipeline as follow:
ALLOWED_TO_USE_MERGE_BASE_PIPELINE_FOR_COMPARISON = {
'Ci::CompareCodequalityReportsService' => ->(project) { ::Gitlab::Ci::Features.display_codequality_backend_comparison?(project) },
+ '::Ci::CompareMetricsReportsService' => ->(project) { ::Gitlab::Ci::Features.use_metrics_report_merge_base_pipeline?(project) },
}.freeze