diff --git a/.circleci/README.md b/.circleci/README.md new file mode 100644 index 00000000000000..9c944ef6d105c0 --- /dev/null +++ b/.circleci/README.md @@ -0,0 +1,5 @@ +# Circle CI + +This directory is home to the Circle CI configuration file. Circle is our continuous integration service provider. You can see the overall status of React Native's builds at https://circleci.com/gh/facebook/react-native + +You may also see an individual PR's build status by scrolling down to the Checks section in the PR. diff --git a/.circleci/config.yml b/.circleci/config.yml index acb58f8bd15475..4a8137103ae4a4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,14 +12,14 @@ aliases: - &restore-cache-analysis keys: - - v1-analysis-dependencies-{{ arch }}-{{ checksum "package.json" }}{{ checksum "danger/package.json" }} + - v1-analysis-dependencies-{{ arch }}-{{ checksum "package.json" }}{{ checksum "bots/package.json" }} # Fallback in case checksum fails - v1-analysis-dependencies-{{ arch }}- - &save-cache-analysis paths: - - danger/node_modules + - bots/node_modules - node_modules - key: v1-analysis-dependencies-{{ arch }}-{{ checksum "package.json" }}{{ checksum "danger/package.json" }} + key: v1-analysis-dependencies-{{ arch }}-{{ checksum "package.json" }}{{ checksum "bots/package.json" }} - &restore-cache-android-packages keys: @@ -455,7 +455,7 @@ jobs: command: | if [ -n "$CIRCLE_PR_NUMBER" ]; then yarn add github@0.2.4 - cd danger + cd bots yarn install --non-interactive --cache-folder ~/.cache/yarn else echo "Skipping dependency installation." @@ -465,7 +465,7 @@ jobs: name: Analyze Pull Request command: | if [ -n "$CIRCLE_PR_NUMBER" ]; then - cd danger && DANGER_GITHUB_API_TOKEN="e622517d9f1136ea8900""07c6373666312cdfaa69" yarn danger + cd bots && DANGER_GITHUB_API_TOKEN="e622517d9f1136ea8900""07c6373666312cdfaa69" yarn danger else echo "Skipping pull request analysis." fi diff --git a/.gitignore b/.gitignore index 15a2a9668a1a9f..032f9335f905e2 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,9 @@ buck-out /ReactAndroid/src/main/jni/prebuilt/lib/x86/ /ReactAndroid/src/main/gen +# Watchman +.watchmanconfig + # Android .idea .gradle @@ -47,7 +50,8 @@ local.properties node_modules *.log .nvm -/danger/node_modules/ +/bots/node_modules/ +*/**/yarn.lock # OS X .DS_Store diff --git a/danger/.babelrc b/bots/.babelrc similarity index 100% rename from danger/.babelrc rename to bots/.babelrc diff --git a/bots/README.md b/bots/README.md index 8ee9530bef7926..58cf901f82062c 100644 --- a/bots/README.md +++ b/bots/README.md @@ -1 +1,18 @@ -Github bots and messages used by the Facebook Github bot. +GitHub bots, such as the Danger bot, as well as messages used by the Facebook GitHub bot are all configured in this directory/ + +## Danger + +We use [Danger JS](http://danger.systems/js/) to perform rudimentary maintenance on the React Native repository. + +If you'd like to make changes to the Dangerfile, find an existing PR on the React Native repo and make note of the URL. + +Then, run from the React Native root directory: + +``` +cd .circleci +npm install +.. +node .circleci/node_modules/.bin/danger pr https://github.com/facebook/react-native/pull/1 +``` + +And you will get the responses from parsing the Dangerfile. diff --git a/danger/dangerfile.js b/bots/dangerfile.js similarity index 98% rename from danger/dangerfile.js rename to bots/dangerfile.js index 034798bfafdaeb..ecc9bd90d8cbf9 100644 --- a/danger/dangerfile.js +++ b/bots/dangerfile.js @@ -78,7 +78,7 @@ if (!includesReleaseNotes) { // Tags PRs that have been submitted by a core contributor. // TODO: Switch to using an actual MAINTAINERS file. -const taskforce = fs.readFileSync('../bots/IssueCommands.txt', 'utf8').split('\n')[0].split(':')[1]; +const taskforce = fs.readFileSync('./IssueCommands.txt', 'utf8').split('\n')[0].split(':')[1]; const isSubmittedByTaskforce = includes(taskforce, danger.github.pr.user.login); if (isSubmittedByTaskforce) { markdown('@facebook-github-bot label Core Team'); diff --git a/danger/package.json b/bots/package.json similarity index 100% rename from danger/package.json rename to bots/package.json diff --git a/danger/README.md b/danger/README.md deleted file mode 100644 index 154140cb75c74b..00000000000000 --- a/danger/README.md +++ /dev/null @@ -1,12 +0,0 @@ -If you'd like to make changes to the Dangerfile, find an existing PR and copy the URL. - -Then run from the React Native root: - -``` -cd danger -npm install -.. -node danger/node_modules/.bin/danger pr https://github.com/facebook/react-native/pull/1 -``` - -And you will get the responses from parsing the Dangerfile.