Fix missing contributor count metric on explore analytics dashboards
What does this MR do and why?
contributor_count never renders on the explore analytics dashboards, whatever the instance is configured to do.
metric_table.vue injects dataSourceClickhouse with a default of false and drops CONTRIBUTOR_METRICS.COUNT when it is falsy. The explore app provided dataSourceClickhouse: null, so the metric was always dropped — including from the "Development metrics" panel on "GitLab Duo and SDLC trends", which lists it. The page now emits the setting and the app provides it once at the root.
Providing it at the root is safe despite the namespace picker: Gitlab::ClickHouse.enabled_for_analytics? ignores the namespace it is given and delegates to globally_enabled_for_analytics?, so the value cannot go stale when the user changes their selection.
analytics_dashboard_panel.vue also injects dataSourceClickhouse — via the array form of inject, so there's no default — and forwards it to the dashboard data sources. contributions.js uses it in limitPostgresqlRequests: falsy calls restrictRequestEndDate to clamp the request window and keep PostgreSQL queries small, truthy leaves the dates alone. With the explore app previously providing null, contribution requests always took the clamped path, even with ClickHouse enabled. With the real value provided, they now take the unclamped path when ClickHouse is on.
References
Related to https://gitlab.com/gitlab-org/gitlab/-/work_items/618193
Screenshots or screen recordings
How to set up and validate locally
Enable ClickHouse for analytics, then open the "GitLab Duo and SDLC trends" dashboard under /explore/analytics_dashboards and check that the "Development metrics" table includes the contributor count row.
bundle exec rspec ee/spec/views/explore/analytics_dashboardsVUE_VERSION=3 yarn jest spec/frontend/explore/analytics_dashboardsLocal results: 4 examples / 0 failures, 361 jest tests / 0 failures.
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.