Add AiTracking for Duo Description Composer

What does this MR do and why?

Adds track_internal_event('compose_merge_request_description', ...) to Llm::DescriptionComposerService and registers the event, so Duo merge-request description composition lands in ai_usage_events. Until now this Duo feature fired no AiTracking event, leaving it invisible to AiUsageData, AiUserMetrics, and the Duo and SDLC Trends dashboard. This closes the Description Composer row of the audit at #567159.

Naming

The event action is verb-led (compose_merge_request_description) per the analytics-instrumentation <operation>_<target> convention. The product feature identity is unchanged: DescriptionComposerService, the description_composer ai_action, and the description_composer licensed feature all stay, so the public aiAction input (AiDescriptionComposerInput) is untouched.

How it is registered

  • ee/config/events/compose_merge_request_description.yml: the InternalEvents definition. No extra_trackers block (AiTracking is a default tracker).
  • ee/lib/gitlab/tracking/ai_tracking.rb: registry entry, event id 37 (the in-flight sibling MRs from #567159 hold 32-36; ids are distinct so they do not collide regardless of merge order).
  • GraphQL enum value plus regenerated reference docs and introspection schema.

The resource is the Project the description is composed in (enforced by #valid?), and the service schedules completion asynchronously, so the event is tracked at entry of #perform, mirroring Llm::ChatService#perform. User and project are passed; namespace is auto-derived.

Tracks #567159.

How to set up and validate locally

Gitlab::InternalEvents.track_event('compose_merge_request_description',
  user: User.first, project: Project.first)
UsageEvents::DumpWriteBufferCronWorker.new.perform
Ai::UsageEvent.where(event: :compose_merge_request_description).count # +1

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist.

Edited by Andrew Dunn

Merge request reports

Loading