Skip to content

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 BarChart visualization to support contextual data in tooltips via YAML configuration and data source response.

References

Screenshots or screen recordings

Before After
Screenshot 2025-10-17 at 4.44.18 PM.png Screenshot 2025-10-17 at 4.43.46 PM.png

How to set up and validate locally

  1. Please make sure that you're on the GitLab Ultimate plan (if necessary, request a license).

  2. Configure your GDK to use ClickHouse

  3. 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)

  4. 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
  5. Create a new project

  6. Edit a file in the project using the UI.

  7. Seed the project using its id in PROJECT_ID=STEP_1_PROJECT_ID FILTER=ai_usage_stats bundle exec rake db:seed_fu

  8. Go to the project, then navigate to Analytics Dashboard > GitLab Duo and SDLC trends in the sidebar menu

  9. Scroll to the bottom, hover over the chart and verify that the raw values now appear in the tooltips

  10. To verify that BarChart now 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)

Edited by Rudy Crespo

Merge request reports

Loading