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 |
---|---|
![]() |
![]() |
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
- Ensure you have an ultimate license
- Seed data using the
productivity_analytics
development seeder$ FILTER=productivity_analytics SEED_PRODUCTIVITY_ANALYTICS=1 bundle exec rake db:seed_fu
Steps
- 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
- Navigate to Analytics > Dashboards at the project level
- Select the "Merge Request Analytics" dashboard
- 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