Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dev] Update to Danger 2.0 #17234

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 3 additions & 14 deletions .circleci/config.yml
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
Expand Up @@ -7,4 +7,4 @@ Libraries/Renderer/*
pr-inactivity-bookmarklet.js
question-bookmarklet.js
flow/
danger/

2 changes: 1 addition & 1 deletion .flowconfig
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
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
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
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