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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Summary:
The eslint bot has not been working since the migration to Circle 2.0.
Pull Request resolved: https://github.com/facebook/react-native/pull/20822
Differential Revision: D9492680
Pulled By: hramos
fbshipit-source-id: 7f2f9ac125b6cab1750902c485a6d27d6c3cf302
Summary:
There are some steps known to be failing on master. This pollutes checks for unrelated PRs.
This PR will make it so that PRs submitted by anyone other than myself will no-op on these steps.
Future work: Have an array of whitelisted contributors, and make it much easier to turn individual tests on and off.
Pull Request resolved: https://github.com/facebook/react-native/pull/20818
Differential Revision: D9484946
Pulled By: hramos
fbshipit-source-id: d6c187b341f13552b33d0f1d569b65f6c66ae48f
Summary:
This pull request addresses the failing publish-npm.js script from earlier this week. For background, last month we reset all npm access tokens for any package related to Facebook, and we now require all accounts with publish permissions to have two factor enabled.
The publish-npm.js script relied on one such token that is configured in Circle CI as a envvar. The token has been updated in Circle CI, but we now need a way of passing the one time password to npm.
With this PR, we can now grab the otp from Circle CI's envvars. Considering otps are ephemeral, this requires the NPM_CONFIG_OTP envvar to be set by someone with publishing permissions anytime a new release will be pushed to npm. The token is short lived, but it would still be good to clear the envvar after the package is published. Circle CI envvars are not passed on to PR/forked builds.
This PR is effectively a breaking change for the release process, as the publish step will not succeed if the OTP is not valid.
OTPs are short-lived, and the publish_npm_package job will definitely outlive the token. Unfortunately this will require some timing to get right, but the alternative is to ssh into the Circle CI machine and re-run the `npm publish --otp` command, which again would still require someone with publish access to provide the otp.
Pull Request resolved: https://github.com/facebook/react-native/pull/20701
Differential Revision: D9478488
Pulled By: hramos
fbshipit-source-id: 6af631a9cb425271b98c03d158aec390ebc95304
Summary:
I found that android support library 27.x (874cca1ac2) requires compileSdkVersion to be 27. Also found that many FB projects use SDK 27.
Pull Request resolved: https://github.com/facebook/react-native/pull/20777
Differential Revision: D9478431
Pulled By: hramos
fbshipit-source-id: ca100f6b5b39e7d112926124423f9510a0efc291
Summary:
We have several disabled tests in Circle, and they are not running at all.
This prevents us from seeing when a disabled test might actually be fixed, as enabling the test requires uncommenting the correct line in Circle CI's config.
In this PR, we use the existing swallow_error script to run known-failing steps, without failing the job. This will let us see the step's output in CI, without polluting PRs that have not introduced new failures to CI.
Pull Request resolved: https://github.com/facebook/react-native/pull/20775
Differential Revision: D9442412
Pulled By: hramos
fbshipit-source-id: 83c930811a559fdcf6d7b926b4073343e862d2b3
Summary:
`test_detox_end_to_end` and `test_objc_end_to_end` are both failing on master. This is polluting internal diffs that do not introduce failures.
As we just now started tracking Circle CI on our internal builds, I want to make sure we only nag internal diffs when the failure can actually be attributed to the diff. The failures in the e2e tests precede the Circle CI integration and are adding unnecessary noise.
Going forward, we will immediately go back to a diff and push the author to fix the broken CI, so this PR is a temporary fix.
Pull Request resolved: https://github.com/facebook/react-native/pull/20622
Differential Revision: D9272360
Pulled By: hramos
fbshipit-source-id: 2f8d22e35d301aa7eb67ed08f6deed21bf971acd
Summary:
Run Detox before the flaky e2e iOS tests in order to get better signal.
Pull Request resolved: https://github.com/facebook/react-native/pull/20550
Differential Revision: D9183655
Pulled By: hramos
fbshipit-source-id: e499daad86249961cd6d0b8fc22c846392622056
Summary:
This has been tested in `0.56-stable` and was used to deploy the `0.56.0-rc.2` release.
Pull Request resolved: https://github.com/facebook/react-native/pull/19742
Differential Revision: D9071349
Pulled By: hramos
fbshipit-source-id: 6bccbe4a56cb080bd7d75c1f622168e462fb4c86
Summary:
The publish script will fail on forked PRs anyway as the $CIRCLE_NPM_TOKEN envvar will be missing or incorrect.
We also move buck fetches to their own own shell script. These are shared by the Android and Deploy jobs, and using -ex will allow us to see which specific command failed without the need to list all steps in the config file.
Finally, cache keys are updated as architecture is only relevant in caches that may be reused across macOS and linux, which is not the case for Android.
Pull Request resolved: https://github.com/facebook/react-native/pull/19856
Differential Revision: D8956879
Pulled By: hramos
fbshipit-source-id: cfc360b9c603497fee53433471537bdc15a0a1c8
Summary:
Enable CocoaPods test, iOS e2e.
Use parallelism to run several tests simultaneously within the same machine.
Circle CI
Closes https://github.com/facebook/react-native/pull/19764
Differential Revision: D8471955
Pulled By: hramos
fbshipit-source-id: c484fd6c66fb2d0d2305ced29e34cb305f73fb55