Skip to content

Commit

Permalink
Move danger to bots directory
Browse files Browse the repository at this point in the history
Summary:
No logic change here. Part of a plan to consolidate CI-only files amongst .circleci and bots/ directories.
Closes facebook#17807

Differential Revision: D6865976

Pulled By: hramos

fbshipit-source-id: 48607a80dcf8cac1c3c033c18bf5d6dd4cd8e6bf
  • Loading branch information
hramos authored and facebook-github-bot committed Feb 1, 2018
1 parent d74ff6f commit 22a2553
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 20 deletions.
5 changes: 5 additions & 0 deletions .circleci/README.md
Original file line number Diff line number Diff line change
@@ -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.
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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."
Expand All @@ -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
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ buck-out
/ReactAndroid/src/main/jni/prebuilt/lib/x86/
/ReactAndroid/src/main/gen

# Watchman
.watchmanconfig

# Android
.idea
.gradle
Expand All @@ -47,7 +50,8 @@ local.properties
node_modules
*.log
.nvm
/danger/node_modules/
/bots/node_modules/
*/**/yarn.lock

# OS X
.DS_Store
Expand Down
File renamed without changes.
19 changes: 18 additions & 1 deletion bots/README.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion danger/dangerfile.js → bots/dangerfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
File renamed without changes.
12 changes: 0 additions & 12 deletions danger/README.md

This file was deleted.

0 comments on commit 22a2553

Please sign in to comment.