Replace `duoProAssignedUsersCount` usage with `duoAssignedUsersCount`

What does this MR do and why?

Replace duoProAssignedUsersCount usage with duoAssignedUsersCount

References

The old attribute was not properly accounting for Duo Enterprise, so the new attribute will eventually replace it (#485506 (closed))

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

No visible changes

Screenshot_2024-11-04_at_10.58.31_PM

How to set up and validate locally

Access the AI Impact analytics dashboard

  1. Ensure that you are using GitLab Ultimate
  2. Configure your GDK to use ClickHouse
  3. Apply this patch to mock the backend configuration
diff --git a/ee/app/models/ee/user.rb b/ee/app/models/ee/user.rb
index 9cdba082f5b7..94f6abc68b6f 100644
--- a/ee/app/models/ee/user.rb
+++ b/ee/app/models/ee/user.rb
@@ -478,6 +478,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
@@ -488,6 +489,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
diff --git a/ee/app/services/analytics/ai_analytics/ai_metrics_service.rb b/ee/app/services/analytics/ai_analytics/ai_metrics_service.rb
index 8dc9d8e028cb..631cde4daed6 100644
--- a/ee/app/services/analytics/ai_analytics/ai_metrics_service.rb
+++ b/ee/app/services/analytics/ai_analytics/ai_metrics_service.rb
@@ -17,6 +17,8 @@ def execute
         data = add_duo_assigned({})
         data = add_usage(data, CodeSuggestionUsageService, DuoChatUsageService, DuoUsageService)
 
+        data.merge!(duo_chat_contributors_count: 50, duo_assigned_users_count: 100)
+
         ServiceResponse.success(payload: data)
       end
  1. Create a new group
  2. Navigate to the Analytics dashboard page for the new group (ex. http://gdk.test:3000/groups/flightjs/-/analytics/dashboards)
  3. Select the AI impact analytics dashboard from the list
  4. The Duo Chat: Unique Users card should show 50.0%

Related to #498482 (closed)

Edited by Alex Pennells

Merge request reports

Loading