Skip to content

chore: Bump Snaps packages #15232

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 9 commits into from
May 13, 2025
Merged

chore: Bump Snaps packages #15232

merged 9 commits into from
May 13, 2025

Conversation

Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented May 8, 2025

Description

This bumps Snaps packages to the latest versions. The main changes are:

  • Support for snap_trackEvent.
  • The execution environment is now built with @lavamoat/webpack, resulting in a smaller bundle.
  • Several small performance optimisations and fixes.

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.

@metamaskbot metamaskbot added the team-snaps-platform Snaps Platform team label May 8, 2025
@Mrtenz Mrtenz added needs-qa Any New Features that needs a full manual QA prior to being added to a release. Run Smoke E2E Requires smoke E2E testing labels May 8, 2025
Copy link
Contributor

github-actions bot commented May 8, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: e5ac49c
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/de00b23a-4026-4da9-a6e5-1aac88d6092f

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

@Mrtenz Mrtenz added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels May 8, 2025
Copy link
Contributor

github-actions bot commented May 8, 2025

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: ad064e3
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/7fbb3c3f-2dcf-4723-9bf7-527906cac1b0

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

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.

Mrtenz and others added 7 commits May 13, 2025 10:25
…14428)

## **Description**
This PR adds MetaMetrics tracking hook to Snap controller init. This way
we delegate Snap export tracking to Snap controller.

## **Related issues**
Related PR:
MetaMask/snaps#3281
MetaMask/metamask-extension#31553 

## **Notes**
- Requires Snaps release.
- Snaps PR: MetaMask/snaps#3281
- Targets Snaps release when ready.

## **Manual testing steps**
1. TBD

## **Screenshots/Recordings**
### **Before**
n/a

### **After**
n/a

## **Pre-merge author checklist**
- [ ] 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).
- [ ] 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](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.

## **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.
## **Description**
Add integration for new RPC method: `snap_trackEvent`

SIP-32: https://metamask.github.io/SIPs/SIPS/sip-32

Related PRs:
- Snaps: MetaMask/snaps#3375
- Extension: MetaMask/metamask-extension#32554

## **Related issues**
MetaMask/snaps#3274

## **Manual testing steps**
1. Within some of the preinstalled Snaps use `snap_trackEvent` RPC
method and send some tracking data in format specified in
[SIP-32](https://metamask.github.io/SIPs/SIPS/sip-32).
2. Find a way and verify that the event is sent (intercept MetaMetrics
track event method or check with other e2e metrics testing utilities)

Example Snap code used for testing the method:
```typescript
await snap.request({
  method: 'snap_trackEvent',
  params: {
    event: {
      event: 'SnapExportUsed',
      properties: {
        export: 'onRpcRequest',
        origin: 'https://metamask.io',
        snap_category: null,
        snap_id: 'npm:@metamask/example-snap',
        success: true,
      },
      sensitiveProperties: {
        transaction_hash: 'transaction-hash',
      },
    },
  },
});
```

## **Screenshots/Recordings**
### **Before**
n/a

### **After**
n/a

## **Pre-merge author checklist**
- [ ] 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).
- [ ] 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](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.

## **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.
@Mrtenz Mrtenz force-pushed the mrtenz/snaps-104 branch from a5c1d0e to e90e1d4 Compare May 13, 2025 08:25
Copy link

socket-security bot commented May 13, 2025

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring alerts on:

View full report

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 68.67%. Comparing base (5113000) to head (e90e1d4).
Report is 27 commits behind head on main.

Files with missing lines Patch % Lines
...e/Engine/controllers/snaps/snap-controller-init.ts 0.00% 1 Missing ⚠️
app/core/Snaps/SnapsMethodMiddleware.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15232      +/-   ##
==========================================
+ Coverage   68.46%   68.67%   +0.21%     
==========================================
  Files        2372     2378       +6     
  Lines       51275    51372      +97     
  Branches     7634     7652      +18     
==========================================
+ Hits        35103    35281     +178     
+ Misses      13942    13846      -96     
- Partials     2230     2245      +15     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Mrtenz Mrtenz added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels May 13, 2025
Copy link
Contributor

github-actions bot commented May 13, 2025

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 0cb2531
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/59f5cbf5-6116-4c42-ba51-c3da605905d9

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

@Mrtenz Mrtenz marked this pull request as ready for review May 13, 2025 09:39
@Mrtenz Mrtenz requested a review from a team as a code owner May 13, 2025 09:39
@Mrtenz Mrtenz requested a review from a team as a code owner May 13, 2025 09:39
@FrederikBolding FrederikBolding added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label May 13, 2025
@Mrtenz
Copy link
Member Author

Mrtenz commented May 13, 2025

@SocketSecurity ignore npm/@metamask/[email protected]

This is ours.

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
66.7% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@Mrtenz Mrtenz removed the needs-qa Any New Features that needs a full manual QA prior to being added to a release. label May 13, 2025
@Mrtenz Mrtenz added this pull request to the merge queue May 13, 2025
Merged via the queue into main with commit 8f1f519 May 13, 2025
40 of 43 checks passed
@Mrtenz Mrtenz deleted the mrtenz/snaps-104 branch May 13, 2025 12:07
@github-actions github-actions bot locked and limited conversation to collaborators May 13, 2025
@metamaskbot metamaskbot added the release-7.48.0 Issue or pull request that will be included in release 7.48.0 label May 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.48.0 Issue or pull request that will be included in release 7.48.0 Run Smoke E2E Requires smoke E2E testing skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-snaps-platform Snaps Platform team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants