Skip to content

Commit

Permalink
[Dev] Update to Danger 2.0
Browse files Browse the repository at this point in the history
Signed-off-by: Orta Therox <orta@artsymail.com>
Signed-off-by: Anandaroop Roy <roop@artsymail.com>
  • Loading branch information
orta authored and anandaroop committed Dec 15, 2017
1 parent 8c8944c commit 83115e1
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 43 deletions.
17 changes: 3 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ aliases:

- &restore-cache-analysis
keys:
- v1-analysis-dependencies-{{ arch }}-{{ .Branch }}-{{ checksum "package.json" }}{{ checksum "danger/package.json" }}
- v1-analysis-dependencies-{{ arch }}-{{ .Branch }}-{{ checksum "package.json" }}
# Fallback in case checksum fails
- v1-analysis-dependencies-{{ arch }}-{{ .Branch }}-
- &save-cache-analysis
paths:
- danger/node_modules
- node_modules
key: v1-analysis-dependencies-{{ arch }}-{{ .Branch }}-{{ checksum "package.json" }}{{ checksum "danger/package.json" }}
key: v1-analysis-dependencies-{{ arch }}-{{ .Branch }}-{{ checksum "package.json" }}

- &restore-cache-android-packages
keys:
Expand Down Expand Up @@ -421,22 +420,12 @@ jobs:
- checkout
- restore-cache: *restore-cache-analysis
- run: *install-node-dependencies
- run:
name: Install Dependencies
command: |
if [ -n "$CIRCLE_PULL_REQUEST" ]; then
npm install github@0.2.4
cd danger
npm install --no-package-lock --no-spin --no-progress
else
echo "Skipping dependency installation."
fi
- save-cache: *save-cache-analysis
- run:
name: Analyze Pull Request
command: |
if [ -n "$CIRCLE_PULL_REQUEST" ]; then
cd danger && DANGER_GITHUB_API_TOKEN="e622517d9f1136ea8900""07c6373666312cdfaa69" npm run danger
DANGER_GITHUB_API_TOKEN="e622517d9f1136ea8900""07c6373666312cdfaa69" npm run danger
else
echo "Skipping pull request analysis."
fi
Expand Down
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ Libraries/Renderer/*
pr-inactivity-bookmarklet.js
question-bookmarklet.js
flow/
danger/

2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
.*/local-cli/templates/.*

; Ignore the Dangerfile
<PROJECT_ROOT>/danger/dangerfile.js
<PROJECT_ROOT>/dangerfile.js

; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/\.buckd/
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ local.properties
node_modules
*.log
.nvm
/danger/node_modules/

# OS X
.DS_Store
Expand Down
1 change: 0 additions & 1 deletion danger/.babelrc

This file was deleted.

12 changes: 0 additions & 12 deletions danger/README.md

This file was deleted.

11 changes: 0 additions & 11 deletions danger/package.json

This file was deleted.

4 changes: 2 additions & 2 deletions danger/dangerfile.js → dangerfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,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('bots/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 Expand Up @@ -171,7 +171,7 @@ if (!isMergeRefMaster && isMergeRefStable) {
}

// People can add themselves to CODEOWNERS in order to be automatically added as reviewers when a file matching a glob pattern is modified. The following will have the bot add a mention in that case.
const codeowners = fs.readFileSync('../.github/CODEOWNERS', 'utf8').split('\n');
const codeowners = fs.readFileSync('.github/CODEOWNERS', 'utf8').split('\n');
let mentions = [];
codeowners.forEach((codeowner) => {
const pattern = codeowner.split(' ')[0];
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
},
"devDependencies": {
"babel-eslint": "^7.2.3",
"danger": "^2.1.5",
"eslint": "^3.19.0",
"eslint-config-fb-strict": "^20.0.3",
"eslint-config-fbjs": "^1.1.1",
Expand Down

0 comments on commit 83115e1

Please sign in to comment.