-
Notifications
You must be signed in to change notification settings - Fork 5.5k
QYX20 #35571
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
base: main
Are you sure you want to change the base?
QYX20 #35571
Changes from all commits
c455f31
e194a5e
f25dc1e
1a21e89
fc7f224
055bd49
5454f7a
0605f49
4fef1a1
97d8786
1039a9e
b01eae3
d5029ec
565d0d8
d5788bc
4c639e3
f19d403
474dc17
be4c643
272997a
7d948ef
97234f7
5917fcc
21e862e
bdd5c3c
5186c95
03afea0
f56cda7
043f645
e489834
43a7468
227dd47
68c3144
b721eaf
0bfba42
9002fce
22da388
e734d1a
0899774
cb6817d
3f820ac
057a47a
de634aa
6fcd885
be537f7
119c4d7
e8bf806
39deb4e
33caaa1
6ae7649
2c7eeee
86ea173
9e0962d
c6a12fa
9765dbc
8a614d4
1fe4422
3ef9c79
7b50ead
0a6839a
15506a8
54fb020
d731de6
0589bb9
48c0bc6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # Copilot AI Agent Instructions for MetaMask Extension | ||
|
|
||
| ## Project Overview | ||
| - **MetaMask Extension** is a browser extension for Ethereum-based blockchain interactions. It supports Chrome, Firefox, and Chromium browsers. | ||
| - The codebase is modular, with clear separation between background logic, UI, build system, and shared libraries. | ||
| - Key directories: | ||
| - `app/`: Core extension logic, background scripts, controllers (e.g., `metamask-controller.js`, `TransactionController`). | ||
| - `ui/`: React-based UI, component library, state management (Redux, Context, hooks). | ||
| - `shared/`: Shared constants, utilities, and logic between background and UI. | ||
| - `development/`: Build scripts, dev tools, and workflow automation. | ||
| - `docs/`: Architecture, workflows, and refactoring guides. | ||
|
|
||
| ## Build & Development Workflows | ||
| - **Local build:** | ||
| - Use `yarn start` for a watched development build (fast, no LavaMoat). | ||
| - Use `yarn dist` for a production build (outputs to `builds/`). | ||
| - Use `yarn webpack` for custom dev builds (see `development/webpack/README.md`). | ||
| - **Environment setup:** | ||
| - Copy `.metamaskrc.dist` to `.metamaskrc` and set `INFURA_PROJECT_ID` (see root `README.md`). | ||
| - For Segment/Sentry debugging, set `SEGMENT_WRITE_KEY`/`SENTRY_DSN` in `.metamaskrc`. | ||
| - **Testing:** | ||
| - E2E and integration tests are in `test/` (see sub-`README.md` files for details). | ||
| - **Component development:** | ||
| - Use `ui/components/component-library/` for design-system-aligned components. Prefer `Box`-based layout and design tokens. | ||
|
|
||
| ## Architecture & Patterns | ||
| - **Background logic:** | ||
| - `app/scripts/metamask-controller.js` glues together controllers for transactions, messages, and approvals. | ||
| - Transaction and message handling is migrating to `@metamask/transaction-controller` and `@metamask/message-manager` (see `docs/confirmation-refactoring/confirmation-backend-architecture/README.md`). | ||
| - **UI state:** | ||
| - Use Redux state (`state.metamask`) as the single source of truth. | ||
| - Use hooks and React Context for derived/temporary UI state (see `docs/confirmation-refactoring/confirmation-state-management/README.md`). | ||
| - **Build transforms:** | ||
| - Custom Browserify transforms (e.g., `remove-fenced-code.js`) enable build-type-specific code inclusion (see `development/build/transforms/README.md`). | ||
|
|
||
| ## Conventions & Gotchas | ||
| - **Feature flags:** Use `.manifest-overrides.json` and `MANIFEST_OVERRIDES` for custom builds. | ||
| - **Design tokens:** Use MetaMask design tokens for UI colors/styles; avoid hardcoded hex values. | ||
| - **Component patterns:** Use polymorphic `as` prop and style utility props for layout (see `component-library/README.md`). | ||
| - **Refactoring:** See `docs/confirmation-refactoring/` for ongoing architectural changes and best practices. | ||
|
|
||
| ## References | ||
| - [Root `README.md`](../README.md) | ||
| - [Development workflow](../development/README.md) | ||
| - [Build system](../development/build/README.md) | ||
| - [Component library](../ui/components/component-library/README.md) | ||
| - [Confirmation refactoring docs](../docs/confirmation-refactoring/) | ||
|
|
||
| --- | ||
|
|
||
| **If unsure about a workflow or pattern, check the referenced READMEs or ask for clarification.** |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| name: Add team label | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| name: Check Changelog | ||
|
|
||
| on: | ||
| pull_request: | ||
| pull_request: | ||
| types: [opened, synchronize, labeled, unlabeled] | ||
|
|
||
| jobs: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ on: | |
|
|
||
| jobs: | ||
| check-template-and-add-labels: | ||
| runs-on: ubuntu-latest | ||
| runs-on: self-hosted | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Self-Hosted Runners Risk Repository SecuritySwitching GitHub Actions workflows to Additional Locations (1) |
||
| steps: | ||
| - name: Checkout and setup environment | ||
| uses: MetaMask/action-checkout-and-setup@v1 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,7 @@ on: | |
|
|
||
| jobs: | ||
| cherry-pick: | ||
| runs-on: ubuntu-latest | ||
| runs-on: self-hosted | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Public Repo Vulnerability Through Self-Hosted RunnersSwitching to Additional Locations (4) |
||
|
|
||
| steps: | ||
| - name: Checkout code | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -1,9 +1,9 @@ | ||||||||
| name: Crowdin Action | ||||||||
| name: Crowdin Action | ||||||||
|
|
||||||||
| on: | ||||||||
| push: | ||||||||
| branches: | ||||||||
|
||||||||
| branches: | |
| branches: | |
| - main |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| # This workflow is meant to better structure the main.yaml one for redability reasons. | ||
| # It is not meant to be a reusable workflow. | ||
|
|
||
| name: E2E Chrome | ||
| name: E2E Chrome | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: YAML Parsing Errors Due to WhitespaceTrailing whitespace was accidentally introduced on several YAML configuration lines in workflow files, which can lead to parsing issues. Additional Locations (1) |
||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
@@ -92,7 +92,7 @@ jobs: | |
| test-e2e-chrome-api-specs-alert-on-failure: | ||
| needs: | ||
| - test-e2e-chrome-api-specs | ||
| runs-on: ubuntu-latest | ||
| runs-on: self-hosted | ||
| if: ${{ github.event_name == 'pull_request' && vars.AWS_CLOUDFRONT_URL && vars.AWS_REGION && vars.AWS_IAM_ROLE && vars.AWS_S3_BUCKET && failure() }} | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.PR_COMMENT_TOKEN }} | ||
|
|
@@ -133,7 +133,7 @@ jobs: | |
| test-e2e-chrome-api-specs-multichain-alert-on-failure: | ||
| needs: | ||
| - test-e2e-chrome-api-specs-multichain | ||
| runs-on: ubuntu-latest | ||
| runs-on: self-hosted | ||
| if: ${{ github.event_name == 'pull_request' && vars.AWS_CLOUDFRONT_URL && vars.AWS_REGION && vars.AWS_IAM_ROLE && vars.AWS_S3_BUCKET && failure() }} | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.PR_COMMENT_TOKEN }} | ||
|
|
@@ -172,7 +172,7 @@ jobs: | |
| - test-e2e-chrome-vault-decryption | ||
| - test-e2e-chrome-api-specs | ||
| - test-e2e-chrome-api-specs-multichain | ||
| runs-on: ubuntu-latest | ||
| runs-on: self-hosted | ||
| if: ${{ !cancelled() }} | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,19 +2,30 @@ name: Flaky test report | |
|
|
||
| on: | ||
| schedule: | ||
| # Once every day from Monday-Friday at 08:00 UTC | ||
| - cron: 0 8 * * 1-5 | ||
| # Once every day from Monday-Friday at 10:00 UTC | ||
| - cron: 0 10 * * 1-5 | ||
|
|
||
| permissions: | ||
| contents: read | ||
| actions: read | ||
|
|
||
| jobs: | ||
| flaky-test-report: | ||
| uses: MetaMask/github-tools/.github/workflows/flaky-test-report.yml@main | ||
| with: | ||
| repository: ${{ github.event.repository.name }} | ||
| workflow_id: main.yml | ||
| secrets: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| slack-webhook-flaky-tests: ${{ secrets.SLACK_WEBHOOK_FLAKY_TESTS }} | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| OWNER: ${{ github.repository_owner }} | ||
| REPOSITORY: ${{ github.event.repository.name }} | ||
| WORKFLOW_ID: main.yml | ||
| BRANCH: ${{ github.ref_name }} | ||
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| steps: | ||
| - name: Checkout and setup environment | ||
| uses: MetaMask/action-checkout-and-setup@v1 | ||
| with: | ||
| is-high-risk-environment: false | ||
| skip-allow-scripts: true | ||
| yarn-custom-url: ${{ vars.YARN_URL }} | ||
|
|
||
| - name: Create flaky test report | ||
| run: yarn tsx .github/scripts/create-flaky-test-report.ts | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Flaky Test Report Workflow FailsThe flaky test report workflow changed to an inline implementation that calls
Comment on lines
+30
to
+31
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # Sample workflow for building and deploying a Jekyll site to GitHub Pages | ||
| name: Deploy Jekyll with GitHub Pages dependencies preinstalled | ||
|
|
||
| on: | ||
| # Runs on pushes targeting the default branch | ||
| push: | ||
| branches: ["QYX20"] | ||
|
|
||
| # Allows you to run this workflow manually from the Actions tab | ||
| workflow_dispatch: | ||
|
|
||
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
| permissions: | ||
| contents: read | ||
| pages: write | ||
| id-token: write | ||
|
|
||
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
| # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
| concurrency: | ||
| group: "pages" | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| # Build job | ||
| build: | ||
| runs-on: ubuntu-latest | ||
LimitedVERSE marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Pages | ||
| uses: actions/configure-pages@v5 | ||
| - name: Build with Jekyll | ||
| uses: actions/jekyll-build-pages@v1 | ||
| with: | ||
| source: ./ | ||
| destination: ./_site | ||
| - name: Upload artifact | ||
| uses: actions/upload-pages-artifact@v3 | ||
|
|
||
| # Deployment job | ||
| deploy: | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
| runs-on: ubuntu-latest | ||
LimitedVERSE marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| needs: build | ||
| steps: | ||
| - name: Deploy to GitHub Pages | ||
| id: deployment | ||
| uses: actions/deploy-pages@v4 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using an empty string as fallback for a missing secret token could lead to silent failures in authentication. Consider using a conditional check or failing explicitly when the token is missing.