1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00
Commit Graph

185 Commits

Author SHA1 Message Date
Whymarrh Whitby
5e5d9e6c0a
Set NODE_OPTIONS=--max_old_space_size=1024 for builds (#9731)
This reduces the footprint of each Node process in an attempt to try
and lower the failure rate.

> Expected behavior with –max-old-space-size within container constraints
>
> By default, Node.js (up to 11.x) uses a maximum heap size of 700MB and 1400MB
> on 32-bit and 64-bit platforms, respectively. For current defaults, see the
> reference mentioned at the end of blog.

  [1]:https://developer.ibm.com/languages/node-js/articles/nodejs-memory-management-in-container-environments/
2020-10-27 12:44:24 -02:30
Whymarrh Whitby
7e5e697f89
Create release PRs as a draft, initially (#9660)
This change updates the command used to create RC pull requests to create [draft PRs][1].

  [1]:https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/about-pull-requests#draft-pull-requests
2020-10-20 09:15:53 -07:00
Whymarrh Whitby
baa2350604
Skip running e2e tests when commit is tagged with '[skip e2e]' (#9486)
[skip e2e]
2020-10-07 15:12:52 -02:30
Whymarrh Whitby
dd3c2cc3ec
Fix create_release_pull_request build step (#9484) 2020-10-06 16:39:53 -02:30
Whymarrh Whitby
92314cc3ed
Format manifest file after applying new version (#9480) 2020-10-06 15:27:59 -02:30
Whymarrh Whitby
4a5a8e40aa
Use the latest ShellCheck (#9446) 2020-09-21 17:38:15 -02:30
Mark Stacey
f7edc83a4e
Add source map validator to CI (#9135)
Source maps are now validated during CI. This is done during a new job
called "validate-source-maps`, and it is required to pass for tests to
pass.
2020-08-04 14:21:46 -03:00
Whymarrh Whitby
b378e57b27
Drop unused reviewers from CI scripts (#9068) 2020-07-23 21:15:09 -02:30
Mark Stacey
2856af2336
Remove integration tests (#8959)
The remaining integration tests are all covered by e2e tests, so
they're no longer needed.

All associated scripts, fixtures, and dependencies have also been
removed.
2020-07-10 12:22:36 -03:00
Mark Stacey
991ef366d7
Fix manifest version bump script (#8715)
The version bump script referenced the old file path for the manifest.
It was stored as a single file called `manifest.json`, but it was split
into `_base.json` and platform-specific manifests in #8140.

The manifest version bump script has been updated to reference
`_base.json`, which is the piece that has the version property.
2020-06-01 18:07:27 -03:00
kumavis
bc99728e84
ci/scripts/deps-install - exit if any command fails (#8368) 2020-04-20 10:18:16 -03:00
kumavis
7686edadb0
Build system refactor (#8140)
* build - start static asset task cleanup

* build - simplify manifest tasks

* build - refactor + rename some tasks

* build - various cleanups

* manifest - fix ref from controller

* build - drop gulp for simple async tasks

* build - breakout gulpfile into multiple files

* build - rename some tasks

* build - use task fn refs instead of string names

* build - bundle all scripts first, except for contentscript

* build - improve task timeline

* deps - update lock

* build - improve task time printout

* build/scripts - remove intermediate named task

* build - use 'yarn build' for task entry points

* build - properly run tasks via runTask for timeline display

* development/announcer - fix manifest path + clean

* build - lint fix

* build - make all defined tasks possible entry points

* build/task - properly report errors during task

* ci - fix sesify/lavamoat-viz build command

* build/scripts - run each bundle in separate processes

* lint fix

* build - forward childProcess logs to console

* build/task - fix parallel/series stream end event

* build/scripts refactor contentscript+inpage into a single task

* build/static - use the fs for 150x speedup zomg

* lint fix

* build/static - fix css copy

* Update development/build/scripts.js

Co-Authored-By: Mark Stacey <markjstacey@gmail.com>

* Update development/build/scripts.js

Co-Authored-By: Mark Stacey <markjstacey@gmail.com>

* Update development/build/index.js

Co-Authored-By: Mark Stacey <markjstacey@gmail.com>

* deps - remove redundant mkdirp

* deps - remove unused pumpify

* deps - remove redundant merge-deep

* deps - prefer is-stream of isstream

* deps - remove clone for lodash.cloneDeep

* clean - remove commented code

* build/static - use fs.copy + fast-glob instead of linux cp for better platform support

* build/manifest - standardize task naming

* build/display - clean - remove unused code

* bugfix - fix fs.promises import

* build - create "clean" as named task for use as entrypoint

* build/static - fix for copying dirs

* Update development/build/task.js

Co-Authored-By: Mark Stacey <markjstacey@gmail.com>

* Update development/build/display.js

Co-Authored-By: Mark Stacey <markjstacey@gmail.com>

* Update development/build/display.js

Co-Authored-By: Mark Stacey <markjstacey@gmail.com>

* Update development/build/display.js

Co-Authored-By: Mark Stacey <markjstacey@gmail.com>

* build - use task refs, tasks only return promises not streams, etc

* lint fi bad merge + lint

* build - one last cleanup + refactor

* build - add comments introducing file

* build/manifest - fix bug + subtasks dont beed to be named

* Update package.json

Co-Authored-By: Mark Stacey <markjstacey@gmail.com>

* build/task - remove unused fn

* Update package.json

Co-Authored-By: Mark Stacey <markjstacey@gmail.com>

* Update development/build/styles.js

Co-Authored-By: Mark Stacey <markjstacey@gmail.com>

* Update development/build/styles.js

Co-Authored-By: Mark Stacey <markjstacey@gmail.com>

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2020-03-09 08:55:02 +08:00
Whymarrh Whitby
1ae0933897
Use image hash for ShellCheck Docker image (#8022) 2020-02-10 14:17:31 -03:30
Whymarrh Whitby
5b28fb3a1c
Enable Storybook deploy on CI (#8009) 2020-02-08 16:26:33 -03:30
Whymarrh Whitby
667f4fa5f8
Revert CircleCI Node image (#7996)
This changeset "reverts" the image version of the CircleCI node image, to
work around a chromedriver/Chrome/WebDriver error. We were seeing the
following errors:

```
WebDriverError: unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
```

I can surmise that the content changes in the Docker image, from (1) to (2),
below did result in this breakage:

1. https://hub.docker.com/layers/circleci/node/10.18-browsers/images/sha256-e16740707de2ebed45c05d507f33ef204902349c7356d720610b5ec6a35d3d88
2. https://hub.docker.com/layers/circleci/node/10.18-browsers/images/sha256-14d76b9e092ca03543328409223a2d2fba29e3ee5b8274c90b0c98b80005ecf2

Alternative links:

1. circleci/node@sha256:e16740707de2ebed45c05d507f33ef204902349c7356d720610b5ec6a35d3d88
2. circleci/node@sha256:14d76b9e092ca03543328409223a2d2fba29e3ee5b8274c90b0c98b80005ecf2
2020-02-05 19:50:06 -04:00
Whymarrh Whitby
9a692d721d
ci: Update shellcheck version used in CI (#7951) 2020-01-30 10:29:16 -03:30
Whymarrh Whitby
4bb01a36eb
Bump Node version to 10.18 (#7925) 2020-01-29 13:36:10 -03:30
Mark Stacey
ffd24a2854
Remove JSDoc tools (#7897)
Our JSDoc documentation has not been updated in a very long time, and
we don't use JSDoc in enough places for the docs to have been
especially useful. The tools and scripts  used to generate and publish
these docs have been removed.

References to this documentation have also been removed from the
README.

Hopefully once the TypeScript migration has made substantial progress,
we can generate more useful documentation using something like TypeDoc.
2020-01-28 13:02:49 -04:00
Mark Stacey
6ae93b1ec0 Comment out storybook-deploy step (#7913)
The Storybook deploy step is currently broken because it's using the
wrong source branch (`master` instead of `develop`), and because the
key that CircleCI is setup with doesn't have write access to the repo.

While I expect we'll get these two problems fixed soon, this ensures
that we at least have passing builds on `develop` in the meantime.
2020-01-27 11:31:55 -05:00
ricky
245952f236
Minimum changes to get storybook working (#7884)
* Minimum changes to get storybook working

Undo path changes

* Add build:storybook scripts to package.json

* Add storybook deployer

* Add storybook:deploy to package.json

* Update circle ci config

* Update yarn.lock

* Remove addon-info

* Update yarn.lock file to reflect removing of addon-info

Co-authored-by: Dan J Miller <danjm.com@gmail.com>
2020-01-26 18:44:58 -05:00
Mark Stacey
550fba2466
Add benchmark to CI (#7871)
* Add benchmark to CI

The page load benchmark for Chrome is now run during CI, and the
results are collected and summarized in the `metamaskbot` comment.

Closes #6881

* Double default number of samples

The number of default samples was changed from 10 to 20. The results
from 10 samples would show statistically significant changes in page
load times between builds, so weren't a sufficiently useful metric.
2020-01-23 16:55:17 -04:00
Mark Stacey
523121209f
Revert the revert of "Use common test build during CI (#7196)" (#7404) (#7870)
This reverts commit 4b4c00e94f. The
original change was a possible optimization of CI, though it ended up
not having a huge impact. It was thought that it may have broken source
maps, because the test build overwrote the `dist` directory that the
source maps were written to. However this turned out not to be the
case, as the changes to `dist` are never persisted to the workspace.

This is being re-introduced because the test build is needed for an
additional job (the page load benchmark), and sharing the same build
for all three jobs would surely be faster than building it separately
three times.
2020-01-20 13:03:21 -04:00
Whymarrh Whitby
bcfe58d59b
Add lockfile-lint to CI (#7727) 2020-01-06 15:28:43 -03:30
ricky
476274474f
Add shellcheck lint (#7392)
* Add shellcheck lint script

* Add to build

* Add shellcheck lint to main lint task

* Put shellcheck in the right place, hopefully?

* Fix declared multiple executor types

* Add sudo

* Address shellcheck warnings

* Add test-lint-shellcheck

* Add test-lint-shellcheck to workflow

* Use correct lint task

* output version which could be helpful for debugging

* Address PR feedback

* consistency++
2019-11-19 10:46:10 -05:00
Whymarrh Whitby
a271e7f456
Update Node version to 10.17 (#7447) 2019-11-17 15:32:26 -03:30
Dan Finlay
3ffda6c684
Merge pull request #7410 from MetaMask/fix-sourcemaps
Fix sourcemaps
2019-11-15 09:40:51 -08:00
Whymarrh Whitby
f2e3fa58b6
circleci: v2.1 (#7421) 2019-11-14 13:17:32 -03:30
Mark Stacey
1c6e09b1ce Fix sourcemaps
The `install` script of `@sentry/cli` is required for the Sentry CLI to
work correctly. Without this step, the sourcemap upload fails silently.
2019-11-13 16:54:04 -04:00
Mark Stacey
4b4c00e94f
Revert "Use common test build during CI (#7196)" (#7404)
This reverts commit b0ec610908, which was
introduced in #7196. This change was preventing the sourcemaps from
being uploaded correctly.
2019-11-13 11:02:59 -04:00
Mark Stacey
fe28e0d134
Cleanup beforeunload handler after transaction is resolved (#7333)
* Cleanup beforeunload handler after transaction is resolved

The notification window was updated to reject transactions upon close
in #6340. A handler that rejects the transaction was added to
`window.onbeforeunload`, and it was cleared in `actions.js` if it was
confirmed or rejected.

However, the `onbeforeunload` handler remained uncleared if the
transaction was resolved in another window. This results in the
transaction being rejected when the notification window closes, even
long after the transaction is submitted and confirmed. This has been
the cause of many problems with the Firefox e2e tests.

Instead the `onbeforeunload` handler is cleared in the
`componentWillUnmount` lifecycle function, alongside where it's set in
the first place. This ensures that it's correctly unset regardless
of how the transaction was resolved, and it better matches user
expectations.

* Fix indentation and remove redundant export

The `run-all.sh` Bash script now uses consistent indentation, and is
consistent about only re-exporting the Ganache arguments when they
change.

* Ensure transactions are completed before checking balance

Various intermittent e2e test failures appear to be caused by React
re-rendering the transaction list during the test, as the transaction
goes from pending to confirmed. To avoid this race condition, the
transaction is now explicitly looked for in the confirmed transaction
list in each of the tests using this pattern.

* Enable all e2e tests on Firefox

The remaining tests that were disabled on Firefox now work correctly.
Only a few timing adjustments were needed.

* Update Firefox used in CI

Firefox v70 is now used on CI instead of v68. This necessitated
rewriting the function where the extension ID was obtained because the
Firefox extensions page was redesigned.
2019-10-31 13:27:22 -03:00
Erik Marks
478d6563f2
Freeze Promise global on boot (#7309)
* freeze background and UI Promise globals on boot

* add new tests

* remove tape
2019-10-24 06:54:32 -07:00
kumavis
e1efb4d7ac
ci - install deps - limit install scripts to whitelist (#7208)
* ci - install deps - limit install scripts to those needed for build

* Update .circleci/scripts/deps-install.sh

Co-Authored-By: Mark Stacey <markjstacey@gmail.com>

* ci - install deps - expand install scripts needed for tests

* ci - install deps - expand install scripts needed for integration tests

* ci - install deps - fix node-sass script ref

* github - set codeowners for scripts/deps-install

* development - add utility to show deps with install scripts

* lint fix

* deps - move read-installed to devDeps
2019-09-25 20:01:10 +08:00
Mark Stacey
b0ec610908
Use common test build during CI (#7196)
* Use common test build during CI

Previously both e2e test jobs were running `test:build`. Now there is a
separate job that runs `test:build` that runs before each e2e test job,
so that `test:build` is only run once instead of twice.

* Move test builds to separate directory

This prevents the test build from conflicting with the production build
in later jobs.
2019-09-21 13:32:07 -03:00
Mark Stacey
9f21317a30
Verify locales on CI (#7199)
* Add '--quiet' flag to verify locales script

The `--quiet` flag reduces the console output to just the essential
information for running in a CI environment. For each locale, it will
print the number of unused messages (if any).

* Add `verify-locales` script to lint CI job

The locales are now verified as part of the lint CI job. Any unused
messages detected will result in the job failing.
2019-09-21 13:31:33 -03:00
kumavis
dbbf6986d2
ci - install deps with "--har" flag to capture network activity (#7143)
* ci - install deps with "--har" flag to capture network activity

* ci - add yarn install HAR logs to build-artifacts

* ci - yarn har - fix typo

* Update .circleci/scripts/collect-har-artifact.sh

Co-Authored-By: Mark Stacey <markjstacey@gmail.com>
2019-09-12 00:03:47 +08:00
kumavis
629f5ef221
ci - create source-map-explorer build-artifacts (#7141)
* ci - create source-map-explorer build-artifacts

* ci - add source-map-explorer builds to metamaskbot comment

* lint fix

* ci - source-map-explorer - include all bundles
2019-09-11 23:35:30 +08:00
kumavis
0985e8f012
ci - build-artifacts - generate sesify-viz for inspecting deps (#7151)
* ci - build-artifacts - generate sesify-viz for inspecting deps

* lint fix
2019-09-11 22:47:21 +08:00
Mark Stacey
c9fffafd9a
Publish GitHub release from master branch (#7136)
* Publish GitHub release from master branch

This ensures that changes made on `develop` since branching for the
release are not included. It also ensures that the final release
sourcemaps line-up correctly (they were always build on master)`.

* Consolidate publish jobs

The jobs `job-publish-release` and `create_github_release` both handle
different parts of publishing a release. They have been consolidated
into a single `job-publish-release` job.

* Update release script to expect a merge commit

The release script was originally written to be run on `develop`, so it
expected the current commit to be a result of `Squash & Merge`. Now
that it's run on `master`, it will generally be run against a merge
commit.

The version is now extracted from the commit message using a regular
expression that should work on all version of Bash v3+, and should be
tolerant of both merge commits and `Squash & Merge` commits.

* Target `master` with release PR

`master` is now targeted by the release PR instead of `develop`, as
the release has to be created from the master branch.

The update to `develop` is handled after the release by a PR from
`master` to `develop`, which is created automatically after the
release.
2019-09-11 11:44:36 -03:00
Whymarrh Whitby
d3eafc3703
Fix Coveralls CI job (#7008) 2019-08-14 10:41:01 -02:30
Whymarrh Whitby
6bc1077880
Make Coveralls its own optional CI job (#7002)
* ci: Move Coveralls into optional step

* Split Coveralls step out of test:coverage npm script
2019-08-13 13:29:10 -02:30
Whymarrh Whitby
e321feb92d
Fix Firefox e2e test command on CI (#7000)
* Skip a few Firefox tests to get them passing again
* ci: Fix Firefox e2e test command

This is my bad, introduced in 7fc84f3cc0
2019-08-13 10:27:18 -02:30
Mark Stacey
1fd3dc9ecf
Switch from npm to yarn (#6843)
As a solution to the constant lockfile churn issues we've had with
`npm`, the project now uses `yarn` to manage dependencies.

The `package-lock.json` file has been replaced with `yarn.lock`, which
was created using `yarn import`. It should approximate the contents of
`package-lock.json` fairly well, though there may be some changes due to
deduplication. The codeowners file has been updated to reference this
new lockfile.

All documentation and npm scripts have been updated to reference `yarn`
rather than `npm`. Note that running scripts using `npm run` still works
fine, but it seemed better to switch those to `yarn` as well to avoid
confusion.

The `npm-audit` Bash script has been replaced with `yarn-audit`. The
output of `yarn audit` is a bit different than `npm audit` in that it
returns a bitmask to describe which severity issues were found. This
made it simpler to check the results directly from the Bash script, so
the associated `npm-audit-check.js` script was no longer required. The
output should be exactly the same, and the information is still sourced
from the same place (the npm registry).

The new `yarn-audit` script does have an external dependency: `jq`.
However, `jq` is already assumed to be present by another CI script, and
is present on all CI images we use. `jq` was not added to `package.json`
as a dependency because there is no official package on the npm
registry, just wrapper scripts. We don't need it anywhere exept on CI
anyway.

The section in `CONTRIBUTING` about how to develop inside the
`node_modules` folder was removed, as the advice was a bit dated, and
wasn't specific to this project anyway.
2019-07-30 15:36:23 -03:00
Mark Stacey
ad1e447252
Run test-deps in parallel with prep-deps-npm (#6909)
`test-deps` runs `npm audit`, which doesn't require the dependencies to
be installed. `npm audit` just uses the lockfile.
2019-07-25 14:07:54 -03:00
Mark Stacey
754f98aea2
Fix npm-audit script (#6908)
The npm audit script was auditing all dependencies, then filtering the
results to just the advisories concerning production dependencies. This
was done by checking the boolean `dev` and `optional` properties of each
`findings` entry in each advisory.

The `dev` and `optional` properties are now missing, which is resulting
in dev advisories being mistakenly identified as affecting production.

This check has been removed, and instead the `--production` flag is used
when calling `npm audit`. This accomplishes the same goal without
relying as much upon the audit output format.

The `--production` flag was added in `npm` `v6.10.0`, so `npm` has been
updated to the current latest stable (`v6.10.2`) for the `test-deps`
job. It was also updated on the `prep-deps-npm` job to ensure
consistency in behaviour. The other jobs only use `npm run` which hasn't
changed substantially in some time, so compatibility isn't really a
concern for those.

`audit.json` has also been added to `.gitignore`. It was accidentally
checked in once while working on this branch.
2019-07-24 19:54:16 -03:00
Whymarrh Whitby
83c2440509 Add scripts to automate GitHub releases (#6653)
* ci: Rename full_test to test_and_release

* ci: Add scripts to automate GH releases

* Add .bak files to .gitignore

* ci: Add reviewer to the auto version PR
2019-07-17 22:51:47 -07:00
Mark Stacey
32fffe53f5
Remove Drizzle tests (#6855)
The Drizzle tests have not been used for some time. They were used to
ensure compatibility with newer versions of `web3` v1. If we want to
re-add tests to ensure compatibility with newer `web3` versions, we
should find some way of doing that more reliably than was done here -
these tests were somewhat flaky and unreliable.
2019-07-15 17:10:46 -03:00
Mark Stacey
0366459edd
Update version of Firefox used on CI (#6841) 2019-07-15 10:15:15 -03:00
Whymarrh Whitby
b7f3f26ebf
Remove job-screens CI job (#6823)
* Remove job-screens CI job
* Remove unused dependencies, now that job-screens is gone
2019-07-08 17:02:15 -02:30
Mark Stacey
cc7bb306e2
Increase CircleCI addons-linter memory (#6802)
`addons-linter` will occasionally run out of heap space. This provides 3
GB of heap for that script rather than the default ~1.5 GB. The CircleCI
containers have 4GB of memory, so this should leave plenty of extra
space for non-heap memory.
2019-07-04 11:53:02 -03:00
Dan Finlay
448720327b
Merge pull request #6765 from MetaMask/master
Using admin privilege to bypass code owner review because it has already [been reviewed](https://github.com/MetaMask/metamask-extension/pull/6763) and those code owners are out today.
2019-07-01 10:58:25 -07:00