Add Code suggestions acceptance rate by language chart

What does this MR do and why?

Adds Code suggestions acceptance rate by language panel to the GitLab Duo and SDLC trends analytics dashboard.

References

Screenshots or screen recordings

Screenshot 2025-10-06 at 5.34.13 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 and verify that the chart is rendering correctly

*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 #454809 (closed)

Edited by Rudy Crespo

Merge request reports

Loading