Skip to content

Conversation

@rutmanz
Copy link
Member

@rutmanz rutmanz commented Jul 25, 2025

Task

AARD-1937

Discover what we're doing with analytics and write unit tests

Symptom

No unit tests, analytics kind of obscure and Google Analytics is a confusing platform

Solution

I wrote tests to validate that the AnalyticsSystem.ts => google-analytics.com pipeline was working and all the intermediate components were present and working

I went into the google analytics page and poked around until I could find where the data was going, and discovered that the user attributes we had been sending were unusable because they had spaces (oops).

I added typing to the analytics events (at least for keys) and added an event for selecting an input scheme.

In terms of processing analytics, the user attributes will give us more flexibility over what we filter, I found (kind of) how to see event info, and we can filter by developer or not.
image

Verification

Tests pass, removing important parts of the code makes them not pass. Analytics are sent and can be seen live in the debug page of the GA dashboard (the main pages take a while to update)


Before merging, ensure the following criteria are met:

  • All acceptance criteria outlined in the ticket are met.
  • Necessary test cases have been added and updated.
  • A feature toggle or safe disable path has been added (if applicable).
  • User-facing polish:
    • Ask: "Is this ready-looking?"
  • Cross-linking between Jira and GitHub:
    • PR links to the relevant Jira issue.
    • Jira ticket has a comment referencing this PR.

Copy link
Contributor

@azaleacolburn azaleacolburn left a comment

Choose a reason for hiding this comment

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

Seems like there are some security issues from some third-party app, is that something we care about.

assemblyName: displayName,
fileSize: buffer.byteLength,
key,
type: miraType == MiraType.ROBOT ? "robot" : "field",
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you put a note in #1190 to fix this if this PR gets merged first.

@rutmanz
Copy link
Member Author

rutmanz commented Jul 25, 2025

@azaleacolburn From an actual "is this a vulnerability" standpoint the answer is "no." The thing it is flagging is not a type of vulnerability that matters to us and that the library is used in the build process, not when serving. However, from a "we don't want Snyk errors" perspective, it might make sense to try and find a different way of accomplishing the git commit hash inclusion (@PepperLola @BrandonPacewic?)

Copy link
Member

@BrandonPacewic BrandonPacewic left a comment

Choose a reason for hiding this comment

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

@azaleacolburn From an actual "is this a vulnerability" standpoint the answer is "no." The thing it is flagging is not a type of vulnerability that matters to us and that the library is used in the build process, not when serving. However, from a "we don't want Snyk errors" perspective, it might make sense to try and find a different way of accomplishing the git commit hash inclusion (@PepperLola @BrandonPacewic?)

I'm honestly not 100% sure, if its not possible to mark this issue as ignored then we need to find some sort of workaround. At some point we should document all of our internal org checks as some of these things get flagged and sent to Pam.

@rutmanz
Copy link
Member Author

rutmanz commented Jul 28, 2025

did a workaround so the dependency is no longer included

@rutmanz rutmanz requested a review from AlexD717 July 28, 2025 23:33
Copy link
Member

@AlexD717 AlexD717 left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@BrandonPacewic BrandonPacewic left a comment

Choose a reason for hiding this comment

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

Think this looks good, again going to have conflicts with #1241, doesn't look too bad. Will revisit merge order once we see how refactor is going.

Copy link
Member

@PepperLola PepperLola left a comment

Choose a reason for hiding this comment

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

There are a couple unrelated formatting changes but I don't really mind that, otherwise looks good

@PepperLola PepperLola merged commit f1fd3a5 into dev Aug 5, 2025
16 checks passed
@PepperLola PepperLola deleted the zachr/1937/analytics-2 branch August 5, 2025 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants