Refactor mr counts data source + add mttm visualization
What does this MR do and why?
This MR refactors the merge request counts data source to provide a more flexible API that can support different metrics. It also adds a Mean Time To Merge (MTTM) visualization to the analytics dashboards.
The current implementation only supports merge request counts metrics, but our users need insights about merge request timing to better understand their development cycles. By adding MTTM visualization, teams can track how quickly code changes are being reviewed and merged, which is a key indicator of workflow efficiency.
Key Changes
Component | Change |
---|---|
Data Source | Refactored merge_request_counts.js to support multiple metrics |
Visualization | Added new MTTM (Mean Time To Merge) visualization |
Constants | Added metric type constants for better type safety |
JSON Schema | Updated to support 365-day range for analytics dashboards |
Bug Fix | Fixed humanizeDisplayUnit to properly handle "-" values |
References
- Related to #523553 (closed)
Screenshots
No visual changes in this MR
How to set up and validate locally
- Run the Jest tests for the refactored components:
yarn jest components/data_sources/merge_request_counts_spec.js
MR acceptance checklist
-
Tests added for new functionality -
Code follows GitLab style guidelines -
Changes maintain backward compatibility -
Performance impact considered
Edited by Ezekiel Kigbo