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
How to set up and validate locally
-
Please make sure that you're on the GitLab Ultimate plan (if necessary, request a license).
-
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) -
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 -
Create a new project
-
Edit a file in the project using the UI.
-
Seed the project using its id in
PROJECT_ID=STEP_1_PROJECT_ID FILTER=ai_usage_stats bundle exec rake db:seed_fu -
Go to the project, then navigate to
Analytics Dashboard > GitLab Duo and SDLC trendsin the sidebar menu -
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)
