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: Cherry pick 2506358 (merge in trackEvent work) #12415

Merged
merged 4 commits into from
Nov 25, 2024

Conversation

kylanhurt
Copy link
Contributor

Important

The issue is due to the fact that MetaMetrics.trackEvent method has
multiple signatures to handle the backward compatibility with old ways to call it.
After discussion (see the change history of this description), we
decided to remove backward compatibility and the multiple signature system. We are going to simplify and then fix all the trackEvent calls.
Asside from the changes in MetaMetrics and useMetrics hook (and tests) all the changes should be on the calls of trackEvent.

  • removes multiple signature MetaMetrics.trackEvent
  • updates MetaMetrics unit tests
  • updates useMetrics hook
  • updates useMetrics hook unit tests
  • deletes now useless legacy compatibility utils
  • updates all trackEvent calls
  • updates all unit tests that test trackEvent calls

Fixes #12117

  1. navigate the app
  2. check trackEvent is called (check app logs)
events-1.mov
events-2.mov

N/A

N/A

  • I’ve followed MetaMask Contributor Docs and MetaMask Mobile Coding
    Standards
    .

  • I've completed the PR template to the best of my ability

  • 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 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.


Description

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

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.

<!--
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.
-->

> [!IMPORTANT]
> The issue is due to the fact that `MetaMetrics.trackEvent` method has
multiple signatures to handle the backward compatibility with old ways
to call it.
> After discussion (see the change history of this description), we
decided to remove backward compatibility and the multiple signature
system. We are going to simplify and then fix all the `trackEvent`
calls.
Asside from the changes in `MetaMetrics` and `useMetrics` hook (and
tests) all the changes should be on the calls of `trackEvent`.

- removes multiple signature `MetaMetrics.trackEvent`
- updates `MetaMetrics` unit tests
- updates `useMetrics` hook
- updates `useMetrics` hook unit tests
- deletes now useless legacy compatibility utils
- updates all `trackEvent` calls
- updates all unit tests that test `trackEvent` calls

Fixes #12117

1. navigate the app
2. check trackEvent is called (check app logs)

https://github.com/user-attachments/assets/058f6607-eda1-4eb5-bcae-a774deb13648

https://github.com/user-attachments/assets/fa0816cf-5459-4825-a162-a9a2e87c86ac

N/A

N/A

- [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.

- [ ] 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: Frank von Hoven <[email protected]>
Co-authored-by: Frank von Hoven <[email protected]>
@kylanhurt kylanhurt added the Run Smoke E2E Triggers smoke e2e on Bitrise label Nov 25, 2024
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.

@kylanhurt kylanhurt marked this pull request as ready for review November 25, 2024 19:01
@kylanhurt kylanhurt requested review from a team as code owners November 25, 2024 19:01
Copy link
Contributor

github-actions bot commented Nov 25, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 30a2c9f
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/55b34ba5-2d62-4554-8e57-7f4494532f5b

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

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

Copy link

sonarcloud bot commented Nov 25, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
41.1% Coverage on New Code (required ≥ 60%)

See analysis details on SonarQube Cloud

@sethkfman sethkfman added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Nov 25, 2024
@sethkfman sethkfman merged commit 5bd749c into release/7.36.0 Nov 25, 2024
34 of 36 checks passed
@sethkfman sethkfman deleted the cherry-pick-2506358 branch November 25, 2024 22:23
@github-actions github-actions bot locked and limited conversation to collaborators Nov 25, 2024
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 skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-mobile-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants