Add merge request analytics system dashboard behind a flag
What does this MR do and why?
Adds a Merge request analytics system dashboard to Explore > Analytics dashboards, behind the new gi_migration_merge_request_analytics wip feature flag. This is the first step in moving the legacy project dashboard into the new space.
- Mean time to merge and Throughput are GLQL panels (
type = MergeRequestanalytics:timeToMergeMean, andthroughputCountbymerged(%{dynamicGranularity}), so the buckets follow the selected date range). This also covers the GLQL conversion of these two panels. - Merge requests keeps the legacy
merge_requestsdata source and columns. GLQL can't produce this table yet. - The flag checks the user as actor, so it can be enabled per user or by percentage of actors.
- The dashboard declares
data: [clickhouse], because the GLQL merge request engine reads ClickHouse.
Why the flag uses a user actor only
It matches the sibling DORA flag (!262584 (merged)), which also uses a user actor. An organization actor would be all-or-nothing on GitLab.com, where almost every user is in the default organization. A user actor allows --user and percentage-of-actors rollouts. Enabling the flag for a group has no effect.
Known gaps, tracked separately:
- Scope. The picker is single-select. The table reads only the first selection and is project-only, so it is empty when a group is selected. Group support, and the permission the picker should require (
read_cycle_analyticsneeds Reporter on a group), are being decided in https://gitlab.com/gitlab-org/gitlab/-/work_items/638172. - Filtered search. The legacy dashboard's six tokens are not available yet: https://gitlab.com/gitlab-org/gitlab/-/work_items/638174.
- Table on GLQL. Blocked on missing GLQL fields: https://gitlab.com/gitlab-org/gitlab/-/work_items/638177.
References
- Feature issue: https://gitlab.com/gitlab-org/gitlab/-/work_items/638173
- GLQL panel conversion: https://gitlab.com/gitlab-org/gitlab/-/work_items/638176
- Rollout issue: https://gitlab.com/gitlab-org/gitlab/-/work_items/638175
- Epic: https://gitlab.com/groups/gitlab-org/-/work_items/24058
Screenshots or screen recordings
How to set up and validate locally
ClickHouse and Siphon need to be running in GDK for the GLQL panels.
-
In the Rails console, enable the flag:
Feature.enable(:gi_migration_merge_request_analytics) -
Visit
/explore/analytics_dashboardsand open Merge request analytics. -
Select a project with merged merge requests, such as
gitlab-org/gitlab-test. -
Compare the values with the legacy dashboard at
/<project>/-/analytics/merge_request_analyticsfor the same date range. -
Disable the flag and check the dashboard is no longer listed, and its URL no longer loads.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.