Add Duo Chat: Unique Users to AI analytics dashboard metric table

What does this MR do and why?

Adds a new Duo Chat: Unique Users metric to the AI impact analytics comparison table.

References

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screenshot_2025-01-21_at_1.20.16_PM Screenshot_2025-01-21_at_1.17.58_PM

How to set up and validate locally

  • Make sure you are using GitLab Ultimate
  • 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)
  • Apply this diff to mock the permissions for the AI impact analytics dashboard:
diff --git a/ee/app/models/ee/user.rb b/ee/app/models/ee/user.rb
index d4334b16d41f..0b5b0e70467b 100644
--- a/ee/app/models/ee/user.rb
+++ b/ee/app/models/ee/user.rb
@@ -492,6 +492,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
@@ -502,6 +503,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
  • Seed data: SEED_GITLAB_DUO=1 FILTER=gitlab_duo bundle exec rake db:seed_fu
  • Select any group/project, navigate to Analyze > Analytics Dashboard in the menu and select AI impact analytics from the list
  • Verify that the Duo Chat: Unique Users metric is correctly displayed in the AI usage metrics table

Related to #477249 (closed)

Edited by Alex Pennells

Merge request reports

Loading