Skip to content

Conversation

@sdzh-atlassian
Copy link
Member

What Is This Change?

Note: no change to behaviour or presentation - refactoring only

This PR is a somewhat broad rework of how analytics are implemented, scoped to rovodev-related stuff.

The main reasoning behind this is to avoid dragging the legacy implementation of analytics from into the new rovodev, whatever shape that takes :D

Change Before After
Explicit types for all relevant events image image
Finalize and send events in a single step image image
Options object across the board - no more magic with ordinal parameters image image
Single entrypoint for analytics -/- Telemetry, Performance, and Dwell events are defined in the same place and all sent through extensionApi.analytics

What's NOT in this PR?

  • Actual automatic generation of the event types (doable, but will need to happen later)
  • performanceEvent in src/analytics.ts still references rovodev but is now unused, it'll be cleaned up separately
  • We still use trackEvent from src/analytics.ts to enrich the events with stuff like userId - that will need to be moved separately

How Has This Been Tested?

Somewhat extensively :D

  • All tests that have been moved around kept their assertions, meaning there is literally no change to the shape of the events we actually send out
  • Traced a bunch of event sends in debug
  • [still going] Dumped all events we send to check if the (currently untested) single-event-per-prompt logic holds. Honestly, this is kind of tricky, so I might actually add tests for that in a separate PR

Basic checks:

  • npm run lint
  • npm run test

@@ -0,0 +1,175 @@
// All Rovo Dev analytics events and types
Copy link
Member Author

@sdzh-atlassian sdzh-atlassian Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file replaces rovodevAnalyticsTypes with a different approach to event definition, but same content otherwise

expect(Container.analyticsClient.sendTrackEvent).toHaveBeenCalledWith(mockEvent);
});

// Rovo Dev event tests
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to src/rovo-dev/rovoDevTelemetryProvider.test.ts without changes to the assertions

// Rovo Dev events, previously from src/analytics.ts
// TODO: refactor these, and particularly the usage in RovoDevTelemetryProvider, in a follow-up

export function rovoDevEntitlementCheckEvent(isEntitled: boolean, type: string, source?: string) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted in favour of using explicit types and a discriminated union in analyticsApi.sendTrackEvent

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw we have same func in analytics.ts file
just curious are these two same event?

@sdzh-atlassian sdzh-atlassian changed the title Axon 1545 refactor rovodev analytics [AXON-1545] refactor rovodev analytics Nov 24, 2025
sdzh-atlassian and others added 2 commits December 8, 2025 11:27
Co-authored-by: atlassian[bot] <40802693+atlassian[bot]@users.noreply.github.com>
@sdzh-atlassian sdzh-atlassian force-pushed the AXON-1545-refactor-rovodev-analytics branch from 81d44d5 to 6baf15f Compare December 8, 2025 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants