Граф коммитов

123 Коммитов

Автор SHA1 Сообщение Дата
Héctor Ramos 9bd276c06b Rename Detox job, collect all e2e steps under test_end_to_end (#24689)
Summary:
Rename test_detox_end_to_end to test_end_to_end, then move JavaScript and iOS end-to-end tests to this job.

Fixes an issue in the end-to-end tests, but does not yet bring them back fully to green.

[General] [Changed] - Collect e2e tests under test_end_to_end job
Pull Request resolved: https://github.com/facebook/react-native/pull/24689

Differential Revision: D15202242

Pulled By: hramos

fbshipit-source-id: e7a9627896d2990cb6ddd0d3a91b915781ac2417
2019-05-03 14:38:10 -07:00
Héctor Ramos 0a16b53a78 Use Xcode 10.2.0 and iOS 12.2 in iOS tests (#24572)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/24572

Bumps to Xcode 10.2.0 and uses the iOS 12.2 simulator when running tests.

Changelog:

[iOS] [Changed] - iOS tests: Bump Xcode to 10.2.0, iOS to 12.2.

Reviewed By: cpojer

Differential Revision: D15049833

fbshipit-source-id: 40ee039f8be4db1365ad650b45e2e3e0a4ea80f3
2019-04-24 09:33:17 -07:00
empyrical b27d1d3da2 Remove out-of-tree platform tests (#24536)
Summary:
This pull request removes the tests for out-of-tree platforms and the dependency on the package `react-native-dummy` from the React Native repo.

The logic that this was meant to test was moved to the React Native CLI repo, and [it is being tested there](827daa4c16/packages/cli/src/tools/config/__tests__/index-test.js (L125-L152)) as well making this a bit redundant at this point.

The dependency on `react-native-dummy` was also an issue, because when the file structure under `Libraries/` changes, bundler errors could crop up if there wasn't an update made to the file structure of `react-native-dummy/Libraries/`.

This was an issue when [`TabBarIOS` was removed](02697291ff (diff-b9cfc7f2cdf78a7f4b91a753d10865a2)) - `react-native-dummy` was causing Haste errors and was stopping the commit from being able to land, and I needed to cut a new version just for it. With Lean Core, I expect more issues like this happening in the future.

[General] [Removed] - Removed Out-of-Tree platform tests (functionality is tested in the RN-CLI repo now)
Pull Request resolved: https://github.com/facebook/react-native/pull/24536

Differential Revision: D15063320

Pulled By: cpojer

fbshipit-source-id: 2a0467bed326b286623fa3cfa4e0bb6959b66b78
2019-04-24 07:56:30 -07:00
Mike Grabowski 706f67a882 Use latest React Native CLI (#24517)
Summary:
Updates React Native to use latest CLI.

Changes:
- No more `--reactNativePath`, define it once in the configuration file. This reverts the previous PR that added this flag
- Add `platforms` and `commands` - React Native now defines platform like any other package. There's no longer concept of "out-of-tree" platform. All are treated equally. If React Native works, any other platform will work too.
- Updates `jest/hasteImpl.js` to use public CLI interface (`loadConfig`) instead of `findPlugins` and removes a weird conditional that checks for CI presence.

[INTERNAL] - Update React Native CLI
Pull Request resolved: https://github.com/facebook/react-native/pull/24517

Differential Revision: D15044762

Pulled By: cpojer

fbshipit-source-id: 379b61e842e619312c542173219a7d326663cf24
2019-04-24 05:09:10 -07:00
Diego Sanchez 1f6de88230 Revert D14962710: [react-native][nbtd][Sandcastle][Facebook: Run RNTester Unit Tests on Sandcastle] Use Xcode 10.2.0 and iOS 12.2 in iOS tests
Differential Revision:
D14962710

Original commit changeset: 769cfb90aacc

fbshipit-source-id: a62ded9ac74f00332006b960862db5c258daff06
2019-04-23 02:33:55 -07:00
Héctor Ramos e106112202 Use Xcode 10.2.0 and iOS 12.2 in iOS tests
Summary:
Bumps to Xcode 10.2.0 and uses the iOS 12.2 simulator when running tests.

The `testBundleURL` test is temporarily disabled to allow the iOS unit tests to run successfully in the internal Facebook CI system.

Changelog:

[iOS] [Changed] - iOS tests: Bump Xcode to 10.2.0, iOS to 12.2.

Reviewed By: TheSavior

Differential Revision: D14962710

fbshipit-source-id: 769cfb90aacce33903ab6e8dbcc5b5727deacf41
2019-04-22 23:25:00 -07:00
Sebastian McKenzie 37bf2ce146 Remove unnecessary top-level `return`
Summary:
Removes the top-level return used in `run-android-ci-instrumentation-tests.js`.

This prevents the file from being parsed as a module. The top-level return here doesn't serve any purpose because it doesn't block the execution of any code after it, as there is no more code to execute.

Reviewed By: cpojer

Differential Revision: D15000395

fbshipit-source-id: 7acf010bb25dec5048813d01517875bcb6eb5a15
2019-04-18 12:00:35 -07:00
Héctor Ramos 5bac2b761e Run the same JavaScript test script in Sandcastle and Circle (#24422)
Summary:
Consolidate JavaScript tests from open source into a single script that can be executed by both Circle CI and Sandcastle, the internal Facebook CI.

[General] [Changed] - Switch internal and external CI to use the same script when running JavaScript tests

Pull Request resolved: https://github.com/facebook/react-native/pull/24422

Reviewed By: cpojer

Differential Revision: D14895773

fbshipit-source-id: d428929cc4e5219e02f5920259e08e0b3d24874c
2019-04-12 09:54:09 -07:00
gengjiawen 6a3e7991a8 add docker test to circle-ci (#24375)
Summary:
add docker related test to ci (only build part), prevent future regression like https://github.com/facebook/react-native/pull/24360

[General] [Added] - add docker related test to ci
Pull Request resolved: https://github.com/facebook/react-native/pull/24375

Differential Revision: D14865224

Pulled By: hramos

fbshipit-source-id: 8fbc2935b0479c362a0fb68022a1157ff68b0325
2019-04-09 18:18:25 -07:00
Salakar 65d6c3f3a0 Upgrade detox to v12.1.1 (#24204)
Summary:
This PR upgrades Detox from version 9.0.4 to 12.1.1.

[General] [Changed] - Upgrade e2e tests to use Detox 12.1.1 (from v9).

Pull Request resolved: https://github.com/facebook/react-native/pull/24204

Reviewed By: TheSavior

Differential Revision: D14710489

Pulled By: hramos

fbshipit-source-id: eeea341f28140d0d259a0d22f7265cf1cd3fec45
2019-04-09 16:08:35 -07:00
Héctor Ramos 742d02a172 Fix Docker Android tests container issue related to the JSC (#24360)
Summary:
[Fixes an issue where the Docker Android tests container cannot be built.](https://github.com/facebook/react-native/pull/24276#issuecomment-480915232) The JSC is now pulled from the npm registry, so we need to run `yarn` prior to pulling the Gradle dependencies.

[Android] [Fixed] - Fixed React Native Android tests Docker container issue related to the JSC
Pull Request resolved: https://github.com/facebook/react-native/pull/24360

Differential Revision: D14842534

Pulled By: hramos

fbshipit-source-id: 3a1a714879e9c52a812b1077dce449470c30bddd
2019-04-08 16:06:00 -07:00
Mike Grabowski 5558333c60 Update React Native to use latest CLI (#23940)
Summary:
Landing D14472633 again which failed because of a metro-buck issue.

Latest CLI requires `reactNativePath` to be explicitly set when `react-native` is not present under `node_modules` (which is the case when running from source).

Fixes #23936

This PR also updates CLI to latest version and removes private calls to `findPlugins` (it's now exposed under public interface).

We also remove custom `rn-cli.config.js` options that are no longer needed that we have `--reactNativePath`. I added them a month ago as a temporary workaround.

[GENERAL] [FIXED] - Internal - Update to the latest CLI
Pull Request resolved: https://github.com/facebook/react-native/pull/23940

Reviewed By: rickhanlonii

Differential Revision: D14501686

Pulled By: cpojer

fbshipit-source-id: c8dac71b3806d81c9d18b6d4a7e92d82962791f9
2019-03-18 06:22:53 -07:00
Adam Ernst 0ceaaf0cf6 Revert D14472633: [react-native][PR] Update React Native to use latest CLI
Differential Revision:
D14472633

Original commit changeset: b7ea92ee130d

fbshipit-source-id: ed5bce3ba4a39c8b60e787cb678747231583f6f5
2019-03-15 14:07:54 -07:00
Mike Grabowski 1fe4799a88 Update React Native to use latest CLI (#23940)
Summary:
Latest CLI requires `reactNativePath` to be explicitly set when `react-native` is not present under `node_modules` (which is the case when running from source).

Fixes #23936

This PR also updates CLI to latest version and removes private calls to `findPlugins` (it's now exposed under public interface).

We also remove custom `rn-cli.config.js` options that are no longer needed that we have `--reactNativePath`. I added them a month ago as a temporary workaround.

[GENERAL] [FIXED] - Internal - Update to the latest CLI
Pull Request resolved: https://github.com/facebook/react-native/pull/23940

Differential Revision: D14472633

Pulled By: cpojer

fbshipit-source-id: b7ea92ee130da6730aa0093265958aa1b8c2ab97
2019-03-15 11:07:48 -07:00
Héctor Ramos 427b94b56b Docker: Use the new community image, and update instructions. (#23723)
Summary:
The `Dockerfile.android` had fallen out of date. We now point to the new community image being used in the Circle CI `test_android` workflow. After spending an hour or two working with these Docker images, I saw some opportunities to clean up the docs as well.

[ANDROID] [Fixed] - Use new React Native Community Android base image for local Docker tests.
Pull Request resolved: https://github.com/facebook/react-native/pull/23723

Differential Revision: D14331737

Pulled By: hramos

fbshipit-source-id: cf42820021c997c3c06cc8b3671f67c9d2650ee5
2019-03-05 15:37:13 -08:00
Héctor Ramos 14a3a019ef Move Dockerfiles into Circle CI directory (#23677)
Summary:
This is an effort to clean up the root of the repository. Everything related to Docker is being moved to the `.circleci` directory, as these images are used as part of the Circle CI 2.0 tests on Android.

[GENERAL] [Changed] - Moved Dockerfiles into .circleci directory
Pull Request resolved: https://github.com/facebook/react-native/pull/23677

Differential Revision: D14253735

Pulled By: cpojer

fbshipit-source-id: 4d482d531a71b8259b09c001b310d82ce5349b87
2019-02-27 19:34:41 -08:00
Héctor Ramos 39ecd5642d Annotate our CircleCI config (#23606)
Summary:
Inspired by [react-native-netinfo's config](https://github.com/react-native-community/react-native-netinfo/blob/master/.circleci/config.yml). Annotate each of the major sections in our Circle CI config to reduce friction when contributing to our open source test infrastructure.

I've also removed all single-use aliases. While the old layout improved readability when looking at a particular job, it also obscured the actual command being run, as well as introduced unnecessary friction (contributors would need to understand how aliases work, syntax is finicky).

I've also moved the oss sanity checks to the analysis job, as we don't want this test to block the checkout_code job from succeeding, which would block all other downstream jobs.

There should be no other material changes to the actual jobs.

[General] [Changed] - Updated open source test configuration
Pull Request resolved: https://github.com/facebook/react-native/pull/23606

Differential Revision: D14199783

Pulled By: hramos

fbshipit-source-id: 61072eec5c05b8731916a9d8f6bc09ae5191fbb5
2019-02-23 17:04:22 -08:00
Eric Lewis 9ca7565563 Enable js e2e tests (#23571)
Summary:
Part of #23561. Small refactor to use 1 marker for the different tests, as it doesn't matter where it is- so long as we can detect it.

[General] [Fixed] - turn on JS e2e tests
Pull Request resolved: https://github.com/facebook/react-native/pull/23571

Differential Revision: D14172069

Pulled By: hramos

fbshipit-source-id: cdde369a09d3528d05fec01d015613b3397714e6
2019-02-21 13:16:42 -08:00
Eric Lewis 4a01be47cd Fix iOS e2e test (#23566)
Summary:
As part of #23561 this is an attempt at fixing iOS.

[iOS] [Fixed] - e2e test
Pull Request resolved: https://github.com/facebook/react-native/pull/23566

Differential Revision: D14162780

Pulled By: cpojer

fbshipit-source-id: b55d32e30f88370100f7fbddf9dfb208280844f4
2019-02-20 22:01:12 -08:00
Héctor Ramos 9820c88877 No longer run disabled tests on Héctor's PRs (#23562)
Summary:
Do not run disabled tests, even when the commit / PR is pushed by hramos. See the existing functionality at https://circleci.com/gh/facebook/react-native/73844?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link:

![screen shot 2019-02-20 at 8 21 39 am](https://user-images.githubusercontent.com/165856/53106776-90ecb600-34e8-11e9-9b02-a7f3990407b2.png)

There are a handful of tests that are known to be broken in Circle CI. This has been the case since at least Fall 2017, when we migrated to Circle 2.0. These tests haven't been fixed for several reasons, one of them being that once they were removed from the Circle CI config, the pressure to fix them has been lowered.

Last year, I added these disabled tests back to Circle CI, but used a script to prevent them from running unless the job was initiated by myself. This would allow us to get good signal from Circle CI without polluting results with known failing tests, while still showing me which tests needed some work before getting re-enabled again.

In practice, this functionality is introducing more friction as I work on fixing new CI failures: my own fixup PRs are marked as failing due to these "disabled tests" (see test_android on https://github.com/facebook/react-native/pull/23558). To ensure we don't lose track of these failures, I've created an umbrella issue at https://github.com/facebook/react-native/issues/23561.
Pull Request resolved: https://github.com/facebook/react-native/pull/23562

Differential Revision: D14161172

Pulled By: cpojer

fbshipit-source-id: 040500dcb433d3127c64a42b31f94af6bbaa6ed1
2019-02-20 18:46:22 -08:00
gengjiawen 539ca06d0f refactor nodejs image in analyze_pr task (#23433)
Summary:
move all node image to official one, and remove redundant path.
Pull Request resolved: https://github.com/facebook/react-native/pull/23433

Differential Revision: D14080808

Pulled By: cpojer

fbshipit-source-id: c8f7ec90a8c59129a0d8c5667f3c648dd7865be3
2019-02-14 02:33:49 -08:00
gengjiawen 410d583951 lock docker image version in ci (#23424)
Summary:
Lock the version will help us to test new dependency version like ndk or buck.
Pull Request resolved: https://github.com/facebook/react-native/pull/23424

Differential Revision: D14065171

Pulled By: cpojer

fbshipit-source-id: 954297ca7c69ff829a4522f34274ae8ab162b36b
2019-02-14 02:21:08 -08:00
gengjiawen e4fac61d57 switch node 8 image to official one (#23425)
Summary:
node 8 image has yarn too. Also the official one has the latest yarn.
Pull Request resolved: https://github.com/facebook/react-native/pull/23425

Differential Revision: D14065105

Pulled By: cpojer

fbshipit-source-id: 4eb3347fc191d928091e984fe3e5887861ec8aa9
2019-02-13 06:32:43 -08:00
gengjiawen e6320c6e75 switch to official node image in ci (#23423)
Summary:
The official node image bundled with yarn by default, and it has maintained by the official group so we can always get the latest version.
Pull Request resolved: https://github.com/facebook/react-native/pull/23423

Differential Revision: D14064773

Pulled By: cpojer

fbshipit-source-id: c24a2bc2d0dda7ae852b25c340ca0d149f4c196c
2019-02-13 05:11:17 -08:00
gengjiawen 392e89676f add prettier check in ci (#23382)
Summary:
enforce code format
Pull Request resolved: https://github.com/facebook/react-native/pull/23382

Differential Revision: D14024609

Pulled By: cpojer

fbshipit-source-id: 21176cf8f009987e5a281bbead414374632eabee
2019-02-11 09:06:43 -08:00
Héctor Ramos d002d30325 Danger, be nice to PRs. (#23334)
Summary:
Changed Danger's config so that it provides advice whenever it finds an issue with the pull request template, instead of posting a warning.

Updated Danger several major versions, from 2 to 7. I worked through any breaking changes, which were minimal (change `yarn danger` to `yarn danger ci`).

Added a flag to have Danger post these messages as GitHub Checks instead of as a comment. This slightly buries Danger's output, as it's no longer posted as a comment, but I believe it integrates more nicely into the GitHub interface.

[GENERAL] [Changed] - GitHub-only change: updated Danger config to be nicer to PRs
Pull Request resolved: https://github.com/facebook/react-native/pull/23334

Differential Revision: D14002313

Pulled By: cpojer

fbshipit-source-id: b97ca7b7bd164646b249b7c64b1134306e0f38a8
2019-02-08 03:36:58 -08:00
gengjiawen 9351dd6c69 migrate ci to official docker (#21477)
Summary:
Simplify current build and offer it to community as official docker.
I have also created an [rfc](https://github.com/react-native-community/discussions-and-proposals/pull/36).
pass all current ci.
none
 [GENERAL] [INTERNAL] [CI] - migrate ci to official docker
Pull Request resolved: https://github.com/facebook/react-native/pull/21477

Differential Revision: D13801696

Pulled By: cpojer

fbshipit-source-id: fa235cf21ab5af2c87eb3c1a14788fab01c71ccf
2019-01-24 06:31:00 -08:00
Dulmandakh 8a8a11b77a fix validate-android-test-env.sh (#22961)
Summary:
fix validate-android-test-env.sh to not parse .gradle files for build tools versions, because it was removed.

Changelog:
----------
[CI] [Changed] - fix validate-android-test-env.sh to not try parse .gradle files
Pull Request resolved: https://github.com/facebook/react-native/pull/22961

Differential Revision: D13655750

Pulled By: hramos

fbshipit-source-id: 1accb6ac7a7c74ab335dd92977b0b090820a622c
2019-01-14 10:54:18 -08:00
Dulmandakh 62264b7ce2 bump buck to 2019.01.10.01 (#22960)
Summary:
bump Buck to 2019.01.10.01

Changelog:
----------
[General] [Changed] - bump Buck to 2019.01.10.01
Pull Request resolved: https://github.com/facebook/react-native/pull/22960

Differential Revision: D13640470

Pulled By: hramos

fbshipit-source-id: 125e127eb5e71daaebcadbde6c067651c9c17986
2019-01-11 15:19:01 -08:00
Héctor Ramos 86d0611c5a test_ios → : Update iOS Snapshots, remove tvOS tests, disable failing tests (#22720)
Summary:
The following tests are disabled in this PR:

- testTimersTest is failing due to undefined this.setTimeout, probably introduced back in 61346d3. Tracking a fix in https://github.com/facebook/react-native/issues/22695
- testTheTester_ExpectError is failing as RCTTestRunner is not properly passing through the error. Tracking a fix in https://github.com/facebook/react-native/issues/22697

I've added a comment regarding testWebSocketTest and how to ensure it passes locally.

This PR also fixes all remaining snapshot tests, which were failing due to the use of iPhone XS as a iOS Simulator on Circle CI. We are using iPhone 6s for SST internally, and this allows us to be consistent.
Pull Request resolved: https://github.com/facebook/react-native/pull/22720

Differential Revision: D13532788

Pulled By: hramos

fbshipit-source-id: 75681236032839bf88180611ee68826b53cc96eb
2018-12-20 15:08:47 -08:00
Héctor Ramos 5194495e97 Propagate exit code in test_objc (#22562)
Summary:
Any failures in `test_objc` within the objc-test.sh script have been kept hidden as `xcpretty` was swallowing the exit code from xcodebuild.

Fixes the issue TheSavior brought up in #22470 where failing snapshot tests were not reflected on Circle.

Run on Circle CI and confirm `test_objc` fails (iOS tests *are* broken on master).
Pull Request resolved: https://github.com/facebook/react-native/pull/22562

Differential Revision: D13406987

Pulled By: hramos

fbshipit-source-id: 3f3da01ab4c0ad87077813b06d2fdf788f32f6b8
2018-12-10 20:34:12 -08:00
Christoph Nakazawa 63a6bb7637 Remove remaining references to local-cli
Summary: This removes the remaining references to `local-cli`. We already have a `cli.js` file on the root that was just forwarding to the local-cli folder, so I removed that. It also seems that `setupBabel.js` is no longer necessary in RN.

Reviewed By: TheSavior

Differential Revision: D13396218

fbshipit-source-id: a945cb91dae39c4b58c5cabcca6b0f0328fc4717
2018-12-10 19:08:10 -08:00
Héctor Ramos 44878ea9bc Fix code analysis bot failure to post lint warnings on pull requests
Summary:
The code analysis script takes the results of `eslint .` and filters out any messages for filepaths outside of what is modified in a given pull request. This diff fixes an issue where the bot will fail to post warnings if a pull request contains multiple commits, where the most recent commit is a rebase (e.g. 63c00f20a7 in https://github.com/facebook/react-native/pull/22470). This happens because the script looks for files changed in the most recent commit in a PR.

In this diff, we switch to a new GitHub API that returns the list of all files changed by a PR, obviating the need to go through individual commits in a PR to look for changed files.

Reviewed By: TheSavior

Differential Revision: D13324154

fbshipit-source-id: f9f50028439d1969b0feea65f0b3e8bf75ac1a33
2018-12-05 13:15:56 -08:00
Dulmandakh 9d00d4d5bb Bump Android SDK to 28, Build Tools to 28.0.2, Gradle to 4.7, Gradle Plugin to 3.2.0 (#21632)
Summary:
This PR is bumping compileSdkVersion to 28, buildToolsVersion to 28.0.2, Gradle to 4.7, Android Gradle plugin to 3.2.0.

Gradle 4.7 added support for Java 10 and 11.

allow-large-files

Release Notes:
--------------
[ANDROID] [ENHANCEMENT] [SDK] - bump to 28

Pull Request resolved: https://github.com/facebook/react-native/pull/21632

Reviewed By: mdvacca

Differential Revision: D13084836

Pulled By: hramos

fbshipit-source-id: e0f493881e80e87faf8c3ef1ac77044495966a49
2018-12-05 09:06:31 -08:00
Héctor Ramos 04af674c38 Bump RN OSS iOS tests to iOS SDK 12.1, Xcode 10.1
Summary:
Use Xcode 10.1 and iOS 12.1 SDK to run iOS tests on an iOS 12.1 iPhone XS Simulator, all of which are available on a default Xcode 10.1 install.

Note that we were previously running iOS tests using Xcode 10.1 and the 12.1 SDK in a separate `test_xcode10` workflow on Circle CI. This was in place to allow us to track Xcode 10 compatibility during the Xcode 10 beta. Now that Xcode 10 has been public for a while, we can drop the compatibility check and use Xcode 10 in our main iOS test workflow.

Reviewed By: TheSavior

Differential Revision: D13317891

fbshipit-source-id: 04c17bf3a2e9d3617f14a46b4ed30a5491a4f4a4
2018-12-04 12:06:59 -08:00
Héctor Ramos 9e0b79114c Pass Circle CI branch information to Coveralls (#22489)
Summary:
Trivial. Coveralls expects CI_BRANCH to be set. Circle uses CIRCLE_BRANCH instead. Without this, Coverals will attribute coverage reports to a "patch-1" branch.
Pull Request resolved: https://github.com/facebook/react-native/pull/22489

Differential Revision: D13306787

Pulled By: hramos

fbshipit-source-id: 70ad525168f249f4ca7f0370ba941632c33da8c5
2018-12-03 11:47:34 -08:00
Héctor Ramos 69e9c9d371 Add Coveralls to package.json [1/2] (#21017)
Summary:
Adds a new step to the test suite. Test coverage is now collected and sent to Coveralls.

Initial configuration is limited to the Libraries/ and local-cli/ directories. Please let me know if additional directories should be considered.

I have enabled this repo on the coveralls service. The coveralls token has been added to React Native's Circle CI environment variables.

- Track coverage on PRs, and fail PRs that lower the coverage %
- Increase coverage :)

[INTERNAL] [ENHANCEMENT] [.circleci/config.yml] - Start tracking code coverage (JS)

Pull Request resolved: https://github.com/facebook/react-native/pull/21017

Differential Revision: D9724396

Pulled By: hramos

fbshipit-source-id: 61da4478877805f9a9a3c9670b54ddc4e40e958b
2018-11-30 19:49:00 -08:00
Dulmandakh b40e23dee5 bump buck to 2018.10.29.01. fixes Android CI (#22049)
Summary:
Bump buck to latest or 2018.10.29.01, which will fix Android CI.
Pull Request resolved: https://github.com/facebook/react-native/pull/22049

Differential Revision: D12879205

Pulled By: TheSavior

fbshipit-source-id: 5d196fba38cb27266cadbebae00367aa773751ca
2018-10-31 21:42:36 -07:00
Héctor Ramos bb93abf5ca Fix checkout_code: Remove Metro cache check (#21998)
Summary:
This was a specific check that was prone to break at some point. That time has come. Removing it as it is not providing any useful signal.
Pull Request resolved: https://github.com/facebook/react-native/pull/21998

Differential Revision: D12823839

Pulled By: hramos

fbshipit-source-id: e870670d7803af78c4559052613ea364ce1478df
2018-10-29 08:46:09 -07:00
Héctor Ramos 5c5af3e1c9 Enforce lockfile is kept up to date (#21739)
Summary:
Adds a new script that runs Yarn with --frozen-lockfile, and fails if Yarn finds the lockfile is out of sync.

Keeping the lockfile in sync with package.json will ensure our internal open source tests can run offline, as our offline mirror is updated whenever the lockfile changes.

Reverted yarn.lock to https://raw.githubusercontent.com/facebook/react-native/6eeff75849c9b8bf91592c1b7906b4dab8fba518/yarn.lock, then ran `scripts/circleci/validate_yarn_lockfile.sh`, and verified the script failed as expected.

I then ran Yarn without the --frozen-lockfile flag, and reran the validation script. This time, the script finished successfully.
Pull Request resolved: https://github.com/facebook/react-native/pull/21739

Differential Revision: D10365642

Pulled By: hramos

fbshipit-source-id: 9ab7f03919427a86b12901d4c422ef04dd0839f6
2018-10-12 14:17:09 -07:00
Dulmandakh 436cf154bb bump Android NDK to r17c (#21628)
Summary:
bump Android NDK to r17c, which is only available revision to download for r17. And it includes bug fixes.
Pull Request resolved: https://github.com/facebook/react-native/pull/21628

Differential Revision: D10352162

Pulled By: hramos

fbshipit-source-id: d372e55443260242a44a1f73698977a3e361f001
2018-10-11 22:08:37 -07:00
Héctor Ramos 6967a4fa56 Flag code analysis issues once per converter used (#21503)
Summary:
Fixes issue where the bot would leave multiple lines in the top review comment if, say, eslint found 30 issues, there would be 30 mentions of eslint having found issues.

See https://github.com/facebook/react-native/pull/21492 for an example of such a case, where `analysis-bot` left a spammy review at https://github.com/facebook/react-native/pull/21492#pullrequestreview-161837975.
Pull Request resolved: https://github.com/facebook/react-native/pull/21503

Differential Revision: D10219439

Pulled By: hramos

fbshipit-source-id: 75d32ef3bfeaa91ab614763a19494659ad1be0dd
2018-10-05 11:33:38 -07:00
Héctor Ramos 925f63dfbe Run publish_npm_package job on tagged commits without any pre-reqs (#21495)
Summary:
This PR gets master back on sync with fixes made to 0.57-stable.
Pull Request resolved: https://github.com/facebook/react-native/pull/21495

Differential Revision: D10209745

Pulled By: hramos

fbshipit-source-id: bc4d859adade820eac30e947514b6c6c2a27083f
2018-10-04 20:20:10 -07:00
Héctor Ramos 53b487d215 Use ShellCheck (#19681)
Summary:
As recommended in https://circleci.com/docs/2.0/using-shell-scripts/#use-shellcheck

It will only run on PRs for now.
Pull Request resolved: https://github.com/facebook/react-native/pull/19681

Differential Revision: D10111711

Pulled By: hramos

fbshipit-source-id: e980a526561dced79e5197a11cfb41a3eba9be8b
2018-09-28 17:03:24 -07:00
empyrical 99cacf4830 package.json: Add flow check commands for iOS and Android (#21326)
Summary:
This PR adds these two scripts to `package.json`:

 * `flow-check-ios` - for running `flow check` on `.ios.js` files
 * `flow-check-android` - for running `flow check` on `.android.js` files

The Android command makes use of the new `--flowconfig-name` option added to Flow in `0.80.0`
Pull Request resolved: https://github.com/facebook/react-native/pull/21326

Differential Revision: D10055702

Pulled By: hramos

fbshipit-source-id: e647f8d2995da0a9bd6af242218819fd5745df63
2018-09-26 17:03:07 -07:00
Héctor Ramos 544adcaf4f Test Xcode 10 (#21324)
Summary:
This also fixes an issue with tagged commit Circle CI jobs, and avoids running the `publish_npm_package` on every commit. The new config ignores commits on *all branches*, but should still catch git tags.
Pull Request resolved: https://github.com/facebook/react-native/pull/21324

Differential Revision: D10041629

Pulled By: hramos

fbshipit-source-id: 9b3295b5fcd614c67a8838ffd49c6a5d6ae7fd86
2018-09-25 20:39:55 -07:00
Héctor Ramos b0946006e7 Deploy to npm on tagged commits only (#21250)
Summary:
This PR applies some fixes I made to the 0.57-stable branch to ensure we only run on commits tagged as "v0.57.1", as an example. This also ensures we only deploy after all tests pass.
Pull Request resolved: https://github.com/facebook/react-native/pull/21250

Differential Revision: D10003666

Pulled By: hramos

fbshipit-source-id: 22d5e674ca925dce53d0ddf0e12c64dc82ec7aa1
2018-09-22 09:16:58 -07:00
Héctor Ramos 5068dfcad3 Use Android SDK 27 in React Native
Summary:
Upgrade React Native to Android SDK 27 again, following the reversal in D9886607 (68c7999c25).

The SDK 27 is actually available internally in an alternate location that is suitable for use cases like React Native's. For future reference, SDK 28 is also available for use in this location.

Reviewed By: axe-fb

Differential Revision: D9929066

fbshipit-source-id: 9413f891d5587293a30544351340e9407a2dce55
2018-09-20 07:56:23 -07:00
Héctor Ramos 68c7999c25 Downgrade to compileSdkVersion 26
Summary:
Go back to using compileSdkVersion 26 and targetSdkVersion 26, temporarily. We can re-add this once Android SDK 27 becomes available in Facebook's internal repository.

The Android SDK Build Tools 27.0.3 **are** available, so we can continue using those.

Reviewed By: axe-fb

Differential Revision: D9886607

fbshipit-source-id: 6c1c9c1e1309c3a0483cc4c0bd8dcb4a5f29fc7e
2018-09-18 08:02:50 -07:00
Héctor Ramos 023d650a0d Remove tokens from Circle CI config (#21058)
Summary:
While these were intentionally used in the open, and never were abused, it has become a distraction whenever they are flagged.

We'll have to move this functionality to a service outside of Circle CI, as we cannot securely pass secrets to forks and PRs in Circle CI. By necessity, these PR analysis scripts must run alongside PRs.

The The controller you requested could not be found. token has already been revoked. The The controller you requested could not be found. token is not under our control, and is still valid as of this writing. The eslint token has public_repo scope, with no access to any private repos. It's no different than having a random account commenting on any public repo.

Unfortunately, revoking the The controller you requested could not be found. token affects React's use of this bot account as well.

 ---

Q: What does the React team need this token for?
A: It's used to analyze how a PR will impact the build size for React.

Q: What does the React Native team need this token for?
A: We do lightweight automated PR code reviews with it (eslint, flagging large PRs, etc)

Q: What can someone do with the access token?
A: The token was for the The controller you requested could not be found. GitHub account. The account has no privileged access to any organization, so in effect it's like having the token to a random GitHub account. The token has public_repo access scope, which allows it to interact with any public repository on GitHub. The attacker can leave comments on any issue, pull request, or commit, on any public open source repository on GitHub. They could spam or leave arbitrary messages. It's no different than using any random newly created GitHub account to do this, but the bot is named "React Linter", so people could have used it to make React look bad.

Q: Why didn't we just remove the token from the open source repositories? CircleCI allows you to use environment variables to keep secrets out of the repo.
A: We have configured CircleCI to hide environment variables from Circle CI jobs triggered by non-Facebook org forks and pull requests (otherwise, anyone could add a file to their fork that echoes $SUPER_SECRET and then read it from the Circle CI logs). This allows us to do things like publish to npm only on commits that actually land on the main repo, without letting random people do the same on their forks.

Q: Why can't we run these scripts on Circle CI jobs that do have access to secret environment variables?
A: It's by necessity. These scripts are meant to run on pull requests and forks. They're used to lint pull requests, after all.

Q: Why can't we run these scripts on internal Facebook infrastructure?
A: Automatic importing of arbitrary code from external sources into internal Facebook systems without a FB engineer's involvement  is disallowed. We're happy to let Circle CI run unvetted code in this manner.

Q: What do other projects do in similar situations?
A: A common solution for open source projects that need to run scripts with access to GitHub without exposing the access token on CI is to use a private cloud server (i.e. a droplet in Digital Ocean, an instance on AWS...).

Q: Why don't we use the same infra used by react-native-bot to run react-linter?
A: React-Native-Bot runs once an hour or so, querying for recent issues and PRs. It does not use webhooks, and instead performs the same kind of search queries you'd use on GitHub, therefore it's not great for picking up when a PR has been updated. Circle CI is great for running scripts whenever a PR is created or updated, as Circle outages aside, we can be fairly certain a script will run any time a PR is updated. If you want to track build sizes, you really want to make sure any new commit added to a PR will trigger a re-run.
Pull Request resolved: https://github.com/facebook/react-native/pull/21058

Differential Revision: D9809842

Pulled By: hramos

fbshipit-source-id: 6ca5d2f5b48e077ec822a3aea5237534bd828850
2018-09-13 07:48:14 -07:00