Skip to content
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

chore(runway): cherry-pick fix: metrics call during onboarding #13284

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

runway-github[bot]
Copy link
Contributor

@runway-github runway-github bot commented Jan 30, 2025

Description

  • refactor track trackOnboarding calls to pass an event built with
    MetricsEventBuilder
  • pass the properties with MetricsEventBuilder.addProperties

Related issues

Fixes https://github.com/MetaMask/mobile-planning/issues/2122

Manual testing steps

Feature: track metrics during onboarding

  Scenario: user creates new wallet
    Given a freshly installed app
    And user opted in for metrics
    When user creates a new wallet
    And user enters a new password
    Then no 'TRACK event saved {"event": undefined, "properties": {}, "type": "track"}' log is visible
    And the "Wallet Setup Started", "Wallet Created" and "Wallet Setup Completed" log is visible

  Scenario: user imports wallet
    Given a freshly installed app
    And user opted in for metrics
    When user imports a wallet
    And user enters a new password
    Then no 'TRACK event saved {"event": undefined, "properties": {}, "type": "track"}' log is visible
    And the "Wallet Import Started", "Wallet Imported" and "Wallet Setup Completed" log is visible

  Scenario: user manually backs the wallet up
    Given a freshly installed app
    And user opted in for metrics
    And user created a new wallet
    When user saves SRP
    Then no 'TRACK event saved {"event": undefined, "properties": {}, "type": "track"}' log is visible
    And the "Wallet Security Started", "Manual Backup Initiated", "Phrase Revealed", "Phrase Confirmed" and "Wallet Security Completed" log is visible

  Scenario: user skips wallet backup
    Given a freshly installed app
    And user opted in for metrics
    And user created a new wallet
    When user skips SRP backup by touching "remind me later"
    Then no 'TRACK event saved {"event": undefined, "properties": {}, "type": "track"}' log is visible
    And the "Wallet Security Skip Initiated", "Wallet Security Skip Confirmed" and "Automatic Security Checks Prompt Viewed" log is visible

Screenshots/Recordings

Before

INFO  TRACK event saved {"event": undefined, "properties": {}, "type": "track"}

After

examples of fixed event tracking

INFO  TRACK event saved {"event": "Wallet Setup Started", "properties": {}, "type": "track"}
INFO  TRACK event saved {"event": "Wallet Created", "properties": {"biometrics_enabled": false}, "type": "track"}
INFO  TRACK event saved {"event": "Wallet Setup Completed", "properties": {"new_wallet": true, "wallet_setup_type": "new"}, "type": "track"}
INFO  TRACK event saved {"event": "Wallet Import Started", "properties": {}, "type": "track"}
INFO  TRACK event saved {"event": "Wallet Imported", "properties": {"biometrics_enabled": false}, "type": "track"}
INFO  TRACK event saved {"event": "Wallet Setup Completed", "properties": {"new_wallet": false, "wallet_setup_type": "import"}, "type": "track"}
INFO  TRACK event saved {"event": "Wallet Security Skip Initiated", "properties": {}, "type": "track"}
INFO  TRACK event saved {"event": "Wallet Security Skip Confirmed", "properties": {}, "type": "track"}
INFO  TRACK event saved {"event": "Automatic Security Checks Prompt Viewed", "properties": {"applicationVersion": "7.37.1", "currentBuildNumber": "1520", "deviceBrand": "Apple", "operatingSystemVersion": "18.2", "platform": "ios"}, "type": "track"}
INFO  TRACK event saved {"event": "Wallet Security Reminder Dismissed", "properties": {"source": "Backup Alert", "wallet_protection_required": false}, "type": "track"}

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the
    app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described
    in the ticket it closes and includes the necessary testing evidence such
    as recordings and or screenshots.

Co-authored-by: sethkfman [email protected] b5992b0

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

- refactor track trackOnboarding calls to pass an event built with
MetricsEventBuilder
- pass the properties with MetricsEventBuilder.addProperties

## **Related issues**

Fixes MetaMask/mobile-planning#2122

## **Manual testing steps**

```gherkin
Feature: track metrics during onboarding

  Scenario: user creates new wallet
    Given a freshly installed app
    And user opted in for metrics
    When user creates a new wallet
    And user enters a new password
    Then no 'TRACK event saved {"event": undefined, "properties": {}, "type": "track"}' log is visible
    And the "Wallet Setup Started", "Wallet Created" and "Wallet Setup Completed" log is visible

  Scenario: user imports wallet
    Given a freshly installed app
    And user opted in for metrics
    When user imports a wallet
    And user enters a new password
    Then no 'TRACK event saved {"event": undefined, "properties": {}, "type": "track"}' log is visible
    And the "Wallet Import Started", "Wallet Imported" and "Wallet Setup Completed" log is visible

  Scenario: user manually backs the wallet up
    Given a freshly installed app
    And user opted in for metrics
    And user created a new wallet
    When user saves SRP
    Then no 'TRACK event saved {"event": undefined, "properties": {}, "type": "track"}' log is visible
    And the "Wallet Security Started", "Manual Backup Initiated", "Phrase Revealed", "Phrase Confirmed" and "Wallet Security Completed" log is visible

  Scenario: user skips wallet backup
    Given a freshly installed app
    And user opted in for metrics
    And user created a new wallet
    When user skips SRP backup by touching "remind me later"
    Then no 'TRACK event saved {"event": undefined, "properties": {}, "type": "track"}' log is visible
    And the "Wallet Security Skip Initiated", "Wallet Security Skip Confirmed" and "Automatic Security Checks Prompt Viewed" log is visible
```

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

```
INFO  TRACK event saved {"event": undefined, "properties": {}, "type": "track"}
```

### **After**
examples of fixed event tracking
```
INFO  TRACK event saved {"event": "Wallet Setup Started", "properties": {}, "type": "track"}
INFO  TRACK event saved {"event": "Wallet Created", "properties": {"biometrics_enabled": false}, "type": "track"}
INFO  TRACK event saved {"event": "Wallet Setup Completed", "properties": {"new_wallet": true, "wallet_setup_type": "new"}, "type": "track"}
```

```
INFO  TRACK event saved {"event": "Wallet Import Started", "properties": {}, "type": "track"}
INFO  TRACK event saved {"event": "Wallet Imported", "properties": {"biometrics_enabled": false}, "type": "track"}
INFO  TRACK event saved {"event": "Wallet Setup Completed", "properties": {"new_wallet": false, "wallet_setup_type": "import"}, "type": "track"}
```

```
INFO  TRACK event saved {"event": "Wallet Security Skip Initiated", "properties": {}, "type": "track"}
INFO  TRACK event saved {"event": "Wallet Security Skip Confirmed", "properties": {}, "type": "track"}
INFO  TRACK event saved {"event": "Automatic Security Checks Prompt Viewed", "properties": {"applicationVersion": "7.37.1", "currentBuildNumber": "1520", "deviceBrand": "Apple", "operatingSystemVersion": "18.2", "platform": "ios"}, "type": "track"}
INFO  TRACK event saved {"event": "Wallet Security Reminder Dismissed", "properties": {"source": "Backup Alert", "wallet_protection_required": false}, "type": "track"}
```
## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

---------

Co-authored-by: sethkfman <[email protected]>
@runway-github runway-github bot requested review from a team as code owners January 30, 2025 21:42
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

Copy link
Contributor

@sethkfman sethkfman left a comment

Choose a reason for hiding this comment

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

LGTM

@sethkfman sethkfman added the Run Smoke E2E Triggers smoke e2e on Bitrise label Jan 30, 2025
Copy link
Contributor

github-actions bot commented Jan 30, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 88e1e94
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/fbf5edb4-7e6c-4b53-b5b4-2d16fc179890

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@sethkfman sethkfman merged commit 3755483 into release/7.39.0 Jan 30, 2025
37 of 39 checks passed
@sethkfman sethkfman deleted the runway-cherry-pick-7.39.0-1738273349 branch January 30, 2025 21:56
@github-actions github-actions bot locked and limited conversation to collaborators Jan 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Run Smoke E2E Triggers smoke e2e on Bitrise team-runway-bot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants