Skip to content

V58 ms Mac and linter fixes #26

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

Merged
merged 7 commits into from
Mar 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 2 additions & 2 deletions appveyor.yml → .appveyor/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
environment:
ANDROID_HOME: "C:\\android-sdk-windows"
ANDROID_NDK: "C:\\android-sdk-windows\\android-ndk-r17c"
ANDROID_BUILD_VERSION: 27
ANDROID_TOOLS_VERSION: 27.0.3
ANDROID_BUILD_VERSION: 28
ANDROID_TOOLS_VERSION: 28.0.3

GRADLE_OPTS: -Dorg.gradle.daemon=false

Expand Down
2 changes: 1 addition & 1 deletion .buckconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

[maven_repositories]
central = https://repo1.maven.org/maven2
google = https://maven.google.com
google = https://dl.google.com/dl/android/maven2/

[alias]
rntester = //RNTester/android/app:app
154 changes: 86 additions & 68 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ aliases:
- &restore-yarn-cache
keys:
- v1-yarn-cache-{{ arch }}-{{ checksum "package.json" }}
- v1-yarn-cache-{{ arch }}
- v1-yarn-cache-{{ arch }}-fixed
- &save-yarn-cache
paths:
- ~/.cache/yarn
Expand Down Expand Up @@ -36,16 +36,14 @@ aliases:

- &restore-cache-gradle
keys:
- v1-gradle-{{ .Branch }}-{{ checksum "build.gradle" }}-{{ checksum "ReactAndroid/build.gradle" }}
- v2-gradle-{{ .Branch }}-{{ checksum "build.gradle" }}-{{ checksum "ReactAndroid/build.gradle" }}
# Fallback in case checksum fails
- v1-gradle-{{ .Branch }}-{{ checksum "build.gradle" }}-
- v1-gradle-{{ .Branch }}-
# Fallback in case this is a first-time run on a fork
- v1-gradle-master-
- v2-gradle-{{ .Branch }}-{{ checksum "build.gradle" }}-
- v2-gradle-{{ .Branch }}-fixed
- &save-cache-gradle
paths:
- ~/.gradle
key: v1-gradle-{{ .Branch }}-{{ checksum "build.gradle" }}-{{ checksum "ReactAndroid/build.gradle" }}
key: v2-gradle-{{ .Branch }}-{{ checksum "build.gradle" }}-{{ checksum "ReactAndroid/build.gradle" }}

- &restore-cache-ndk
keys:
Expand All @@ -57,13 +55,13 @@ aliases:

- &restore-cache-downloads-buck
keys:
- v3-buck-v2018.07.23.01-{{ checksum "scripts/circleci/buck_fetch.sh" }}}
- v3-buck-v2018.07.23.01-
- v3-buck-v2018.10.29.01-{{ checksum "scripts/circleci/buck_fetch.sh" }}}
- v3-buck-v2018.10.29.01-fixed
- &save-cache-downloads-buck
paths:
- ~/buck
- ~/okbuck
key: v3-buck-v2018.07.23.01-{{ checksum "scripts/circleci/buck_fetch.sh" }}
key: v3-buck-v2018.10.29.01-{{ checksum "scripts/circleci/buck_fetch.sh" }}

- &restore-cache-watchman
keys:
Expand All @@ -75,14 +73,22 @@ aliases:

- &restore-cache-downloads-gradle
keys:
- v1-gradle-{{ checksum "ReactAndroid/build.gradle" }}-{{ checksum "scripts/circleci/gradle_download_deps.sh" }}
- v1-gradle-
- v2-gradle-{{ checksum "ReactAndroid/build.gradle" }}-{{ checksum "scripts/circleci/gradle_download_deps.sh" }}
- v2-gradle-fixed
- &save-cache-downloads-gradle
paths:
- ~/.gradle
- ReactAndroid/build/downloads
- ReactAndroid/build/third-party-ndk
key: v1-gradle-{{ checksum "ReactAndroid/build.gradle" }}-{{ checksum "scripts/circleci/gradle_download_deps.sh" }}
key: v2-gradle-{{ checksum "ReactAndroid/build.gradle" }}-{{ checksum "scripts/circleci/gradle_download_deps.sh" }}

- &restore-cache-homebrew
keys:
- v1-homebrew-fixed
- &save-cache-homebrew
paths:
- /usr/local/Homebrew
key: v1-homebrew

# Branch Filtering
- &filter-only-master-stable
Expand Down Expand Up @@ -132,7 +138,7 @@ aliases:
name: Install BUCK
command: |
if [[ ! -e ~/buck ]]; then
git clone https://github.com/facebook/buck.git ~/buck --branch v2018.07.23.01 --depth=1
git clone https://github.com/facebook/buck.git ~/buck --branch v2018.10.29.01 --depth=1
fi
cd ~/buck && ant
buck --version
Expand Down Expand Up @@ -185,15 +191,19 @@ aliases:
name: Lint code
command: scripts/circleci/exec_swallow_error.sh yarn lint --format junit -o ~/react-native/reports/junit/eslint/results.xml

- &run-flow-checks
name: Check for errors in code using Flow
command: yarn flow check
- &run-flow-checks-ios
name: Check for errors in code using Flow (iOS)
command: yarn flow-check-ios

- &run-flow-checks-android
name: Check for errors in code using Flow (Android)
command: yarn flow-check-android

- &run-sanity-checks
name: Sanity checks
command: |
./scripts/circleci/check_license.sh
./scripts/circleci/check_cache.sh
./scripts/circleci/validate_yarn_lockfile.sh
when: always

- &download-dependencies-gradle
Expand Down Expand Up @@ -229,7 +239,7 @@ aliases:

- &compile-native-libs
name: Compile Native Libs for Unit and Integration Tests
command: ./gradlew :ReactAndroid:packageReactNdkLibsForBuck -Pjobs=$BUILD_THREADS -Pcom.android.build.threadPoolSize=1
command: ./gradlew :ReactAndroid:packageReactNdkLibsForBuck -Pjobs=$BUILD_THREADS
no_output_timeout: 6m

- &run-android-unit-tests
Expand Down Expand Up @@ -273,20 +283,12 @@ aliases:

- &boot-simulator-iphone
name: Boot iPhone Simulator
command: xcrun simctl boot "iPhone 5s" || true

- &boot-simulator-appletv
name: Boot Apple TV Simulator
command: xcrun simctl boot "Apple TV" || true
command: source scripts/.tests.env && xcrun simctl boot "$IOS_DEVICE" || true

- &run-objc-ios-tests
name: iOS Test Suite
command: ./scripts/objc-test-ios.sh test

- &run-objc-tvos-tests
name: tvOS Test Suite
command: ./scripts/objc-test-tvos.sh test

- &display-broken-tests-warning
name: Running broken tests (Ignore any failures past this point)
command: |
Expand All @@ -300,16 +302,12 @@ aliases:

- &run-e2e-tests
name: End-to-End Test Suite (Disabled)
command: ./scripts/circleci/exec_author_check.sh node ./scripts/run-ci-e2e-tests.js --android --ios --tvos --js --retries 3;
command: ./scripts/circleci/exec_author_check.sh node ./scripts/run-ci-e2e-tests.js --android --ios --js --retries 3;

- &run-objc-ios-e2e-tests
name: iOS End-to-End Test Suite (Disabled)
command: ./scripts/circleci/exec_author_check.sh node ./scripts/run-ci-e2e-tests.js --ios --retries 3;

- &run-objc-tvos-e2e-tests
name: tvOS End-to-End Test Suite (Disabled)
command: ./scripts/circleci/exec_author_check.sh node ./scripts/run-ci-e2e-tests.js --tvos --js --retries 3;

- &run-android-e2e-tests
name: Android End-to-End Test Suite (Disabled)
command: ./scripts/circleci/exec_author_check.sh node ./scripts/run-ci-e2e-tests.js --android --retries 3;
Expand Down Expand Up @@ -346,7 +344,7 @@ android_defaults: &android_defaults
macos_defaults: &macos_defaults
<<: *defaults
macos:
xcode: "9.4.0"
xcode: "10.1.0"

version: 2
jobs:
Expand Down Expand Up @@ -377,7 +375,8 @@ jobs:
at: ~/react-native

- run: *run-lint-checks
- run: *run-flow-checks
- run: *run-flow-checks-ios
- run: *run-flow-checks-android

- store_test_results:
path: ~/react-native/reports/junit
Expand Down Expand Up @@ -411,25 +410,19 @@ jobs:
- store_test_results:
path: ~/react-native/reports/junit

# Runs unit tests on iOS and Apple TV devices
test_objc:
# Runs unit tests on iOS devices
test_ios:
<<: *macos_defaults
steps:
- attach_workspace:
at: ~/react-native

- run: *boot-simulator-iphone
- run: *boot-simulator-appletv
- run: *brew-install-watchman

- restore-cache: *restore-cache-homebrew
- run: *brew-install-watchman
- save-cache: *save-cache-homebrew
- run: *run-objc-ios-tests
- run: *run-objc-tvos-tests

# TODO: Fix these failing tests.
- run: *display-broken-tests-warning
- run: *run-podspec-tests
- run: *run-objc-ios-e2e-tests
- run: *run-objc-tvos-e2e-tests

- store_test_results:
path: ~/react-native/reports/junit
Expand Down Expand Up @@ -538,12 +531,18 @@ jobs:
# Analyze pull request and raise any lint/flow issues.
# Issues will be posted to the PR itself via GitHub bots.
# This workflow should only fail if the bots fail to run.
# The public github tokens are publicly visible by design
analyze_pr:
<<: *defaults
docker:
- image: circleci/node:10
environment:
- PATH: "/opt/yarn/yarn-v1.5.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
- PUBLIC_PULLBOT_GITHUB_TOKEN_A: "a6edf8e8d40ce4e8b11a"
- PUBLIC_PULLBOT_GITHUB_TOKEN_B: "150e1341f4dd9c944d2a"
- PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A: "78a72af35445ca3f8180"
- PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B: "b1a98e0bbd56ff1ccba1"

steps:
- checkout
- run: *setup-artifacts
Expand All @@ -552,29 +551,41 @@ jobs:
- run: *yarn

- run:
name: Analyze Code
name: Analyze Shell Scripts
command: |
# GITHUB_TOKEN=eslint-bot public_repo access token
if [ -n "$CIRCLE_PR_NUMBER" ]; then
echo -e "\\x1B[36mInstalling additional dependencies\\x1B[0m"; yarn add @octokit/rest@15.10.0
echo -e "\\x1B[36mAnalyzing code\\x1B[0m"; GITHUB_TOKEN="af6ef0d15709bc91d""06a6217a5a826a226fb57b7" ./scripts/circleci/analyze_code.sh
else
echo "Skipping code analysis."
fi
echo -e "\\x1B[36mInstalling additional dependencies\\x1B[0m"
sudo apt-get install -y shellcheck
yarn add @octokit/rest@15.10.0
echo -e "\\x1B[36mAnalyzing shell scripts\\x1B[0m"; \
GITHUB_TOKEN="$PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A""$PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B" \
GITHUB_OWNER="$CIRCLE_PROJECT_USERNAME" \
GITHUB_REPO="$CIRCLE_PROJECT_REPONAME" \
GITHUB_PR_NUMBER="$CIRCLE_PR_NUMBER" \
./scripts/circleci/analyze_scripts.sh
when: always

- restore-cache: *restore-cache-analysis
- run:
name: Analyze Code
command: |
echo -e "\\x1B[36mInstalling additional dependencies\\x1B[0m"; yarn add @octokit/rest@15.10.0
echo -e "\\x1B[36mAnalyzing code\\x1B[0m"; \
GITHUB_TOKEN="$PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A""$PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B" \
GITHUB_OWNER="$CIRCLE_PROJECT_USERNAME" \
GITHUB_REPO="$CIRCLE_PROJECT_REPONAME" \
GITHUB_PR_NUMBER="$CIRCLE_PR_NUMBER" \
./scripts/circleci/analyze_code.sh
when: always

- run:
name: Analyze Pull Request
command: |
# DANGER_GITHUB_API_TOKEN=React-Linter public_repo access token
if [ -n "$CIRCLE_PR_NUMBER" ]; then
cd bots
yarn install --non-interactive --cache-folder ~/.cache/yarn
DANGER_GITHUB_API_TOKEN="80aa64c50f38a267e9ba""575d41d528f9c234edb8" yarn danger
else
echo "Skipping pull request analysis."
fi
echo -e "\\x1B[36mInstalling additional dependencies\\x1B[0m"
cd bots
yarn install --non-interactive --cache-folder ~/.cache/yarn
echo -e "\\x1B[36mAnalyzing pull request\\x1B[0m"; \
DANGER_GITHUB_API_TOKEN="$PUBLIC_PULLBOT_GITHUB_TOKEN_A""$PUBLIC_PULLBOT_GITHUB_TOKEN_B" \
yarn danger
when: always
- save-cache: *save-cache-analysis

Expand Down Expand Up @@ -659,8 +670,8 @@ workflows:
requires:
- checkout_code

# Test iOS & tvOS
- test_objc:
# Test iOS
- test_ios:
filters: *filter-ignore-gh-pages
requires:
- checkout_code
Expand All @@ -670,15 +681,22 @@ workflows:
requires:
- checkout_code

# Tooling Compatibility Checks
- test_node10:
filters: *filter-ignore-gh-pages

# Only runs on vX.X.X tags if all tests are green
- publish_npm_package:
filters:
# ignore any commit on any branch by default
branches:
only:
- /.*-stable/
ignore: /.*/
# only act on version tags
tags:
only: /v[0-9]+(\.[0-9]+)*(\-rc(\.[0-9]+)?)?/

# Run code checks
# Run code checks on PRs from forks
- analyze_pr:
filters: *filter-ignore-master-stable
filters:
branches:
only: /^pull\/.*$/
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ indent_size = 2

[*.gradle]
indent_size = 4

[BUCK]
indent_size = 4
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"no-constant-condition": 0, // disallow use of constant expressions in conditions
"no-control-regex": 1, // disallow control characters in regular expressions
"no-debugger": 1, // disallow use of debugger
"no-dupe-class-members": 2, // Disallow duplicate name in class members
"no-dupe-keys": 2, // disallow duplicate keys when creating object literals
"no-empty": 0, // disallow empty statements
"no-ex-assign": 1, // disallow assigning to the exception in a catch block
Expand Down
10 changes: 7 additions & 3 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ module.system.haste.paths.blacklist=.*/__mocks__/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/Libraries/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/RNTester/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/IntegrationTests/.*
module.system.haste.paths.blacklist=<PROJECT_ROOT>/Libraries/react-native/react-native-implementation.js
module.system.haste.paths.blacklist=<PROJECT_ROOT>/Libraries/Animated/src/polyfills/.*

munge_underscores=true
Expand All @@ -75,8 +76,8 @@ suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*[react_native\\(_ios\\)?_oss|react_native\\(_ios\\)?_fb][a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*[react_native\\(_ios\\)?_oss|react_native\\(_ios\\)?_fb][a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

Expand Down Expand Up @@ -105,4 +106,7 @@ untyped-import
untyped-type-import

[version]
^0.78.0
^0.86.0

[untyped]
.*/node_modules/metro/.*
Loading