Skip to content

Commit

Permalink
Merge branch 'master' into aaronmgdr/build4
Browse files Browse the repository at this point in the history
* master: (62 commits)
  Fix e2e on CI (#1537)
  Allow a specified address to disable/enable the Exchange  (#1467)
  Avoid re-encrypting key files with yarn keys:encrypt command (#1560)
  Support protocol hotfixing (#613)
  Point e2e tests back (#1562)
  Refactor to Accounts.sol (#1392)
  Add selectIssuers Transaction (#1327)
  [Wallet] Get React Native Hot Reloading Working (#1551)
  Unify to prefix messages for signing (#1473)
  [Wallet] Improve error handling around account creation and keystore ops (#1497)
  Add CI test for checking licenses and misc package.json cleanup (#1550)
  [Wallet] Implement SMS invite on iOS (#1541)
  CI: brings back to master (#1554)
  Validators: uses Ethereum address for proof of possession (#1494)
  Validate Attestation Requests (#1468)
  Rename hosted node references to forno (#1511)
  Bump rubyzip from 1.2.3 to 1.3.0 in /packages/mobile (#1508)
  Added txpool family to geth apis. Sorted geth cmd options (#1462)
  [Wallet] Fix yarn dev command for running android (#1534)
  [Wallet] iOS info plist changes and version bump (#1539)
  ...

# Conflicts:
#	yarn.lock
  • Loading branch information
aaronmgdr committed Nov 2, 2019
2 parents 1615eb7 + 8848975 commit 5443289
Show file tree
Hide file tree
Showing 473 changed files with 15,152 additions and 7,485 deletions.
78 changes: 59 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ reference:
shell: /bin/bash --login -eo pipefail
environment:
TERM: dumb
JVM_OPTS: -Xmx3200m
_JAVA_OPTIONS: "-Xmx7g -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.configureondemand=true -Dorg.gradle.jvmargs="-Xmx6g -XX:MaxPermSize=3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"'

defaults: &defaults
working_directory: ~/app
Expand All @@ -25,10 +26,10 @@ defaults: &defaults
android-defaults: &android-defaults
<<: *defaults
docker:
- image: circleci/android:api-28-node8-alpha
- image: circleci/android:api-28-node
environment:
_JAVA_OPTIONS: "-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-Xmx1024m -XX:+HeapDumpOnOutOfMemoryError"'
_JAVA_OPTIONS: "-Xmx7g -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.configureondemand=true -Dorg.gradle.jvmargs="-Xmx6g -XX:MaxPermSize=3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"'

e2e-defaults: &e2e-defaults
<<: *defaults
Expand Down Expand Up @@ -115,6 +116,10 @@ jobs:
yarn build --scope @celo/walletkit
yarn build --ignore @celo/protocol --ignore docs --ignore @celo/walletkit
- run:
name: Check licenses
command: yarn check-licenses

- persist_to_workspace:
root: .
paths:
Expand Down Expand Up @@ -144,7 +149,6 @@ jobs:
echo 'export ANDROID_SDK_ROOT="/usr/local/share/android-sdk"' >> $BASH_ENV
echo 'export QEMU_AUDIO_DRV=none' >> $BASH_ENV
export PATH=$PATH:/usr/local/share/android-sdk/platform-tools/
export GRADLE_OPTS='-Dorg.gradle.daemon=true -Dorg.gradle.parallel=true -Dorg.gradle.jvmargs="-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError"'
- run:
name: Install Android sdk
command: |
Expand Down Expand Up @@ -183,11 +187,12 @@ jobs:
- run: nvm install v10.16.3 && nvm use v10.16.3
- run:
name: install miscellaneous
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install tree
command: |
HOMEBREW_NO_AUTO_UPDATE=1 brew install tree coreutils
# Currently not used
# - run: npm install --global react-native-kill-packager
- run:
# need to run this because it's another OS than install_dependecies job
# need to run this because it's another OS than install_dependencies job
name: yarn
command: |
# TODO, Make cache work and figure out why this doesn't work
Expand All @@ -198,8 +203,9 @@ jobs:
# echo "Cache found, just run post-script."
# yarn postinstall
# fi
yarn
yarn build
yarn || yarn
yarn build || yarn build
yarn run jetify
- save_cache:
key: yarn-v4-macos-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
Expand All @@ -211,6 +217,9 @@ jobs:
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pidcat watchman
- restore_cache:
key: yarn-v3-{{ arch }}-{{ .Branch }}-{{ checksum "packages/mobile/android/build.gradle" }}-{{ checksum "packages/mobile/android/settings.gradle" }}-{{ checksum "packages/mobile/android/app/build.gradle" }}-{{ checksum "packages/mobile/.env.test" }}
- run:
name: Make sure there's only one adb # This is probably a brew bug
command: cp /usr/local/share/android-sdk/platform-tools/adb /usr/local/bin/adb
- run:
name: Start emulator
command: cd ~/src/packages/mobile && bash ./scripts/start_emulator.sh
Expand All @@ -228,12 +237,26 @@ jobs:
name: Sleep until Device connects
command: cd ~/src/packages/mobile && bash ./scripts/wait_for_emulator_to_connect.sh
# TODO - run: unlock device
- run:
name: Start pidcat logging
command: pidcat -t "GoLog" -t "Go" # React logs are on metro step since RN 61
background: true
- run:
name: Run yarn dev
command: cd ~/src/packages/mobile && ENVFILE=".env.test" yarn dev
- run:
name: Restart adb
command: adb kill-server && adb start-server
- run:
name: Run test itself
command: cd ~/src/packages/mobile && ENVFILE=".env.test" yarn test:detox

command: |
cd ~/src/packages/mobile
# detox sometimes without releasing the terminal and thus making the CI timout
# 480s = 8 minutes
timeout 480 yarn test:detox || echo "failed, try again"
timeout 480 yarn test:detox || echo "detox failed, return 0 to prevent CI from failing"
# TODO errors are currently not reported, until we figure out why detox can't find functions https://github.com/wix/Detox/issues/1723
- run: cd ~/src
- save_cache:
key: yarn-v3-{{ arch }}-{{ .Branch }}-{{ checksum "packages/mobile/android/build.gradle" }}-{{ checksum "packages/mobile/android/settings.gradle" }}-{{ checksum "packages/mobile/android/app/build.gradle" }}-{{ checksum "packages/mobile/.env.test" }}
Expand Down Expand Up @@ -264,22 +287,17 @@ jobs:
yarn run lerna --ignore @celo/contractkit --ignore @celo/mobile --ignore @celo/protocol --ignore @celo/celotool --ignore @celo/walletkit --ignore @celo/celocli run test
mobile-test-build-app:
working_directory: ~/app
docker:
- image: circleci/android:api-28
<<: *android-defaults
resource_class: large

steps:
- attach_workspace:
at: ~/app

- run:
name: Set GRADLE_OPTS to speed up gradle
command: |
export GRADLE_OPTS='-Dorg.gradle.daemon=true -Dorg.gradle.parallel=true -Dorg.gradle.jvmargs="-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError"'
- run:
name: Build Android app (debug version)
command: |
set -euo pipefail
yarn run jetify
cd packages/mobile/android
ENVFILE=.env.test ./gradlew assembleDebug
cd -
Expand All @@ -294,7 +312,7 @@ jobs:
name: Ensure translations are not missing
command: |
cd packages/mobile
./scripts/verify_locales.sh
yarn --cwd packages/mobile test:verify-locales
- run:
name: jest tests
Expand Down Expand Up @@ -598,6 +616,24 @@ jobs:
cd packages/celotool
./ci_test_attestations.sh checkout master
end-to-end-geth-validator-order-test:
<<: *e2e-defaults
resource_class: large
steps:
- attach_workspace:
at: ~/app
- run:
name: Check if the test should run
command: |
FILES_TO_CHECK="${PWD}/packages/celotool,${PWD}/packages/protocol,${PWD}/.circleci/config.yml"
./scripts/ci_check_if_test_should_run_v2.sh ${FILES_TO_CHECK}
- run:
name: Run test
command: |
set -e
cd packages/celotool
./ci_test_validator_order.sh checkout master
web:
working_directory: ~/app
docker:
Expand Down Expand Up @@ -730,6 +766,10 @@ workflows:
requires:
- lint-checks
- contractkit-test
- end-to-end-geth-validator-order-test:
requires:
- lint-checks
- contractkit-test
npm-install-testing-cron-workflow:
triggers:
- schedule:
Expand Down
10 changes: 6 additions & 4 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,22 @@ CLUSTER_DOMAIN_NAME="celo-networks-dev"
TESTNET_PROJECT_NAME="celo-testnet"

BLOCKSCOUT_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/blockscout"
BLOCKSCOUT_WEB_DOCKER_IMAGE_TAG="web-f6c3e0888d1d0ef72dc8bf870808702b7fd13730"
BLOCKSCOUT_INDEXER_DOCKER_IMAGE_TAG="indexer-f6c3e0888d1d0ef72dc8bf870808702b7fd13730"
BLOCKSCOUT_DOCKER_IMAGE_TAG="5fba4843b3e78b5ab75d01766214cb24c6a40649"
BLOCKSCOUT_WEB_REPLICAS=3
BLOCKSCOUT_DB_SUFFIX=

ETHSTATS_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/ethstats"
ETHSTATS_DOCKER_IMAGE_TAG="i0ffe524c625ea59e4492dc92c2e638689c36e4b0"

GETH_NODE_DOCKER_IMAGE_REPOSITORY="us.gcr.io/celo-testnet/geth"
# When upgrading change this to latest commit hash from the master of the geth repo
# `geth $ git show | head -n 1`
GETH_NODE_DOCKER_IMAGE_TAG="7fbd6f3574f1c1c1e657c152fc63fb771adab3af"
GETH_NODE_DOCKER_IMAGE_TAG="ba213df07070433970d9b2cf75bae1d146cbfeda"

GETH_BOOTNODE_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/geth-all"
# When upgrading change this to latest commit hash from the master of the geth repo
# `geth $ git show | head -n 1`
GETH_BOOTNODE_DOCKER_IMAGE_TAG="7fbd6f3574f1c1c1e657c152fc63fb771adab3af"
GETH_BOOTNODE_DOCKER_IMAGE_TAG="ba213df07070433970d9b2cf75bae1d146cbfeda"

CELOTOOL_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/celo-monorepo"
CELOTOOL_DOCKER_IMAGE_TAG="celotool-dfdc3e8b26e98aa294b27e2b5621c184488a10db"
Expand Down
3 changes: 1 addition & 2 deletions .env.integration
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ CLUSTER_DOMAIN_NAME="celo-testnet"
TESTNET_PROJECT_NAME="celo-testnet"

BLOCKSCOUT_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/blockscout"
BLOCKSCOUT_WEB_DOCKER_IMAGE_TAG="web-f6c3e0888d1d0ef72dc8bf870808702b7fd13730"
BLOCKSCOUT_INDEXER_DOCKER_IMAGE_TAG="indexer-f6c3e0888d1d0ef72dc8bf870808702b7fd13730"
BLOCKSCOUT_DOCKER_IMAGE_TAG="ad86714d629c01272e0651dec1fb6a968c3cec71"
BLOCKSCOUT_WEB_REPLICAS=3
BLOCKSCOUT_DB_SUFFIX="25"
BLOCKSCOUT_SUBNETWORK_NAME="Integration"
Expand Down
20 changes: 10 additions & 10 deletions README-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@

Many packages depend on other packages within the monorepo. When this happens, follow these rules:

1. All packages must use **master version** of sibling packages.
2. Exception to (1) are packages that represent a GAE/firebase app which must use the last published version.
3. To differentiate published vs unpublished version. Master version (in package.json) must end with suffix `-dev` and should not be published.
4. If a developer want to publish a version; then after publishing it needs to set master version to next `-dev` version and change all package.json that require on it.
1. All packages must use **master version** of sibling packages.
2. Exception to (1) are packages that represent a GAE/firebase app which must use the last published version.
3. To differentiate published vs unpublished version. Master version (in package.json) must end with suffix `-dev` and should not be published.
4. If a developer want to publish a version; then after publishing it needs to set master version to next `-dev` version and change all package.json that require on it.

To check which pakages need amending, you can run (in the root pkg):

yarn check:packages

A practical example:

* In any given moment, `contractkit/package.json#version` field **must** of the form `x.y.z-dev`
* If current version of contractkit is: `0.1.6-dev` and we want to publish a new version, we should:
* publish version `0.1.6`
* change `package.json#version` to `0.1.7-dev`
* change in other packages within monorepo that were using `0.1.6-dev` to `0.1.7-dev`
- In any given moment, `contractkit/package.json#version` field **must** of the form `x.y.z-dev`
- If current version of contractkit is: `0.1.6-dev` and we want to publish a new version, we should:
- publish version `0.1.6`
- change `package.json#version` to `0.1.7-dev`
- change in other packages within monorepo that were using `0.1.6-dev` to `0.1.7-dev`

## How to publish a new npm package

First checkout the alfajores branch.
Expand Down
3 changes: 1 addition & 2 deletions SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ Execute the following (and make sure the lines are in your `~/.bash_profile`):
```bash
export ANDROID_HOME=/usr/local/share/android-sdk
export ANDROID_NDK=/usr/local/share/android-ndk
# Optional to speedup java builds
export GRADLE_OPTS='-Dorg.gradle.daemon=true -Dorg.gradle.parallel=true -Dorg.gradle.jvmargs="-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError"'
```

Expand Down Expand Up @@ -205,7 +204,7 @@ Install the Android 28 system image and create an Android Virtual Device:

```bash
sdkmanager "system-images;android-28;google_apis;x86"
avdmanager create avd --force --name Nexus_5X_API_28 --device "Nexus 5X" -k "system-images;android-28;google_apis;x86" --abi "google_apis/x86"
avdmanager create avd --force --name Nexus_5X_API_28_x86 --device "Nexus 5X" -k "system-images;android-28;google_apis;x86" --abi "google_apis/x86"
```

Execute the following and add it to your `~/.bash_profile`:
Expand Down
4 changes: 0 additions & 4 deletions dockerfiles/transaction-metrics-exporter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,13 @@ COPY scripts/ scripts/
# Copy only pkg.json
COPY packages/typescript/package.json packages/typescript/
COPY packages/utils/package.json packages/utils/
COPY packages/protocol/package.json packages/protocol/
COPY packages/contractkit/package.json packages/contractkit/
COPY packages/transaction-metrics-exporter/package.json packages/transaction-metrics-exporter/

RUN yarn install --network-timeout 100000 --frozen-lockfile && yarn cache clean

# Copy the rest
COPY packages/typescript packages/typescript/
COPY packages/utils packages/utils/
COPY packages/protocol/ packages/protocol/
COPY packages/contractkit packages/contractkit/
COPY packages/transaction-metrics-exporter packages/transaction-metrics-exporter/

# build all
Expand Down
15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"reset-yarn": "yarn cache clean",
"test": "yarn run lerna run test",
"build": "yarn run lerna run build",
"check-licenses": "yarn licenses list --prod | grep '\\(─ GPL\\|─ (GPL-[1-9]\\.[0-9]\\+ OR GPL-[1-9]\\.[0-9]\\+)\\)' && echo 'Found GPL license(s). Use 'yarn licenses list --prod' to look up the offending package' || echo 'No GPL licenses found'",
"report-coverage": "yarn run lerna run test-coverage",
"test:watch": "node node_modules/jest/bin/jest.js --watch",
"postinstall": "yarn run lerna run postinstall && patch-package && yarn keys:decrypt",
Expand All @@ -35,26 +36,28 @@
"packages/*"
],
"nohoist": [
"@celo/verifier/react-native",
"@celo/mobile/react-native",
"@celo/react-components/react-native",
"@celo/web/@timkendrick/monaco-editor",
"@celo/web/@types/react-i18next",
"@celo/web/next-i18next",
"**/openzeppelin-solidity"
]
},
"devDependencies": {
"@types/jest": "^24.0.17",
"@babel/core": "^7.6.2",
"@babel/runtime": "^7.6.2",
"@types/jest": "^24.0.18",
"babel-jest": "^24.9.0",
"husky": "^3.0.0",
"lerna": "^3.16.0",
"patch-package": "^5.1.1",
"prettier": "1.13.5",
"pretty-quick": "^1.11.1",
"solc": "0.5.8",
"tslint": "^5.20.0",
"jest": "^24.8.0",
"ts-jest": "^24.0.2",
"jest": "^24.9.0",
"jest-junit": "^8.0.0",
"jest-snapshot": "^24.9.0",
"ts-jest": "^24.1.0",
"typescript-tslint-plugin": "^0.5.4",
"tsconfig-paths": "^3.8.0",
"ts-node": "^8.3.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/attestation-service/config/.env.development
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
DB_URL=sqlite://db/dev.db
CELO_PROVIDER=https://integration-infura.celo-testnet.org
DATABASE_URL=sqlite://db/dev.db
CELO_PROVIDER=https://integration-forno.celo-testnet.org
ACCOUNT_ADDRESS=0xE6e53b5fc2e18F51781f14a3ce5E7FD468247a15
ATTESTATION_KEY=x
APP_SIGNATURE=x
Expand Down
6 changes: 3 additions & 3 deletions packages/attestation-service/config/database.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"development": {
"use_env_variable": "DB_URL"
"use_env_variable": "DATABASE_URL"
},
"staging": {
"use_env_variable": "DB_URL"
"use_env_variable": "DATABASE_URL"
},
"production": {
"use_env_variable": "DB_URL"
"use_env_variable": "DATABASE_URL"
}
}
Loading

0 comments on commit 5443289

Please sign in to comment.