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

feat(ramp): offramp analytics #7637

Merged
merged 63 commits into from
Nov 15, 2023
Merged

feat(ramp): offramp analytics #7637

merged 63 commits into from
Nov 15, 2023

Conversation

georgeweiler
Copy link
Contributor

@georgeweiler georgeweiler commented Oct 27, 2023

Description

Related issues

N/A - we do not track analytics issues here in github

Manual testing steps

Check analytics event logs and confirm the sell events are triggered

Screenshots/Recordings

Before

After

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.

@georgeweiler georgeweiler requested a review from a team as a code owner October 27, 2023 20:09
@github-actions
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.

@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Oct 27, 2023
@codecov-commenter
Copy link

codecov-commenter commented Oct 27, 2023

Codecov Report

Attention: 44 lines in your changes are missing coverage. Please review.

Comparison is base (dcd0f64) 36.64% compared to head (0e4328c) 36.73%.

Files Patch % Lines
app/components/UI/Ramp/index.tsx 0.00% 12 Missing ⚠️
app/components/UI/Ramp/buy/Views/Quotes/Quotes.tsx 75.86% 2 Missing and 5 partials ⚠️
...p/components/UI/Ramp/common/Views/OrderDetails.tsx 0.00% 6 Missing ⚠️
...ents/UI/Ramp/buy/hooks/useHandleSuccessfulOrder.ts 0.00% 4 Missing ⚠️
...s/UI/Ramp/common/containers/CustomActionButton.tsx 0.00% 4 Missing ⚠️
app/components/UI/Ramp/buy/Views/Checkout.tsx 0.00% 3 Missing ⚠️
...pp/components/UI/Ramp/buy/hooks/useInAppBrowser.ts 0.00% 3 Missing ⚠️
...onents/UI/Ramp/buy/Views/GetStarted/GetStarted.tsx 80.00% 0 Missing and 1 partial ⚠️
...ponents/UI/Ramp/common/Views/Settings/Settings.tsx 0.00% 1 Missing ⚠️
...s/UI/Ramp/common/components/PaymentMethodModal.tsx 75.00% 0 Missing and 1 partial ⚠️
... and 2 more
Additional details and impacted files
@@                Coverage Diff                @@
##           feat/off-ramp    #7637      +/-   ##
=================================================
+ Coverage          36.64%   36.73%   +0.08%     
=================================================
  Files               1052     1052              
  Lines              28040    28092      +52     
  Branches            2453     2485      +32     
=================================================
+ Hits               10276    10320      +44     
- Misses             17188    17193       +5     
- Partials             576      579       +3     

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

@wachunei
Copy link
Member

Please mark as Draft until PR is ready for review and all checks are passing 🙏

Copy link
Member

@wachunei wachunei left a comment

Choose a reason for hiding this comment

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

Changes requested, main changes requested are: use isBuy/isSell instead of RampType and revert our analytics internal interface to be decoupled of current MMetrics implementation. I did not see any changes related to tests, we must create tests to confirm the off-ramp methods are being called when isBuy is false (you can do this by mocking the sdk hook)

Please use the conventional commit on the PR title (eg: feat(ramp): <description>, refactor(ramp): <description> and set is as draft instead of using WIP in the title.

app/components/UI/Ramp/buy/Views/Quotes/Quotes.tsx Outdated Show resolved Hide resolved
app/components/UI/Ramp/buy/Views/Quotes/Quotes.tsx Outdated Show resolved Hide resolved
app/components/UI/Ramp/index.tsx Outdated Show resolved Hide resolved
app/components/UI/Tokens/index.tsx Outdated Show resolved Hide resolved
app/components/Views/Asset/index.js Outdated Show resolved Hide resolved
app/components/Views/SendFlow/SendTo/index.js Outdated Show resolved Hide resolved
app/components/Views/WalletActions/WalletActions.tsx Outdated Show resolved Hide resolved
@georgeweiler georgeweiler changed the title WIP: Feat/offramp analytics feat(ramp): offramp analytics Nov 6, 2023
@georgeweiler georgeweiler marked this pull request as draft November 6, 2023 20:09
@metamaskbot metamaskbot removed the INVALID-PR-TEMPLATE PR's body doesn't match template label Nov 6, 2023
#7831)

## **Description**
This fixes the incorrect assignment of `currency_source` and
`currency_destination` definitions in the offramp analytics payloads.

## **Related issues**
N/A

## **Manual testing steps**
Check logs when analytics trigger and verify the source/destination
values

## **Screenshots/Recordings**
N/A

### **Before**
N/A

### **After**
N/A

## **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.
@lorenzosantos
Copy link

QA'd in simulator--LGTM!

Copy link
Member

@wachunei wachunei left a comment

Choose a reason for hiding this comment

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

One little change

app/components/UI/Ramp/common/components/RegionModal.tsx Outdated Show resolved Hide resolved
@wachunei wachunei added ramp-qa-passed and removed needs-ramp-qa Tickets that need feature QA on the ramps flows labels Nov 15, 2023
@wachunei wachunei removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Nov 15, 2023
Copy link
Member

@wachunei wachunei 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

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 7 Code Smells

61.3% 61.3% Coverage
0.0% 0.0% Duplication

@wachunei wachunei merged commit b4a91b5 into feat/off-ramp Nov 15, 2023
25 checks passed
@wachunei wachunei deleted the feat/offramp-analytics branch November 15, 2023 22:12
@github-actions github-actions bot locked and limited conversation to collaborators Nov 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants