Skip to content

Commit 119e70c

Browse files
authored
Merge pull request #30863 from MetaMask/cherry-pick-ff15246-v12.13.1
chore(cherr-pick): a new prep-deps workflow with caching (#29979)
2 parents 3852b10 + cdac264 commit 119e70c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1292
-536
lines changed

.github/CONTRIBUTING.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ There are also plenty of open issues we'd love help with. Search the [`good firs
1111
If you're picking up a bounty or an existing issue, feel free to ask clarifying questions on the issue as you go about your work.
1212

1313
### Submitting a pull request
14+
1415
When you're done with your project / bugfix / feature and ready to submit a PR, there are a couple guidelines we ask you to follow:
1516

1617
- [ ] **Make sure you followed our [`coding guidelines`](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md)**: These guidelines aim to maintain consistency and readability across the codebase. They help ensure that the code is easy to understand, maintain, and modify, which is particularly important when working with multiple contributors.

.github/ISSUE_TEMPLATE/bug-report.yml

+133-133
Original file line numberDiff line numberDiff line change
@@ -1,138 +1,138 @@
11
name: Bug Report
22
description: Using MetaMask, but it's not working as you expect?
3-
title: "[Bug]: "
4-
labels: ["type-bug"]
3+
title: '[Bug]: '
4+
labels: ['type-bug']
55
body:
6-
- type: markdown
7-
attributes:
8-
value: |
9-
Thanks for taking the time to fill out this bug report!
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for taking the time to fill out this bug report!
1010
11-
## **Before Submitting:**
11+
## **Before Submitting:**
1212
13-
* Please search to make sure this issue has not been opened already.
14-
* If this is a question about how to integrate MetaMask with your project, please ask in our [Community forum](https://community.metamask.io/c/developer-questions/) instead. This will get your question answered more quickly and make it easier for other devs to find the answer in the future.
15-
- type: textarea
16-
id: what-happened
17-
attributes:
18-
label: Describe the bug
19-
description: What happened?
20-
placeholder: A clear and concise description of what the bug is
21-
validations:
22-
required: true
23-
- type: textarea
24-
id: expected-behavior
25-
attributes:
26-
label: Expected behavior
27-
description: What did you expect to happen?
28-
- type: textarea
29-
id: screenshot-recording
30-
attributes:
31-
label: Screenshots/Recordings
32-
description: Please include screenshots/recordings if applicable!
33-
- type: textarea
34-
id: reproduce
35-
attributes:
36-
label: Steps to reproduce
37-
description: "List all steps needed to reproduce the problem:"
38-
placeholder: |
39-
1. Go to '...'
40-
2. Click on '...'
41-
3. Scroll down to '...'
42-
4. See error
43-
validations:
44-
required: true
45-
- type: textarea
46-
id: error
47-
attributes:
48-
label: Error messages or log output
49-
description: Please copy and paste any relevant error messages or log output. This will be automatically formatted, so there is no need for backticks.
50-
render: shell
51-
- type: dropdown
52-
id: stage
53-
attributes:
54-
label: Detection stage
55-
description: At what stage was the bug detected?
56-
options:
57-
- In production (default)
58-
- In beta
59-
- During release testing
60-
- On main branch
61-
- On a feature branch
62-
validations:
63-
required: true
64-
- type: input
65-
id: version
66-
attributes:
67-
label: Version
68-
description: What version of MetaMask are you running? You can find the version in "Settings" > "About"
69-
placeholder: "7.1.0"
70-
validations:
71-
required: true
72-
- type: dropdown
73-
id: build
74-
attributes:
75-
label: Build type
76-
description: Are you using a testing or development build of MetaMask? If so, please select the type of build you are using.
77-
options:
78-
- Beta
79-
- Flask
80-
- Other (please specify exactly where you obtained this build in "Additional Context" section)
81-
- type: dropdown
82-
id: browsers
83-
attributes:
84-
label: Browser
85-
description: Which browsers have you seen the problem on?
86-
multiple: true
87-
options:
88-
- Chrome
89-
- Firefox
90-
- Microsoft Edge
91-
- Brave
92-
- Other (please elaborate in the "Additional Context" section)
93-
validations:
94-
required: true
95-
- type: dropdown
96-
id: os
97-
attributes:
98-
label: Operating system
99-
description: Which operating systems have you seen the problem on?
100-
multiple: true
101-
options:
102-
- Windows
103-
- MacOS
104-
- Linux
105-
- Other (please elaborate in the "Additional Context" section)
106-
validations:
107-
required: true
108-
- type: dropdown
109-
id: hardware-wallet
110-
attributes:
111-
label: Hardware wallet
112-
description: Are you using any of these hardware wallets? Please include the firmware version in the "Additional context" section below for any that you select here.
113-
multiple: true
114-
options:
115-
- Ledger
116-
- Trezor
117-
- Keystone
118-
- GridPlus Lattice1
119-
- AirGap Vault
120-
- imToken
121-
- OneKey
122-
- Other (please elaborate in the "Additional Context" section)
123-
- type: textarea
124-
id: additional
125-
attributes:
126-
label: Additional context
127-
description: Add any other context about the problem here, e.g. related issues, additional error messages or logs, or any potentially relevant details about the environment or situation the bug occurred in.
128-
- type: textarea
129-
id: severity
130-
attributes:
131-
label: Severity
132-
description: |
133-
To be added after bug submission by internal support / PM:
134-
placeholder: |
135-
- How critical is the impact of this bug on a user?
136-
- Add stats if available on % of customers impacted
137-
- Is this visible to all users?
138-
- Is this tech debt?
13+
* Please search to make sure this issue has not been opened already.
14+
* If this is a question about how to integrate MetaMask with your project, please ask in our [Community forum](https://community.metamask.io/c/developer-questions/) instead. This will get your question answered more quickly and make it easier for other devs to find the answer in the future.
15+
- type: textarea
16+
id: what-happened
17+
attributes:
18+
label: Describe the bug
19+
description: What happened?
20+
placeholder: A clear and concise description of what the bug is
21+
validations:
22+
required: true
23+
- type: textarea
24+
id: expected-behavior
25+
attributes:
26+
label: Expected behavior
27+
description: What did you expect to happen?
28+
- type: textarea
29+
id: screenshot-recording
30+
attributes:
31+
label: Screenshots/Recordings
32+
description: Please include screenshots/recordings if applicable!
33+
- type: textarea
34+
id: reproduce
35+
attributes:
36+
label: Steps to reproduce
37+
description: 'List all steps needed to reproduce the problem:'
38+
placeholder: |
39+
1. Go to '...'
40+
2. Click on '...'
41+
3. Scroll down to '...'
42+
4. See error
43+
validations:
44+
required: true
45+
- type: textarea
46+
id: error
47+
attributes:
48+
label: Error messages or log output
49+
description: Please copy and paste any relevant error messages or log output. This will be automatically formatted, so there is no need for backticks.
50+
render: shell
51+
- type: dropdown
52+
id: stage
53+
attributes:
54+
label: Detection stage
55+
description: At what stage was the bug detected?
56+
options:
57+
- In production (default)
58+
- In beta
59+
- During release testing
60+
- On main branch
61+
- On a feature branch
62+
validations:
63+
required: true
64+
- type: input
65+
id: version
66+
attributes:
67+
label: Version
68+
description: What version of MetaMask are you running? You can find the version in "Settings" > "About"
69+
placeholder: '7.1.0'
70+
validations:
71+
required: true
72+
- type: dropdown
73+
id: build
74+
attributes:
75+
label: Build type
76+
description: Are you using a testing or development build of MetaMask? If so, please select the type of build you are using.
77+
options:
78+
- Beta
79+
- Flask
80+
- Other (please specify exactly where you obtained this build in "Additional Context" section)
81+
- type: dropdown
82+
id: browsers
83+
attributes:
84+
label: Browser
85+
description: Which browsers have you seen the problem on?
86+
multiple: true
87+
options:
88+
- Chrome
89+
- Firefox
90+
- Microsoft Edge
91+
- Brave
92+
- Other (please elaborate in the "Additional Context" section)
93+
validations:
94+
required: true
95+
- type: dropdown
96+
id: os
97+
attributes:
98+
label: Operating system
99+
description: Which operating systems have you seen the problem on?
100+
multiple: true
101+
options:
102+
- Windows
103+
- MacOS
104+
- Linux
105+
- Other (please elaborate in the "Additional Context" section)
106+
validations:
107+
required: true
108+
- type: dropdown
109+
id: hardware-wallet
110+
attributes:
111+
label: Hardware wallet
112+
description: Are you using any of these hardware wallets? Please include the firmware version in the "Additional context" section below for any that you select here.
113+
multiple: true
114+
options:
115+
- Ledger
116+
- Trezor
117+
- Keystone
118+
- GridPlus Lattice1
119+
- AirGap Vault
120+
- imToken
121+
- OneKey
122+
- Other (please elaborate in the "Additional Context" section)
123+
- type: textarea
124+
id: additional
125+
attributes:
126+
label: Additional context
127+
description: Add any other context about the problem here, e.g. related issues, additional error messages or logs, or any potentially relevant details about the environment or situation the bug occurred in.
128+
- type: textarea
129+
id: severity
130+
attributes:
131+
label: Severity
132+
description: |
133+
To be added after bug submission by internal support / PM:
134+
placeholder: |
135+
- How critical is the impact of this bug on a user?
136+
- Add stats if available on % of customers impacted
137+
- Is this visible to all users?
138+
- Is this tech debt?

.github/dependabot.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
version: 2
55
updates:
6-
- package-ecosystem: "npm"
7-
directory: "/"
6+
- package-ecosystem: 'npm'
7+
directory: '/'
88
schedule:
9-
interval: "daily"
9+
interval: 'daily'
1010
allow:
11-
- dependency-name: "@metamask/*"
12-
versioning-strategy: "lockfile-only"
11+
- dependency-name: '@metamask/*'
12+
versioning-strategy: 'lockfile-only'

.github/guidelines/CODING_GUIDELINES.md

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
# MetaMask Coding Guidelines
22

33
### 1. New Code Should be TypeScript
4+
45
- New components and utilities should be written in TypeScript and enforce typing.
56
- Existing code should be refactored into TypeScript where time allows. If you are replacing a component, use TypeScript.
67
- Follow contributor doc [TypeScript Guidelines](https://github.com/MetaMask/contributor-docs/blob/main/docs/typescript.md).
78

89
### 2. Using Functional Components and Hooks Instead of Classes
10+
911
- Use functional components and hooks as they result in more concise and readable code compared to classes.
1012

1113
### 3. Organize Files Related to the Same Component in One Folder
14+
1215
- An example of a component file structure:
1316

1417
```.tsx
@@ -25,39 +28,45 @@ avatar-account
2528
```
2629

2730
### 4. Follow Naming Conventions
28-
- You should always use PascalCase when naming components. For example: *TextField*, *NavMenu*, and *SuccessButton*.
29-
- Use camelCase for functions declared inside components like *handleInput()* or *showElement()*.
30-
- When creating hooks use *withHookName()*.
31+
32+
- You should always use PascalCase when naming components. For example: _TextField_, _NavMenu_, and _SuccessButton_.
33+
- Use camelCase for functions declared inside components like _handleInput()_ or _showElement()_.
34+
- When creating hooks use _withHookName()_.
3135

3236
### 5. Avoid Repetitive Code
37+
3338
- If you notice you are writing duplicated code or components, convert it into a component, utility functions or hooks that can be reused. Do this with [scalable intention](https://sandimetz.com/blog/2016/1/20/the-wrong-abstraction).
3439

3540
### 6. Component Optimization
41+
3642
- For functional components, instead of having large return statements, breaking the component down into smaller sub-components.
3743
- Use memoizing techniques where possible. Utilize the `useMemo` hook for values and `useCallback` for functions. Follow recommended React guidance.
3844
- Use the useEffect hook for performing side effects like data fetching or DOM manipulation after the component has rendered. However, use it judiciously as unnecessary effects can complicate code and affect performance. For a deeper understanding, we recommend reading [this article](https://react.dev/learn/you-might-not-need-an-effect).
3945

4046
### 7. Use Object Destructuring For Props
47+
4148
- Instead of passing the props object, use object destructuring to pass the prop name. This discards the need to refer to the props object each time you need to use it.
4249

4350
```tsx
4451
import React from 'react';
4552
const MyComponent = ({ id }) => {
4653
return <div id={id} />;
4754
};
48-
4955
```
5056

5157
### 8. Document Each Component/Utility
58+
5259
- New utility functions should be documented [TSDoc](https://tsdoc.org) commenting format.
5360
- Referencing our component docs.
5461
- If applicable add URL to online resources if they are meaningful for the component/method.
5562

5663
### 9. Write Tests for Each Component/Utility
64+
5765
- Write tests for the components you create as it reduces the possibilities of errors. Testing ensures that the components are behaving as you would expect. In this project Jest is used, and it provides an environment where you can execute your tests.
5866
- Follow the contributor docs [Unit Testing Guidelines](https://github.com/MetaMask/contributor-docs/blob/main/docs/unit-testing.md).
5967

6068
### 10. External packages should be well maintained
69+
6170
- New packages should only be integrated if the application doesn’t have the existing functionality and it cannot be added by implementing a small utility function. Use the https://snyk.io/advisor/ to assess the popularity, maintainability and security analysis. The package must be in good standing to be added to the project.
6271
- Update existing dependencies when you notice they are out of date.
6372

.github/guidelines/LABELING_GUIDELINES.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
11
# PR Labeling Guidelines
2+
23
To maintain a consistent and efficient development workflow, we have set specific label guidelines for all pull requests (PRs). Please ensure you adhere to the following instructions:
34

45
### Mandatory team labels:
6+
57
- **Internal Developers**: Every PR raised by an internal developer must include a label prefixed with `team-` (e.g., `team-extension-ux`, `team-extension-platform`, etc.). This indicates the respective internal team responsible for the PR.
68

79
- **External Contributors**: PRs submitted by contributors who are not part of the organization will be automatically labeled with `external-contributor`.
810

911
It's essential to ensure that PRs have the appropriate labels before they are considered for merging.
1012

1113
### Mandatory release version labels:
14+
1215
- **release-x.y.z**: This label is automatically added to a PR and its linked issues upon the PR's merge. The `x.y.z` in the label represents the version in which the changes from the PR will be included. This label is auto-generated by a [GitHub action](../workflows/add-release-label.yml), which determines the version by incrementing the minor version number from the most recent release. Manual intervention is only required in specific cases. For instance, if a merged PR is cherry-picked into a release branch, typically done to address Release Candidate (RC) bugs, the label would need to be manually updated to reflect the correct version.
1316
- **regression-prod-x.y.z**: This label is automatically added to a bug report issue at the time of its creation. The `x.y.z` in the label represents the version in which the bug first appeared. This label is auto-generated by a [GitHub action](../workflows/check-template-and-add-labels.yml), which determines the `x.y.z` value based on the version information provided in the bug report issue form. Manual intervention is only necessary under certain circumstances. For example, if a user submits a bug report and specifies the version they are currently using, but the bug was actually introduced in a prior version, the label would need to be manually updated to accurately reflect the version where the bug originated.
1417
- **regression-RC-x.y.z**: This label is manually added to a bug report issue by release engineers when a bug is found during release regerssion testing phase. The `x.y.z` in the label represents the release candidate (RC) version in which the bug's been discovered.
1518

1619
### Optional labels:
20+
1721
- **regression-main**: This label can manually be added to a bug report issue at the time of its creation if the bug is present on the development branch, i.e., `main`, but is not yet released in production.
1822
- **feature-branch-bug**: This label can manually be added to a bug report issue at the time of its creation if the bug is present on a feature branch, i.e., before merging to `main`.
1923
- **needs-qa**: If the PR includes a new features, complex testing steps, or large refactors, this label must be added to indicated PR requires a full manual QA prior being merged and added to a release.
2024

2125
### Labels prohibited when PR needs to be merged:
26+
2227
Any PR that includes one of the following labels can not be merged:
2328

2429
- **needs-qa**: The PR requires a full manual QA prior to being merged and added to a release.

.github/pull-request-template.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
<!--
32
Please submit this PR as a draft initially.
43
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.

0 commit comments

Comments
 (0)