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

fix: add identify metrics call at metrics instance setup #8888

Merged
merged 4 commits into from
Mar 14, 2024

Conversation

NicolasMassart
Copy link
Contributor

@NicolasMassart NicolasMassart commented Mar 8, 2024

Description

adds identify call at the end of metrics config

Related issues

Fixes #8885

Manual testing steps

Feature: identify on start

  Scenario: fresh install
    Given app is a fresh installed
    And first screen appears
    Then logs should display "MetaMetrics configured with ID: [UUID]"
    And no event is sent

  Scenario: wallet created
    Given wallet was created
    And user accepted metrics
    And first screen appears
    Then logs should display "INFO  IDENTIFY event saved {...}"
    And at least 1 event is sent

Screenshots/Recordings

Before

No IDENTIFY log at startup

After

image

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

@NicolasMassart NicolasMassart added team-mobile-platform needs-smoke-e2e Run Smoke E2E Triggers smoke e2e on Bitrise release-7.18.0 Issue or pull request that will be included in release 7.18.0 labels Mar 8, 2024
@NicolasMassart NicolasMassart self-assigned this Mar 8, 2024
@NicolasMassart NicolasMassart requested a review from a team as a code owner March 8, 2024 14:56
Copy link
Contributor

github-actions bot commented Mar 8, 2024

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.

@NicolasMassart NicolasMassart added the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Mar 8, 2024
Copy link
Contributor

github-actions bot commented Mar 8, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 2fac555
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/7d386cac-8a7b-478d-86eb-3d3e4c8e755e

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

sethkfman
sethkfman previously approved these changes Mar 8, 2024
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

@Cal-L
Copy link
Contributor

Cal-L commented Mar 14, 2024

@NicolasMassart Created a fix for the unit test pointing to this PR - #8928

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

This PR fixes the test failure for
`app/util/metrics/trackDappViewedEvent/index.test.ts`. It does so by
mocking the module
`../../../util/metrics/UserSettingsAnalyticsMetaData/generateUserProfileAnalyticsMetaData`,
which was causing the failure.

## **Related issues**

Fixes:

## **Manual testing steps**

Run `yarn jest app/util/metrics/trackDappViewedEvent/index.test.ts` and
notice that the test passes

## **Screenshots/Recordings**

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

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->
<img width="1176" alt="image"
src="https://github.com/MetaMask/metamask-mobile/assets/10508597/72f97136-0bba-46f6-a88c-df96854bc105">


## **Pre-merge author checklist**

- [ ] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've clearly explained what problem this PR is solving and how it
is solved.
- [ ] I've linked related issues
- [ ] I've included manual testing steps
- [ ] I've included screenshots/recordings if applicable
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] 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.
- [ ] I’ve properly set the pull request status:
  - [ ] In case it's not yet "ready for review", I've set it to "draft".
- [ ] In case it's "ready for review", I've changed it from "draft" to
"non-draft".

## **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.
@Cal-L Cal-L added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Mar 14, 2024
Copy link
Contributor

github-actions bot commented Mar 14, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 56000f7
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/83f8e717-4a75-4c92-b61c-696654fa9093

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

@codecov-commenter
Copy link

codecov-commenter commented Mar 14, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 43.26%. Comparing base (6224e2f) to head (f86b1c8).

Files Patch % Lines
app/core/Analytics/MetaMetrics.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8888      +/-   ##
==========================================
- Coverage   43.27%   43.26%   -0.01%     
==========================================
  Files        1271     1271              
  Lines       30918    30920       +2     
  Branches     3092     3092              
==========================================
  Hits        13379    13379              
- Misses      16766    16769       +3     
+ Partials      773      772       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

sonarcloud bot commented Mar 14, 2024

@Cal-L Cal-L added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Mar 14, 2024
Copy link
Contributor

github-actions bot commented Mar 14, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: f86b1c8
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/8f46559b-a421-46e4-b808-4c68d706eb1a

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

Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

LGTM

@Cal-L Cal-L merged commit b31e754 into main Mar 14, 2024
31 of 34 checks passed
@Cal-L Cal-L deleted the fix/8885_add_identify branch March 14, 2024 01:56
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Mar 14, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 14, 2024
@metamaskbot metamaskbot added the release-7.19.0 Issue or pull request that will be included in release 7.19.0 label Mar 14, 2024
@metamaskbot metamaskbot removed the release-7.19.0 Issue or pull request that will be included in release 7.19.0 label Mar 14, 2024
@metamaskbot
Copy link
Collaborator

More than one release label on PR. Keeping the lowest one (release-7.18.0) on PR and removing other release labels (release-7.19.0).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-smoke-e2e release-7.18.0 Issue or pull request that will be included in release 7.18.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-mobile-platform
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

fix: add identify metrics call at metrics instance setup
5 participants