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

27 Коммитов

Автор SHA1 Сообщение Дата
Héctor Ramos 9c3f4c021e Bots cleanup, avoid leaving inline reviews when N>5 (#24923)
Summary:
This PR cleans up some of our GitHub bots. The overall goal is to make the contribution process just a tad nicer.

### analysis-bot

* The bot will continue leaving GitHub Reviews when it finds lint issues, but will abstain from leaving inline comments if they would exceed 5 in number.
* The review comment left by the bot has instructions on how to reproduce the lint issues locally. This will educate PR authors on how to run lint and fix the issues without unnecessarily spamming the PR with 50+ comments, while still providing useful reviews to authors when only a handful of lint issues slip by.
* Code moved to `bots/` directory for ease of discovery and co-location with pull-bot.
* Added `yarn lint-ci` command. This seems like the right choice: it's running `yarn lint` and other linters, and it is only intended to run on CI.
* It's still possible to run `yarn lint-ci` locally, though the script will stop short of posting a review to GitHub unless the necessary envvars are provided.
* Added `yarn shellcheck` command. This can be run locally, though it requires `shellcheck` to be installed.
* Outside of this PR, I added instructions on using shellcheck to https://github.com/facebook/react-native/wiki/Development-Dependencies
* Updated Circle CI config to use these new commands, and streamlined the `analyze_pr` step.
* Documented analysis-bot in `bots/README.md`.

### pull-bot

* Bumped `danger-js` dependency. No breaking changes found in this minor bump from what I can tell.
* Documented pull-bot in `bots/README.md`.

### misc

* PR template: don't use jargon.

## Changelog

[Internal] [Changed] - GitHub Bots cleanup
Pull Request resolved: https://github.com/facebook/react-native/pull/24923

Differential Revision: D15399744

Pulled By: hramos

fbshipit-source-id: 32632e775f8554424072270e3f98542de84bfb8c
2019-05-21 19:38:54 -07:00
Kudo Chien 8e375850de Use node package dependency to manage JSC version (#24276)
Summary:
In origin approach, we packed libjsc.so inside react-native.aar and it is difficult for user to choose different JSC variants. E.g., [the Intl supported version](https://github.com/react-native-community/jsc-android-buildscripts#international-variant).

This change list allows application to determine JSC versions or variants by npm/yarn package.

There is a |useIntlJsc| flag in build.gradle, it will use the same JSC version but with Intl support.

`yarn add jsc-android@canary`

[Android] [Changed] - Allow application to select different JSC variants

**MIGRATION**
Note that there are some changes in build.gradle.
Existing application needs to change their android/build.gradle and android/app/build.gradle.
Hopefully, the rn-diff-purge should handle the case well.
Pull Request resolved: https://github.com/facebook/react-native/pull/24276

Differential Revision: D14752359

Pulled By: cpojer

fbshipit-source-id: a4bfb135ad8e328f404a2d1a062412f40ebf4622
2019-04-04 14:22:14 -07:00
Peter van der Zee dcd4e90d9a Bump Prettier to 1.16.4
Summary:
@public
This bumps Prettier to v1.16.4
Only format source files were updated.

Reviewed By: mjesun

Differential Revision: D14454893

fbshipit-source-id: 72f9872fe764a79dbf0d9fab9bebb1456b039f2f
2019-03-14 07:00:27 -07: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
Héctor Ramos 937c79e2f2 Suggest running yarn lint --fix (#23413)
Summary:
This PR expands the code analysis script to allow for customizing the GitHub Review left by analysis-bot whenever it finds code-level issues.

Some, but not all, `eslint` errors are fixable by running `yarn lint --fix`. When the `eslint` converter finds warnings or errors, the bot will suggest running the command as part of the review.

The script could be adjusted to only suggest this when `eslint` returns a non-zero `fixableErrorCount` or `fixableWarningCount`, but I think this is a good first step to get people to unblock themselves when they see this type of review from the bot.

I've also excluded `bots/` and `scripts/` from eslint as these have several `eslint` errors that need to be addressed. These directories do not contain core RN code, so they can be excluded for now.

[GENERAL] [Changed] - analysis-bot will suggest fixing eslint warnings on code reviews
Pull Request resolved: https://github.com/facebook/react-native/pull/23413

Differential Revision: D14065757

Pulled By: cpojer

fbshipit-source-id: cc588643f7ddb3c4631d89c26b799f7a7244e616
2019-02-13 08:46:03 -08:00
Kudo Chien 3fae388424 Fix CircleCI build error (#22822)
Summary:
----------

side effect of gradle task name changed from f3e5cce474

Changelog:
----------

[Android] [Fixed] - Fix CircleCI build error
Pull Request resolved: https://github.com/facebook/react-native/pull/22822

Differential Revision: D13562455

Pulled By: RSNara

fbshipit-source-id: a39a19350dcd91b2f06e064c3aec62b94d009fab
2018-12-30 10:47: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
Tim Yung a689711f68 RN: Missing Copyright Headers
Summary: Adds copyright headers to all files that are missing them.

Reviewed By: hramos

Differential Revision: D12837494

fbshipit-source-id: 6330a18919676dec9ff2c03b7c9329ed9127d930
2018-10-31 01:37:26 -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
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 b030fcbbf5 Update path to code analysis script (#21443)
Summary:
The script was moved after the original ShellCheck PR was opened, and this was lost during the rebase.
Pull Request resolved: https://github.com/facebook/react-native/pull/21443

Differential Revision: D10133498

Pulled By: hramos

fbshipit-source-id: da61b782362ab2d13cb6f0bca3fb1c9a0af08ae5
2018-10-01 15:22:35 -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
Héctor Ramos 1151c096da Update copyright headers to yearless format
Summary: This change drops the year from the copyright headers and the LICENSE file.

Reviewed By: yungsters

Differential Revision: D9727774

fbshipit-source-id: df4fc1e4390733fe774b1a160dd41b4a3d83302a
2018-09-11 15:33:07 -07:00
Héctor Ramos fe4f03517c Add missing copyright headers (#21000)
Summary:
One of our automated project tools noted that these were all missing their copyright headers.
Pull Request resolved: https://github.com/facebook/react-native/pull/21000

Differential Revision: D9721495

Pulled By: hramos

fbshipit-source-id: 6ccf0f37165a0fe16cf06bd996d615f2286101dc
2018-09-07 13:17:38 -07:00
Héctor Ramos e84bf99d40 Use PR reviews (#20927)
Summary:
Use GitHub PR Reviews instead of individual comments. The result is similar to the existing implementation, but there will be a top level comment indicating possible next steps for the PR author.

Verified on Circle.
Pull Request resolved: https://github.com/facebook/react-native/pull/20927

Differential Revision: D9596595

Pulled By: hramos

fbshipit-source-id: 3628b0097aa9a21a40089f2cbe1859bd64ccd8b7
2018-08-30 16:38:07 -07:00
Héctor Ramos 1fe7b40a33 Fix eslint code analysis bot (#20822)
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
2018-08-23 20:34:51 -07:00
Héctor Ramos d0f0e8e248 Gate failing steps behind a username check (#20818)
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
2018-08-23 15:18:04 -07:00
Héctor Ramos 6af3b161c0 Run failing tests in CI, without turning CI red (#20775)
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
2018-08-22 12:31:19 -07:00
Héctor Ramos dfcf9c50b6 Fix test_android test failure, add libpulse0 dep
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/20377

Differential Revision: D8983760

Pulled By: hramos

fbshipit-source-id: d36cdb577b0eadc78e3274db755d05d440ae423f
2018-07-24 16:33:49 -07:00
Héctor Ramos 6da5779eb7 Remove pull request check on npm deploys (#19856)
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
2018-07-23 13:33:28 -07:00
Héctor Ramos 1ad8351d9b Clear apt cache
Summary:
This will unblock test_android on CI.
Closes https://github.com/facebook/react-native/pull/19275

Differential Revision: D8020049

Pulled By: hramos

fbshipit-source-id: 9d738a636f63138aae918759e879f9e397c11aca
2018-05-15 17:27:52 -07:00
Héctor Ramos 15b25d854a Cache C++ downloads
Summary: Closes https://github.com/facebook/react-native/pull/18595

Differential Revision: D7419532

Pulled By: hramos

fbshipit-source-id: 0b64763f91efea8300c4cde4703e8496dbda8c49
2018-03-27 14:33:24 -07:00
Héctor Ramos de1040fcff Cache apt dependencies in test_android
Summary: Closes https://github.com/facebook/react-native/pull/18576

Differential Revision: D7415216

Pulled By: hramos

fbshipit-source-id: 9b7199fe5fb91a26ba0881e426a85395b2923f26
2018-03-27 09:28:32 -07:00
Héctor Ramos 6f6084db69 Explicitly set path to yarn
Summary:
Due to issues with Circle's Docker images ([link](https://twitter.com/circleci/status/974694807091073024)), jobs are failing with an error "yarn not found".

Test Plan
Run on Circle

Release Notes
[GENERAL][MINOR][.circleci] - Fix Circle issue
Closes https://github.com/facebook/react-native/pull/18419

Differential Revision: D7312052

Pulled By: hramos

fbshipit-source-id: 2768b9c69046a2f80518430024d3e7afbbd7de65
2018-03-16 17:22:05 -07:00
Héctor Ramos c9d756285a Clear cache to resolve iOS, tvOS workflow
Summary:
tvOS and iOS workflows were flaky, apparently due to a stale cache that contained a problematic version of the Metro dependency. Thanks to motiz88 for identifying the potential cause of flakiness in https://github.com/react-native-community/react-native-releases/issues/2#issuecomment-371905315.

https://circleci.com/workflow-run/440180a2-e888-4f27-bec9-b8e5d9be6708

[GENERAL] [MINOR] [CI] - Resolve iOS, tvOS failures in Circle
Closes https://github.com/facebook/react-native/pull/18304

Differential Revision: D7220150

Pulled By: hramos

fbshipit-source-id: 0f5e68c779dfce44e6deb8b813a3ac9e25a2ab97
2018-03-09 15:11:46 -08:00
Héctor Ramos b181b7797f Check PATENTS does not creep into files
Summary:
Some files have crept into the repo with the old license header. These are usually from PRs that were opened prior to the re-licensing of the project.

Let the script run, prior to fixing the errant files. The script outputs the following:

```
PATENTS crept into some new files?
 --- /dev/fd/63	2018-03-01 01:42:48.250153746 +0000
+++ /dev/fd/62	2018-03-01 01:42:48.250153746 +0000
@@ -1 +1,9 @@
+Libraries/NativeAnimation/Nodes/RCTTrackingAnimatedNode.h
+Libraries/NativeAnimation/Nodes/RCTTrackingAnimatedNode.m
+ReactAndroid/src/main/java/com/facebook/react/animated/TrackingAnimatedNode.java
+ReactAndroid/src/main/java/com/facebook/react/views/text/CustomLetterSpacingSpan.java
+ReactCommon/yoga/yoga/YGLayout.cpp
+ReactCommon/yoga/yoga/YGLayout.h
+ReactCommon/yoga/yoga/YGStyle.cpp
+ReactCommon/yoga/yoga/YGStyle.h
 scripts/circleci/check_license.sh
Exited with code 1
```

Fix the headers in these files and run the script again. No output, exit code 0.
Closes https://github.com/facebook/react-native/pull/18143

Reviewed By: sophiebits

Differential Revision: D7119356

Pulled By: hramos

fbshipit-source-id: d238e4d4a3ae320a2c8e625c2fa29690057a4814
2018-03-01 08:22:05 -08:00