diff --git a/scripts/internal_events/cli/event.rb b/scripts/internal_events/cli/event.rb index 88f53a29aba799cf50f3e0c55adacf35f73478a8..e954334ea5666eb4feb2c35679bacffec1eb519c 100755 --- a/scripts/internal_events/cli/event.rb +++ b/scripts/internal_events/cli/event.rb @@ -15,7 +15,8 @@ module InternalEventsCli :product_categories, :milestone, :introduced_by_url, - :tiers + :tiers, + :classification ].freeze EVENT_DEFAULTS = { diff --git a/scripts/internal_events/cli/flows/event_definer.rb b/scripts/internal_events/cli/flows/event_definer.rb index 347292a641297f330468e0910c2038227215d463..361f6c99904e075a1cd47237bf7ce63b93022d58 100644 --- a/scripts/internal_events/cli/flows/event_definer.rb +++ b/scripts/internal_events/cli/flows/event_definer.rb @@ -20,6 +20,7 @@ class EventDefiner 'Group', 'Categories', 'Tiers', + 'Classification', 'Save files' ].freeze @@ -40,6 +41,7 @@ def run prompt_for_product_group prompt_for_product_categories prompt_for_tier + prompt_for_classification outcome = create_event_file display_result(outcome) @@ -222,6 +224,23 @@ def prompt_for_tier ) end + def prompt_for_classification + new_page!(on_step: 'Classification', steps: STEPS) + + cli.say CLASSIFICATION_INTRO + + classification_choice = cli.select( + 'Should this event have "classification: duo"?', + **select_opts + ) do |menu| + menu.enum "." + menu.choice 'Yes - this event is related to AI/Duo features', :duo + menu.choice 'No - this event is not related to AI/Duo features', :none + end + + event.classification = 'duo' if classification_choice == :duo + end + def create_event_file new_page!(on_step: 'Save files', steps: STEPS) diff --git a/scripts/internal_events/cli/text/event_definer.rb b/scripts/internal_events/cli/text/event_definer.rb index 62c52d661946294786e2e636223340d36a792a75..3e499c4e4700ddc4930e7f96c78786d5acb9b5cf 100644 --- a/scripts/internal_events/cli/text/event_definer.rb +++ b/scripts/internal_events/cli/text/event_definer.rb @@ -142,6 +142,26 @@ module EventDefiner - value TEXT + + CLASSIFICATION_INTRO = <<~TEXT.freeze + #{format_info('EVENT CLASSIFICATION')} + + The classification field is used to categorize events based on their data handling requirements. + Currently, the only supported classification is "duo" for AI and Duo-related features. + + #{format_info('WHEN TO USE "classification: duo":')} + - Events related to GitLab Duo features (Duo Agent Platform, Code Suggestions, Duo Chat, etc.) + - AI-powered functionality and interactions + - Events owned by an AI Engineering product group such as duo_chat, ai_framework or duo_agent_framework + + #{format_info('WHEN NOT TO USE "classification: duo":')} + - GitLab features unrelated to Duo or AI + + Events with "classification: duo" are treated as operational data with specific data handling requirements. + + Learn more: https://docs.gitlab.com/development/internal_analytics/internal_event_instrumentation/duo_classification/ + + TEXT end end end diff --git a/spec/fixtures/scripts/internal_events/event_definer_examples.yml b/spec/fixtures/scripts/internal_events/event_definer_examples.yml index e3c08c6a30ca06901b820d7d4b1c57b272e80d36..f01c2cd68ab0848a0905a1978af73859b44541f7 100644 --- a/spec/fixtures/scripts/internal_events/event_definer_examples.yml +++ b/spec/fixtures/scripts/internal_events/event_definer_examples.yml @@ -11,6 +11,7 @@ - "\n" # Accept analytics:monitor:analytics_instrumentation - " \n" # Select product category - "1\n" # Select: [free, premium, ultimate] + - "2\n" # No - this event is not related to AI/Duo features - "y\n" # Create file - "\n" # Select: Create Metric --- define a new metric - "\e[A" # Arrow up to: Total count of events @@ -41,6 +42,7 @@ - "\n" # Accept analytics:monitor:analytics_instrumentation - " \n" # Select product category - "1\n" # Select [free, premium, ultimate] + - "2\n" # No - this event is not related to AI/Duo features - "y\n" # Create file - "4\n" # Exit outputs: @@ -65,6 +67,7 @@ - "\n" # Accept analytics:monitor:analytics_instrumentation - "\e[A \n" # Skip product category - "1\n" # Select [free, premium, ultimate] + - "2\n" # No - this event is not related to AI/Duo features - "y\n" # Create file - "4\n" # Exit outputs: @@ -85,6 +88,7 @@ - "\n" # Accept analytics:monitor:analytics_instrumentation - " \n" # Select product category - "2\n" # Select [premium, ultimate] + - "2\n" # No - this event is not related to AI/Duo features - "y\n" # Create file - "4\n" # Exit outputs: @@ -104,6 +108,7 @@ - "\n" # Select core_platform:manage:import - " \n" # Select product category - "\n" # Select [free, premium, ultimate] + - "\n" # Yes - this event is related to AI/Duo features - "\n" # Create file - "\n" # Select: Create Metric --- define a new metric - "\n" # Select: Weekly/Monthly count of unique users @@ -141,6 +146,7 @@ - "\n" # Accept analytics:monitor:analytics_instrumentation - " \n" # Select product category - "2\n" # Select [premium, ultimate] + - "2\n" # No - this event is not related to AI/Duo features - "y\n" # Create file - "4\n" # Exit outputs: @@ -161,6 +167,7 @@ - "\n" # Accept analytics:monitor:analytics_instrumentation - " \n" # Select product category - "1\n" # Select: [free, premium, ultimate] + - "2\n" # No - this event is not related to AI/Duo features - "y\n" # Create file - "3\n" # Select: View Usage - "Exit" # Filters to this item @@ -183,6 +190,7 @@ - "\n" # Accept analytics:monitor:analytics_instrumentation - " \n" # Select product category - "1\n" # Select: [free, premium, ultimate] + - "2\n" # No - this event is not related to AI/Duo features - "n\n" # Create file - "\n" # Select: Save event & create Metric --- define a new metric - "\e[A" # Arrow up to: Total count of events @@ -212,6 +220,7 @@ - "service_ " # Select product category: service_ping - "d \n" # Select additional product category: service_desk - "1\n" # Select: [free, premium, ultimate] + - "2\n" # No - this event is not related to AI/Duo features - "y\n" # Create file - "4\n" # Exit outputs: @@ -239,6 +248,7 @@ - "\n" # Accept analytics:monitor:analytics_instrumentation - " \n" # Select product category - "1\n" # Select: [free, premium, ultimate] + - "2\n" # No - this event is not related to AI/Duo features - "y\n" # Create file - "4\n" # Exit outputs: @@ -260,6 +270,7 @@ - "service_ " # Select product category: service_ping - "d \n" # Select additional product category: service_desk - "1\n" # Select: [free, premium, ultimate] + - "2\n" # No - this event is not related to AI/Duo features - "y\n" # Create file - "1\n" # Create another event - "Internal Event CLI is opened\n" # Submit description @@ -271,6 +282,7 @@ - "\n" # Accept analytics:monitor:analytics_instrumentation - " \n" # Select default product category: service_ping - "2\n" # Select [premium, ultimate] + - "2\n" # No - this event is not related to AI/Duo features - "y\n" # Create file - "4\n" # Exit outputs: @@ -302,6 +314,7 @@ - "\n" # Accept analytics:monitor:analytics_instrumentation - " \n" # Select product category - "1\n" # Select: [free, premium, ultimate] + - "2\n" # No - this event is not related to AI/Duo features - "y\n" # Create file - "4\n" # Exit outputs: diff --git a/spec/fixtures/scripts/internal_events/events/keyboard_smashed_event.yml b/spec/fixtures/scripts/internal_events/events/keyboard_smashed_event.yml index ab8365bf5ba8c9ceec9efcb6724e79902138a3c0..a853d0973863afb72b9e3464c5a73833149f98e3 100644 --- a/spec/fixtures/scripts/internal_events/events/keyboard_smashed_event.yml +++ b/spec/fixtures/scripts/internal_events/events/keyboard_smashed_event.yml @@ -16,3 +16,4 @@ tiers: - free - premium - ultimate +classification: duo diff --git a/spec/fixtures/scripts/internal_events/metric_definer_examples.yml b/spec/fixtures/scripts/internal_events/metric_definer_examples.yml index 2d22ef8000ec2ab1dcd3a4c999324607cd6fdba2..5502e530174961e169359627a98266e76b3a2e26 100644 --- a/spec/fixtures/scripts/internal_events/metric_definer_examples.yml +++ b/spec/fixtures/scripts/internal_events/metric_definer_examples.yml @@ -257,6 +257,7 @@ - "\n" # Accept analytics:monitor:analytics_instrumentation - " \n" # Select product category - "2\n" # Select [premium, ultimate] + - "2\n" # No - this event is not related to AI/Duo features - "y\n" # Create file - "4\n" # Exit outputs: diff --git a/spec/scripts/internal_events/cli/flows/event_definer_spec.rb b/spec/scripts/internal_events/cli/flows/event_definer_spec.rb index d6eec6054d0f58542cbfd3ab25133aee5d247698..6204ad88ca1f6712d7fdbb636c2886c3fe571e66 100644 --- a/spec/scripts/internal_events/cli/flows/event_definer_spec.rb +++ b/spec/scripts/internal_events/cli/flows/event_definer_spec.rb @@ -36,7 +36,7 @@ ]) with_cli_thread do - expect { prompt.output.string }.to eventually_include_cli_text('Step 3 / 8') + expect { prompt.output.string }.to eventually_include_cli_text('Step 3 / 9') end end end diff --git a/spec/scripts/internal_events/cli_spec.rb b/spec/scripts/internal_events/cli_spec.rb index 73c388c591b52c49e9771c4968449a662e9df3a1..13a90453790d814bb8fe8a13738d90b424f0b99c 100644 --- a/spec/scripts/internal_events/cli_spec.rb +++ b/spec/scripts/internal_events/cli_spec.rb @@ -60,6 +60,7 @@ "analytics_instrumentation\n", # Input group "service_ping \n", # Select product category "2\n", # Select [premium, ultimate] + "2\n", # No - this event is not related to AI/Duo features "y\n", # Create file "4\n" # Exit ] @@ -130,6 +131,7 @@ "instrumentation\n", # Filter & select group " \n", # Select product category "2\n", # Select [premium, ultimate] + "2\n", # No - this event is not related to AI/Duo features "y\n", # Create file "4\n" # Exit ]