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: Bump Snaps packages #26086

Merged
merged 21 commits into from
Aug 15, 2024
Merged

chore: Bump Snaps packages #26086

merged 21 commits into from
Aug 15, 2024

Conversation

Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Jul 24, 2024

Description

This bumps all Snaps packages to the latest versions and handles breaking changes. It also introduces some new components and RPC methods.

Summary of changes in the snaps deps:

  • Add new snap_dialog confirmation type that uses fully custom UI
  • Add Container and Footer component
  • Add RadioGroup component
  • Add Card component
  • Add snap_getPreferences to return user preferences
  • Add snap_resolveInterface to resolve existing interfaces
  • Handle initial connections for preinstalled Snaps
  • Enforce stricter size limits for source code, static auxiliary files, and snap_getFile return values
  • Account for revoked origins when calculating the difference in initialConnections

Closes https://github.com/MetaMask/MetaMask-planning/issues/1571
Closes https://github.com/MetaMask/MetaMask-planning/issues/2125
Closes MetaMask/snaps#2622
Closes https://github.com/MetaMask/MetaMask-planning/issues/1956

Open in GitHub Codespaces

@Mrtenz Mrtenz added the team-snaps-platform Snaps Platform team label Jul 24, 2024
@Mrtenz Mrtenz changed the title Bump Snaps packages chore: Bump Snaps packages Jul 24, 2024
Copy link

socket-security bot commented Jul 24, 2024

Copy link

socket-security bot commented Jul 24, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

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

View full report↗︎

@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Jul 24, 2024
package.json Outdated Show resolved Hide resolved
@Mrtenz
Copy link
Member Author

Mrtenz commented Jul 25, 2024

@SocketSecurity ignore npm/@metamask/snaps-utils@7.8.1

This is ours.

@FrederikBolding FrederikBolding force-pushed the mrtenz/bump-snaps-packages branch 2 times, most recently from b4170e0 to 8fa0ef5 Compare July 31, 2024 13:39
@FrederikBolding
Copy link
Member

@SocketSecurity ignore npm/@metamask/snaps-utils@8.0.0

Network access expected.

Copy link
Contributor

github-actions bot commented Aug 1, 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.

@FrederikBolding
Copy link
Member

https://github.com/SocketSecurity ignore npm/@metamask/snaps-utils@8.0.1

Network access expected.

@FrederikBolding FrederikBolding force-pushed the mrtenz/bump-snaps-packages branch 2 times, most recently from a1d3b3c to 71dc9ed Compare August 13, 2024 15:06
@FrederikBolding FrederikBolding marked this pull request as ready for review August 14, 2024 08:25
@FrederikBolding FrederikBolding requested review from a team and kumavis as code owners August 14, 2024 08:25
@metamaskbot
Copy link
Collaborator

Builds ready [71dc9ed]
Page Load Metrics (563 ± 420 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint712561324723
domContentLoaded88428178
load382720563875420
domInteractive88427178
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 97.39 KiB (2.75%)
  • ui: 13.39 KiB (0.19%)
  • common: 276.35 KiB (3.92%)

Copy link

codecov bot commented Aug 14, 2024

Codecov Report

Attention: Patch coverage is 63.33333% with 11 lines in your changes missing coverage. Please review.

Project coverage is 70.03%. Comparing base (0a03bd8) to head (b5a9f55).
Report is 18 commits behind head on develop.

Files Patch % Lines
...i/pages/confirmations/confirmation/confirmation.js 70.37% 8 Missing ⚠️
app/scripts/background.js 0.00% 1 Missing ⚠️
app/scripts/metamask-controller.js 0.00% 1 Missing ⚠️
ui/helpers/utils/permission.js 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #26086      +/-   ##
===========================================
+ Coverage    69.97%   70.03%   +0.05%     
===========================================
  Files         1422     1426       +4     
  Lines        49930    50041     +111     
  Branches     13861    13885      +24     
===========================================
+ Hits         34938    35042     +104     
- Misses       14992    14999       +7     

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

FrederikBolding and others added 9 commits August 14, 2024 12:34
### Waiting on release of: MetaMask/snaps#2592

## **Description**
This PR integrates new Radio components for Snap UI.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26181?quickstart=1)

## **Related issues**
Fixes: MetaMask/MetaMask-planning#1571

## **Manual testing steps**
1. Go to `Test Snaps` and install `Interactive UI Snap`.
2. Run Interactive UI Snap by creating a dialog.
3. Check that radio options are available in the UI and confirm their
functionality. (Latest Test Snaps needs to be released before this is
possible, use `main` branch in Snaps repo and run locally if necessary)

## **Screenshots/Recordings**
### **Before**
Nothing to show. Radio options were not available before.

### **After**
![Screenshot 2024-07-29 at 11 29
00](https://github.com/user-attachments/assets/f978ffc5-9c50-4031-a001-4af46f7674fe)
![Screenshot 2024-07-29 at 11 29
17](https://github.com/user-attachments/assets/b8659e75-af9c-455f-a1f1-9fd87b59e35e)
![Screenshot 2024-07-29 at 11 29
40](https://github.com/user-attachments/assets/4d86e1d2-858d-41e8-b383-6c17b711ad1f)

## **Pre-merge author checklist**
- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.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-extension/blob/develop/.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**

This PR adds the support for custom dialogs.

Major changes:
- Add support for `Footer` and `Container` custom UI components
- Refactor `snap-ui-renderer` to handle display of the snap header
- Add the new `snap_resolveInterface` snap RPC method
- Add the new `default` dialog type

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26304?quickstart=1)

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to test-snaps
2. trigger the `custom` snap dialog

## **Screenshots/Recordings**

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

### **Before**

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

### **After**

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

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.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-extension/blob/develop/.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: Maarten Zuidhoorn <maarten@zuidhoorn.com>
Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
@metamaskbot
Copy link
Collaborator

Builds ready [5bd74fd]
Page Load Metrics (376 ± 298 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint5813996199
domContentLoaded95624136
load451684376621298
domInteractive95624136
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 100.39 KiB (2.75%)
  • ui: 13.39 KiB (0.19%)
  • common: 271.24 KiB (3.85%)

"message": "Let $1 access information like your preferred language and fiat currency in your MetaMask settings. This helps $1 display content tailored to your preferences. ",
"description": "An extended description for the `snap_getPreferences` permission. $1 is the snap name."
},

Copy link
Member Author

Choose a reason for hiding this comment

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

Seems to be an unnecessary whitespace here.

Copy link
Member

Choose a reason for hiding this comment

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

Good catch, fixed!

(curious how the linter doesn't complain about this)

@metamaskbot
Copy link
Collaborator

Builds ready [8b396dd]
Page Load Metrics (193 ± 238 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint712931166129
domContentLoaded981282211
load402346193496238
domInteractive981282211
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 100.39 KiB (2.75%)
  • ui: 13.35 KiB (0.19%)
  • common: 271.24 KiB (3.85%)

david0xd
david0xd previously approved these changes Aug 15, 2024
Copy link
Member Author

@Mrtenz Mrtenz left a comment

Choose a reason for hiding this comment

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

Looks good to me. Can't approve my own PR.

Copy link

sonarcloud bot commented Aug 15, 2024

Copy link
Member

@FrederikBolding FrederikBolding left a comment

Choose a reason for hiding this comment

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

Approving for @Mrtenz - given that I took over this PR

@FrederikBolding FrederikBolding dismissed GuillaumeRx’s stale review August 15, 2024 11:55

Stale comment - and Guillaume is OOO

@metamaskbot
Copy link
Collaborator

Builds ready [b5a9f55]
Page Load Metrics (445 ± 363 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint611731113115
domContentLoaded107323178
load482368445755363
domInteractive107323178
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 100.39 KiB (2.75%)
  • ui: 13.35 KiB (0.19%)
  • common: 271.24 KiB (3.85%)

Copy link
Contributor

@jpuri jpuri left a comment

Choose a reason for hiding this comment

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

Changes in files owned by confirmations team look good 👍

@FrederikBolding FrederikBolding merged commit f461e37 into develop Aug 15, 2024
78 checks passed
@FrederikBolding FrederikBolding deleted the mrtenz/bump-snaps-packages branch August 15, 2024 18:41
@github-actions github-actions bot locked and limited conversation to collaborators Aug 15, 2024
@metamaskbot metamaskbot added the release-12.4.0 Issue or pull request that will be included in release 12.4.0 label Aug 15, 2024
@gauthierpetetin gauthierpetetin added release-12.3.0 Issue or pull request that will be included in release 12.3.0 and removed release-12.4.0 Issue or pull request that will be included in release 12.4.0 labels Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
INVALID-PR-TEMPLATE PR's body doesn't match template release-12.3.0 Issue or pull request that will be included in release 12.3.0 team-snaps-platform Snaps Platform team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add snap_getPreferences
7 participants