Add counts to Code Suggestions acceptance rate by language tooltips
What does this MR do and why?
As a follow-up to !207492 (merged), it adds raw values to the Code Suggestions acceptance rate by language chart's tooltips to show the numbers behind the acceptance rates. More specifically, it
- Adds suggestions accepted and shown counts to the chart's tooltips alongside acceptance rate.
- Updates BarChartvisualization to support contextual data in tooltips via YAML configuration and data source response.
References
Screenshots or screen recordings
| Before | After | 
|---|---|
|  |  | 
How to set up and validate locally
- 
Please make sure that you're on the GitLab Ultimate plan (if necessary, request a license). 
- 
Configure your GDK to use ClickHouse 
- 
Make sure ClickHouse is being used for Analytics by running this in the Rails console: Gitlab::CurrentSettings.current_application_settings.update(use_clickhouse_for_analytics: true)
- 
Mock AI Impact analytics permissions: diff --git a/ee/app/models/ee/user.rb b/ee/app/models/ee/user.rb index 83e827808849..c89ecd514553 100644 --- a/ee/app/models/ee/user.rb +++ b/ee/app/models/ee/user.rb @@ -522,6 +522,7 @@ def using_gitlab_com_seat?(namespace) end def assigned_to_duo_enterprise?(container) + return true namespace = ::Gitlab::Saas.feature_available?(:gitlab_duo_saas_only) ? container.root_ancestor : nil GitlabSubscriptions::AddOnPurchase @@ -532,6 +533,7 @@ def assigned_to_duo_enterprise?(container) end def assigned_to_duo_pro?(container) + return true namespace = ::Gitlab::Saas.feature_available?(:gitlab_duo_saas_only) ? container.root_ancestor : nil GitlabSubscriptions::AddOnPurchase
- 
Create a new project 
- 
Edit a file in the project using the UI. 
- 
Seed the project using its id in PROJECT_ID=STEP_1_PROJECT_ID FILTER=ai_usage_stats bundle exec rake db:seed_fu
- 
Go to the project, then navigate to Analytics Dashboard > GitLab Duo and SDLC trendsin the sidebar menu
- 
Scroll to the bottom, hover over the chart and verify that the raw values now appear in the tooltips 
- 
To verify that BarChartnow supports contextual data in tooltips, see http://localhost:6006/?path=/story/ee-analytics-analytics-dashboards-components-visualizations-bar-chart--with-contextual-tooltip-data
*If no data is being displayed in the chart, trying changing the visualization's date range:
diff --git a/ee/lib/gitlab/analytics/ai_impact_dashboard/visualizations/code_suggestions_acceptance_rate_by_language_chart.yaml b/ee/lib/gitlab/analytics/ai_impact_dashboard/visualizations/code_suggestions_acceptance_rate_by_language_chart.yaml
index c5bff107c238e..1f972fbf48bf0 100644
--- a/ee/lib/gitlab/analytics/ai_impact_dashboard/visualizations/code_suggestions_acceptance_rate_by_language_chart.yaml
+++ b/ee/lib/gitlab/analytics/ai_impact_dashboard/visualizations/code_suggestions_acceptance_rate_by_language_chart.yaml
@@ -4,7 +4,7 @@ type: BarChart
 data:
   type: code_suggestions_acceptance_rate_by_language
   query:
-    dateRange: last_30_days
+    dateRange: last_180_days
 options:
   xAxis:
     name: "Acceptance rate"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.
Related to #576015 (closed)