Add Code generation volume trends chart

What does this MR do and why?

Adds Code generation volume trends panel – a multi-series area chart showing code suggestions' lines of code shown and accepted over time – to the GitLab Duo and SDLC trends analytics dashboard.

References

#573972 (closed)

Screenshots or screen recordings

Screenshot 2025-10-08 at 10.16.28 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. SEED_GITLAB_DUO=1 FILTER=gitlab_duo bundle exec rake db:seed_fu or follow the steps in https://docs.gitlab.com/development/development_seed_files/#seed-project-and-group-resources-for-gitlab-duo\\*

  6. Visit the project from the output above

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

  8. Scroll to the bottom and verify that the chart is rendering correctly

*If you're not seeing any data, try applying the patch in !207492 (comment 2804154619) and re-running the seeder

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

Edited by Rudy Crespo

Merge request reports

Loading