Skip to content

chore: move analytics definitions to suite-common #19084

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 3, 2025

Conversation

martykan
Copy link
Member

@martykan martykan commented May 21, 2025

Description

We need a solution to send analytics from Suite Common packages.

I tried several approaches but ultimately came up with this:

  • Events from both Suite web & native are moved to subfolders in @suite-common/analytics
  • The original packages @trezor/suite-analytics and @suite-native/analytics will re-export those subfolders directly
  • There is a new subfolder with shared types
  • When importing @suite-common/analytics, those shared types are used and it will select the implementation based on the environment (by index.ts vs index.native.ts)

🔍🖥️ Suite web test results: View in Currents

🔍🖥️ Suite desktop test results: View in Currents

🔍🖥️ Suite native android test results: View in Currents

@martykan martykan force-pushed the feat/redux-extra-analytics-report branch from 032fcd1 to 173c269 Compare May 21, 2025 14:25
@trezor-bot
Copy link

trezor-bot bot commented May 21, 2025

✅ Previously successful run of [Test] PR Suite Web e2e tests workflow has been found.
⏭️ Skipping tests for this run.
💡 If you are unsure about your latest changes, please rerun the workflow manually. (Use the Re-run all jobs option)

@martykan martykan force-pushed the feat/redux-extra-analytics-report branch from 173c269 to 4eee74a Compare May 21, 2025 14:30
@trezor-bot
Copy link

trezor-bot bot commented May 21, 2025

✅ Previously successful run of [Test] PR Suite Web e2e tests workflow has been found.
⏭️ Skipping tests for this run.
💡 If you are unsure about your latest changes, please rerun the workflow manually. (Use the Re-run all jobs option)

@martykan martykan force-pushed the feat/redux-extra-analytics-report branch from 4eee74a to 018c067 Compare May 26, 2025 14:36
@trezor-bot
Copy link

trezor-bot bot commented May 26, 2025

✅ Previously successful run of [Test] PR Suite Web e2e tests workflow has been found.
⏭️ Skipping tests for this run.
💡 If you are unsure about your latest changes, please rerun the workflow manually. (Use the Re-run all jobs option)

@martykan martykan force-pushed the feat/redux-extra-analytics-report branch from 018c067 to e65e86b Compare May 30, 2025 18:18
@trezor-bot
Copy link

trezor-bot bot commented May 30, 2025

✅ Previously successful run of [Test] PR Suite Desktop e2e tests workflow has been found.
⏭️ Skipping tests for this run.
💡 If you are unsure about your latest changes, please rerun the workflow manually. (Use the Re-run all jobs option)

@trezor-bot
Copy link

trezor-bot bot commented May 30, 2025

✅ Previously successful run of [Test] PR Suite Web e2e tests workflow has been found.
⏭️ Skipping tests for this run.
💡 If you are unsure about your latest changes, please rerun the workflow manually. (Use the Re-run all jobs option)

@martykan martykan added the no-project This label is used to specify that PR doesn't need to be added to a project label May 30, 2025
@github-project-automation github-project-automation bot moved this to 🎯 To do in Suite Mobile May 30, 2025
@martykan martykan moved this to 🏃‍♀️ In progress in Suite Desktop May 30, 2025
@martykan martykan moved this from 🎯 To do to 🏃‍♀️ In progress in Suite Mobile May 30, 2025
@martykan martykan moved this from 🏃‍♀️ In progress to 🔎 Needs review in Suite Desktop May 30, 2025
@martykan martykan marked this pull request as ready for review May 30, 2025 19:15
@martykan martykan requested review from a team and tomasklim as code owners May 30, 2025 19:15
@martykan martykan requested review from matejkriz and mroz22 May 30, 2025 19:15
Copy link
Contributor

@mroz22 mroz22 left a comment

Choose a reason for hiding this comment

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

looks ok, but somebody from desktop and mobile should approve probably, not me.
@Lemonexe, @matejkriz maybe?

Copy link
Member

@matejkriz matejkriz left a comment

Choose a reason for hiding this comment

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

Thanks, works as expected on mobile (haven't test on desktop/web). I would not take this as "the way" we will apply on more shared packages in the future, but for the analytics specifically, the solution looks good 👌

@martykan martykan requested a review from Lemonexe June 2, 2025 14:46
Copy link
Contributor

@Lemonexe Lemonexe left a comment

Choose a reason for hiding this comment

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

LGTM. After explanation the structure is clear, so please update the README.mds and it's good to go 🚢

I tested only superficially, that some analytics in Suite Web are sent, and bear sensible values.

@martykan martykan force-pushed the feat/redux-extra-analytics-report branch from e65e86b to 02bc7e6 Compare June 3, 2025 07:22
@trezor-bot
Copy link

trezor-bot bot commented Jun 3, 2025

✅ Previously successful run of [Test] PR Suite Desktop e2e tests workflow has been found.
⏭️ Skipping tests for this run.
💡 If you are unsure about your latest changes, please rerun the workflow manually. (Use the Re-run all jobs option)

@trezor-bot
Copy link

trezor-bot bot commented Jun 3, 2025

✅ Previously successful run of [Test] PR Suite Web e2e tests workflow has been found.
⏭️ Skipping tests for this run.
💡 If you are unsure about your latest changes, please rerun the workflow manually. (Use the Re-run all jobs option)

@martykan
Copy link
Member Author

martykan commented Jun 3, 2025

READMEs updated, main one is here

@martykan martykan merged commit fc32af2 into develop Jun 3, 2025
78 of 79 checks passed
@martykan martykan deleted the feat/redux-extra-analytics-report branch June 3, 2025 09:00
@github-project-automation github-project-automation bot moved this from 🔎 Needs review to 🤝 Needs QA in Suite Desktop Jun 3, 2025
@bosomt bosomt moved this from 🤝 Needs QA to ✅ Approved in Suite Desktop Jun 4, 2025
@bosomt
Copy link
Contributor

bosomt commented Jun 4, 2025

QA OK

Info:

  • Suite version: desktop 25.6.1 (d14eb88)
  • Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) TrezorSuite/25.6.1 Chrome/136.0.7103.49 Electron/36.2.0 Safari/537.36
  • OS: MacIntel
  • Screen: 1512x982
  • Device: Trezor T3T1 2.8.10 bitcoin-only (revision 2a65d18200580005dc419b9569ed97fae440806a)
  • Transport: BridgeTransport 3.0.0-bundled.25.6.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-project This label is used to specify that PR doesn't need to be added to a project
Projects
Status: ✅ Approved
Status: 🏃‍♀️ In progress
Development

Successfully merging this pull request may close these issues.

6 participants