Skip to content

Add MR analytics shared dashboard

What does this MR do and why?

This MR adds an MvC MR Analytics dashboard into the analytics dashboard framework. The dashboard is available at the project level and is a replica of the existing MR Analytics dashboard.

This MR addresses #523559 (closed)

The consolidation addresses current duplication in analytics functionality and creates a unified approach for displaying merge request metrics across the application.

Key Changes

Change Description
New Dashboard Added a dedicated Merge Request Analytics dashboard
Data Source Integration Connected MR data to analytics dashboards framework
Visualizations Created three new visualizations: mean time to merge, MRs over time, and MR throughput table
Code Reuse Leveraged existing components to minimize duplication
Data Handling Improved data formatting for consistent display of metrics

Implementation Details

  • Created a new dashboard configuration in YAML format
  • Added a data source for merge request metrics
  • Integrated existing MR table component for data display
  • Improved data handling for edge cases (zero values, empty sets)
  • Added constants to support new metric types

Screenshots or screen recordings

Before After
Screenshot_2025-05-07_at_21.01.11 Screenshot_2025-05-07_at_21.00.59

How to Set Up and Validate Locally

Feature flags

  • consolidate_mr_analytics_in_shared_dashboards - enables the migrated MR analytics dashboard at the project level

Setup

Steps

  1. Enable the consolidate_mr_analytics_in_shared_dashboards feature flag (globally or for a project) in your rails console
    $ echo "Feature.enable(:consolidate_mr_analytics_in_shared_dashboards)" | bundle exec rails c
  2. Navigate to Analytics > Dashboards at the project level
  3. Select the "Merge Request Analytics" dashboard
  4. Verify that the dashboard displays:
    • Mean time to merge metric
    • Throughput chart showing MRs over time
    • Table of merge requests with pagination
Edited by Ezekiel Kigbo

Merge request reports

Loading