1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00
Commit Graph

260 Commits

Author SHA1 Message Date
Brad Decker
038eb63eb0
Upgrade to yarn 4 (#20249) 2023-08-01 17:19:19 -05:00
Brad Decker
e2e1a5fe07
Use node 18 (#20308)
* use node v18
2023-07-31 14:51:39 -05:00
Peter
378bf19c05
JSON-RPC e2e test POC (#18213)
* eth_call test

* eth_chainId test

* run json rpc tests

* add ci job

* remove query string param from url

* eth_sendTransaction test

* eth_sendTransaction test

---------

Co-authored-by: Brad Decker <bhdecker84@gmail.com>
2023-07-28 14:59:12 +01:00
Mark Stacey
7e824fdc5e
Fix non-preview draft PR builds (#20096)
Certain draft PRs that add new dependencies have been failing because
CI will try to use the GitHub npm registry, which we use for preview
builds. This registry does not have non-preview package versions, so
the installation will fail if new non-preview dependencies are needed.

CI has been updated to only use the GitHub npm registry when preview
builds are detected in the manifest.
2023-07-28 11:06:39 -02:30
António Regadas
72b274d846
[MMI] Adds mmi build step (#20207)
* adds prep-build-mmi

* adds validate-source-maps-mmi

* adds test-mozilla-lint-mmi

* clean up
2023-07-27 10:08:53 +02:00
Mark Stacey
7ef2730c9a
Fix preview builds on CI (#19970)
Preview builds were setup to install correctly on CircleCI prior to
the Yarn v3 upgrade, but that integration broke with that upgrade. The
Yarn and CircleCI configuration has been updated to fix this.

The `.yarnrc.yaml` file has been updated to configure the GitHub
registry but leave it disabled by default. It can be enabled
dynamically using an environment variable. This lets us switch between
registries without updating the file.

The new workflow is documented here: https://github.com/MetaMask/core/pull/1481
2023-07-12 19:50:31 -02:30
Mark Stacey
177ea83f20
Replace deprecated install command (#19968)
The `--frozen-lockfile` flag is not supported by Yarn v3. It has been
replaced by the Yarn v3 equivalent, which is `--immutable`.

Additionally, the `deps-install` script was deleted and this command
was inlined in the CircleCI configuration. I don't think we need to
maintain a separate script just for one command.
2023-07-12 10:17:14 -02:30
Howard Braham
b36487ab52
perf(CI): Shallow git clone that works with PRs from forks (#19757)
* perf(CI): Shallow git clone that works with PRs from forks

Co-authored-by: Brad Decker <bhdecker84@gmail.com>
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>

* added CircleCI link and removed rc_or_master_branch_only

---------

Co-authored-by: Brad Decker <bhdecker84@gmail.com>
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
2023-06-27 10:57:46 -07:00
Mark Stacey
3b9fd435fb
Validate LavaMoat policies on each PR (#19703)
* Validate LavaMoat policies on each PR

The LavaMoat policies are now validated on every PR. This makes it
easier to validate policy changes, as they should always correspond
with the changes made in the PR (unlike today, when they could be due
to a change in platform or a previous PR).

Closes #19680

* Update LavaMoat policies

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
2023-06-23 09:50:36 -02:30
Mark Stacey
492038a312
Validate LavaMoat config in parallel (#19589)
The LavaMoat policies and allow-scripts configuration are now validated
in parallel. They are still only validated for release candidate
branches and the `master` branch.
2023-06-22 18:40:32 -02:30
Mark Stacey
1f576641dc
Enable e2e debug flag in CI (#19588)
E2E tests will now run in debug mode on CI, printing out each step that
the driver takes during a test. This should make debugging intermittent
failures much easier.
2023-06-15 14:48:15 -02:30
legobeat
8675c7863e
devDeps: storybook@7 (#19092)
* devDeps: pin @babel/core and @babel/runtime in resulotions
    Without this: misses patch, lavamoat error


* storybook 6 to 7 migration
* devDeps: add @storybook/addon-mdx-gfm
* fix lint deps
* devDeps: remove unused require-from-string
* devDeps/resolutions: @types/react@^16.9.53
* devDeps: add @storybook/cli
* storybook: new-frameworks migration
* iyarc: remove resolved dependency advisory
* deps: set globalthis@1.0.1 in resolutions
   This is required since a file is copied over from a set path in the dist
   package subdirectory as of d13aabde23 (#10014).
   A future update should either vendor the shim, or update to
   compatibility with a maintained upstream version.

* mdx2 migration fixes
* chore: bump ljharb packages
* devDeps: @storybook/*@^7.0.10->^7.0.11
* storybook: update preview.js to use v7 addon api
* ci/test/storybook: echo between storybook build&test
* ci/circleci: resources tweak
* info-tab: handle undefined global.platform
* update lavamoat build policy
* update lavamoat browserify policies
2023-05-18 11:07:42 +09:00
Frederik Bolding
55d974d7b2
Bump Circle CI docker image (#18914)
* Bump Circle CI docker image

* Stop removing FF since it doesn't exist

* Use Circle CI browser tools

* Fix config name

* Fix browser tools args

* Fix Chrome version

* Use script for chrome

* Try update

* Try FF without browser-tools2

* Fix FF binary path

* Force enable e2e debug

* Add some logs

* More logs

* Disable XSET check for now

* Delete x-server logic

* remove another usage of the x-server logic
2023-05-02 17:10:53 +02:00
Dan J Miller
660ae4c156
Fix mv3 beta build (#18690)
* Build beta with mv3 enabled

* Ensure firefox manifest is an mv2 version

* Revert "Ensure firefox manifest is an mv2 version"

This reverts commit fed74792b0fec33c3a85f2229eb560559d37afe5.

* Only create beta builds for the chrome platform

* Stop linting firefox for beta
2023-04-26 12:26:33 -02:30
Brad Decker
85bc0460e3
Revert "Shallow git clone (#18491)" (#18788)
This reverts commit b704a3d60f.
2023-04-25 07:03:37 +09:00
HowardBraham
b704a3d60f
Shallow git clone (#18491)
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
Co-authored-by: legobt <6wbvkn0j@anonaddy.me>
2023-04-24 09:18:58 -05:00
Bowen Sanders
90f4e47326
[FLASK] More Snaps E2E Optimization and Delay Reductions (#18245)
* bip32 delay reduction

* asserts changed to waitFors in 32/44

* scrollTo change

* replaced delay for firefox flake

* more reduced delays

* more delay reductions and changes

* raise paralellism to 4 for snaps tests

* additional delay changes

* fixed update code

* removed comment

* removed another comment
2023-04-06 10:57:11 -04:00
Dan J Miller
1e079e95b0
Move all validate-source-maps-beta steps in config.yml into the respective .sh file (#18427) 2023-04-03 17:28:09 -02:30
Dan J Miller
50767dd193
Ensure that firefox linting of beta builds only happens on beta build… (#18403)
* Ensure that firefox linting of beta builds only happens on beta build commits

* Fix script
2023-04-03 11:41:06 +01:00
David Walsh
5b1b5dc03b
NFTs: Remove feature flag for release (#17401)
* NFTs: Remove feature flag for release

* Update security tab jest test

* Fix broken test

* Update snapshot

* Update test

* Fix test

* Remove last usages of flag

* Update CI jobs

* Fix jest tests
2023-03-13 14:29:37 -05:00
João Tavares
ba93b81182
fix: do not run desktop prep build step on master (#18112) 2023-03-13 09:12:01 -02:30
Danica Shen
f5e2183a7f
feat(17494): beta build trigger in release branch and cleanup (#17749)
* feat(17494): test separate commit triggered build

* feat(17493): keep consistent commit message

* feat(17493): use trim to get rid of white space in branch name

* feat(17493): bring back some pipelines

* Version v10.25.0-beta.0

* ERC1155 Import & Dapp interaction E2E tests (#17885)

* feat(17494): test separate commit triggered build

* feat(17493): remove testing beta commit in package.json

---------

Co-authored-by: Thomas Huang <tmashuang@users.noreply.github.com>
2023-03-04 12:51:04 +00:00
Thomas Huang
ddbd158e79
ERC1155 Import & Dapp interaction E2E tests (#17885) 2023-02-27 10:48:41 -06:00
Peter
8c863ec960
always process test results (#17854) 2023-02-22 14:40:55 +00:00
Peter
523c90ade9
E2e test insights (#17535) 2023-02-08 08:34:44 -06:00
Elliot Winkler
75f2951f89
[TS dashboard] Reorganize files slightly (#17335) 2023-02-08 08:33:03 -06:00
Matthew Walsh
92367dff79
Add desktop build type (#17592)
Implement build type inheritance.
Add CircleCI jobs for desktop build type.
2023-02-08 09:24:01 +00:00
Peter Yinusa
245c32a99e
Nft build for e2e tests (#17430) 2023-01-27 12:45:35 -06:00
Mark Stacey
d2331c0e0b
Fix Playwright install step (#17415)
The Playwright install step run in the `test-storybook` job has been
updated to ensure that we are running the correct install command.
Previously we were using `yarn dlx`, which would use the latest version
of `Playwright` rather than the one currently installed. Instead now we
are using `yarn exec`, which will invoke the `playwright` binary from
the locally installed package. This binary has an `install` command
that completes the necessary setup, which is to install custom patched
browsers for Playwright to run.
2023-01-25 14:22:04 -03:30
Nidhi Kumari
c5368c152b
Added storybook check to CI (#17092)
* added storybook test runner

* added test runner in ci

* updated test for ci and fixed lint error

* updated lavamoat policy

* updated test command

* updated playwright

* changed command to storybook;ci

* updated command

* updated instance for test-storybook

* updated playwright

* added playwright step

* replaced concurrently with start-server-and-test

* updated the static storybook directory

* replaced first with last

* updated lock file

* replaced first with last

* updated test-storybook with maxworkers

* updated .depchechrc

* updated yml

* removed id from banner base

* replaced broken stories with .stories-to-do.js extesnsion

* updated token allowance story

* removed duplicacies from yarn

* fixed lavamoat

* removed filename comment

* updated links for docs

* fixed file extension for stories

* updated path for stories.json

* updated stories.json path

* yarn updated

* updated stories

* updated yarn

* updated wait on
2023-01-21 00:57:46 +05:30
Brad Decker
64839b6bf7
split unit tests (#16455)
Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
2023-01-11 12:23:38 -06:00
Brad Decker
ee321971e7
add new yarn3 paths to circleci cache (#16873) 2022-12-20 15:33:18 -06:00
Brad Decker
6d1170f06c
upgrade yarn to version 3 (#16232)
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Co-authored-by: ricky <ricky.miller@gmail.com>
Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
Co-authored-by: legobt <6wbvkn0j@anonaddy.me>
Co-authored-by: Pedro Figueiredo <pedro.figueiredo@consensys.net>
2022-12-08 10:38:04 -06:00
Frederik Bolding
6416936eec
Fix production builds for Flask (#16757) 2022-12-01 14:19:14 +01:00
seaona
f44af06f9b
[e2e] Setup MV3 specific test folder and add 1 simple testcase introducing Service Worker re-start (#16606)
* First e2e mv3 specific dapp testcase

* Fix testpath for snaps

* Update `it` description

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

* e2e test paths improvement

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2022-11-25 12:06:48 +01:00
Elliot Winkler
51cffa15dd
Migrate to new controller packages (#16547)
* Migrate to new controller packages

`@metamask/controllers` is deprecated, and most of the controllers that
lived here are now located in their own package ([1]). This commit
replaces `@metamask/controllers` in `package.json` with references to
these packages and updates `import` lines to match.

[1]: https://github.com/MetaMask/controllers/pull/831

* Support GitHub registry for draft PRs (#16549)

* Add additional allowed host to lockfile linter

* Update LavaMoat policies

* Add policy exception for nanoid

* Add additional nanoid overrides

* Update LavaMoat policies again

* Bump controller packages

* Update lavamoat

* Bump controller packages

* Update packages to v1.0.0

* Expand gitignore comment

* Unpin controller dependencies, using ^ range instead

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2022-11-24 16:29:07 -03:30
Mark Stacey
65f2f17695
Fix bundle size diff message (#16576)
The bundle size diff message is using the wrong point of comparision,
leading to misleading results on feature branches that have been
merged with `develop` since they were created.

When this feature was introduced, we went back and forth a few times on
what we should be comparing the branch with to get an accurate bundle
size comparison.

The first attempt used `develop` as the point of comparison, but that
didn't work because it was a moving target, and because it didn't
reflect the changes made on this branch. As bundle increases or
decreases were added on `develop`, they would alter the diff on each
feature PR.

Then we chose to use the fork-point of the branch, the commit of
`develop` that the branch forked off of. This works for feature
branches that don't merge in `develop`. But the minute `develop` gets
merged in, then unrelated changes on `develop` affect the measurement.

The _most recent_ commit from `develop` on the current branch is a
better comparison. Any difference between this commit and the feature
branch in terms of bundle size would be attributable to the feature
branch changes. This is what `merge-base` gives us.
2022-11-23 13:35:57 -03:30
George Marshall
45ad946697
Removing storybook tests (#16577) 2022-11-18 07:32:20 -08:00
Dan J Miller
27e8f0ffaa
Ensure prod beta build is created when merging to master (#16557)
* Ensure prod beta build is created when merging to master

* Fix: remove negation

* Update .circleci/config.yml

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2022-11-17 17:05:13 -03:30
Michele Esposito
522eb72e49
chore: add bundle size diff to metamaskbot (#16098) 2022-11-09 09:02:44 -06:00
Frederik Bolding
02088e445d
Parallelize E2E tests to cut CI time in half (#16417)
* Experiment with parallellizing E2E

* Fix lint

* Try parallelism 8

* Apply suggestions from code review

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2022-11-08 18:28:06 +01:00
Michele Esposito
41e3ab189c
chore: add build stats history json file (#16168) 2022-10-13 11:59:22 +02:00
seaona
1b3dc0db54
[MV3] Add e2e chrome test job for MV3 build (#15991)
* Add filter tag

* Fix tag

* test tag

* fix

* Changed tag

* Add test-e2e-chrome

* Filter by branch instead of tag

* Move tests to correct mv3 folder

* Remove ignore from e2e regular chrome job

* Remove filter, so it's run on all PRs

* Handling red X for MV3 e2e failures

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2022-10-10 14:33:13 +02:00
Mark Stacey
e4dc8ce012
Fix intermittent storybook build failure (#16124)
The CI job for building storybook will fail occasionally, presumably
due to a Node.js process running out of heap memory. This job is the
only build job that runs with default Node.js memory settings.

It has been updated to use a larger instance size and to set the heap
size to 2GB, matching our other build jobs.
2022-10-07 13:08:38 -02:30
seaona
dd660f83ae
Add test insights on circle ci for test-unit job (#15839)
* Test results for jest

* Add jest-junit package for reporting

* Order alphabetically
2022-09-19 13:30:34 +02:00
Mark Stacey
48c02ef641
Add validation to production build script (#15468)
Validation has been added to the build script when the "prod" target is
selected. We now ensure that all expected environment variables are
set, and that no extra environment variables are present (which might
indicate that the wrong configuration file is being used).

The `prod` target uses a new `.metamaskprodrc` configuration file. Each
required variable can be specified either via environment variable or
via this config file. CI will continue set these via environment
variable, but for local manual builds we can use the config file to
simplify the build process and ensure consistency.

A new "dist" target has been added to preserve the ability to build a
"production-like" build without this validation.

The config validation is invoked early in the script, in the CLI
argument parsing step, so that it would fail more quickly. Otherwise
we'd have to wait a few minutes longer for the validation to run.
This required some refactoring, moving functions to the utility module
and moving the config to a dedicated module.

Additionally, support has been added for all environment variables to
be set via the config file. Previously the values `PUBNUB_PUB_KEY`,
`PUBNUB_SUB_KEY`, `SENTRY_DSN`, and `SWAPS_USE_DEV_APIS` could only be
set via environment variable. Now, all of these variables can be set
either way.

Closes #15003
2022-08-19 15:46:18 -02:30
seaona
437acdb74c
Capture user actions times for MV2 benchmark and generate artifacts (#15353)
* User actions benchmark and artifacts

* Lint and fix identation

* Fix lint

* Updated path

* lint

* Add user actions benchmark to pre release job

* Remove title

* Out path updated

* See if url is finally fixed

* Adding some console logs

* lint

* fix lint

* fix lint

* Updated persisting and store artifacts path

* Added MetaMask bot correct link and remove console logs

* Remove console log

* Sort Imports

* Fix lint

* Update loadAccount function and prop name for clarity to loadNewAccount

* Run yarn setup

* Fix yarn

* Update Create Account element for Create account

* Remove unnecessary step on send

Co-authored-by: Jyoti Puri <jyotipuri@gmail.com>
2022-08-12 19:41:20 +02:00
Elliot Winkler
024b41546b
Fix deployment of TS migration dashboard (again) (#15528)
An improper deploy key was used to deploy the TypeScript
migration dashboard. A new key has been created on the GitHub side for
the `metamask-extension-ts-migration-dashboard` repo and also added to
CircleCI. The new fingerprint for this key is provided in this commit.
This should hopefully make it possible for us to deploy to this repo
from CircleCI.
2022-08-10 12:38:43 -06:00
Elliot Winkler
2dc8ba32da
Fix deploying the TS migration dashboard (#15516)
When the TypeScript migration dashboard is updated, it is built and
deployed in another repo, which is then deployed via GitHub Pages. To
push to this repo we have to set a Git username and email. This is
missing from the CircleCI config, so this commit uses the metamaskbot
GitHub account to do that.
2022-08-10 09:45:21 -06:00
Elliot Winkler
a7d98b695f
Add TypeScript migration dashboard (#13820)
As we convert parts of the codebase to TypeScript, we will want a way to
track progress. This commit adds a dashboard which displays all of the
files that we wish to convert to TypeScript and which files we've
already converted.

The list of all possible files to convert is predetermined by walking
the dependency graph of each entrypoint the build system uses to compile
the extension (the files that the entrypoint imports, the files that the
imports import, etc). The list should not need to be regenerated, but
you can do it by running:

    yarn ts-migration:enumerate

The dashboard is implemented as a separate React app. The CircleCI
configuration has been updated so that when a new commit is pushed, the
React app is built and stored in the CircleCI artifacts. When a PR is
merged, the built files will be pushed to a separate repo whose sole
purpose is to serve the dashboard via GitHub Pages (this is the same
way that the Storybook works). All of the app code and script to build
the app are self-contained under
`development/ts-migration-dashboard`. To build this app yourself, you
can run:

    yarn ts-migration:dashboard:build

or if you want to build automatically as you change files, run:

    yarn ts-migration:dashboard:watch

Then open the following file in your browser (there is no server
component):

    development/ts-migration-dashboard/build/index.html

Finally, although you shouldn't have to do this, to manually deploy the
dashboard once built, you can run:

    git remote add ts-migration-dashboard git@github.com:MetaMask/metamask-extension-ts-migration-dashboard.git
    yarn ts-migration:dashboard:deploy
2022-08-09 14:16:08 -06:00