Skip to content

Commit

Permalink
feat: import contribute tools (freeCodeCamp#38509)
Browse files Browse the repository at this point in the history
* first commit

* add: adding all files

* added package-lock.json

* fix: labler and getOpenPrs working

* fix: fixed bug with prFilter function

* feat: can check for multiple errors

* add: install more libraries

* refactor: uses getOpenPrs to get PRs

* packages: modified

* feature: added addComment feature

* feature: added ability to check guide errors

* add: added  guideFolderChecks

* fix: corrected issue with open/close

* update: installed new libraries

* fix: updated guide checker

* feat: create license

* fix: update the comment template (freeCodeCamp#2)

* fix: comment section

* fix: add org name keys

* fix: corrected guide error logic

* fix: removed console.log

Co-Authored-By: RandellDawson <5313213+RandellDawson@users.noreply.github.com>

* fix: corrected guideFolderChecks reduce

* refactor: removed setInterval logic

* feat: added new utilities module

* fix: addComment and labler issues

* feat: changed to module.exports

* fix: improved log file data

* fix: use config var for rateLimiter

Co-Authored-By: RandellDawson <5313213+RandellDawson@users.noreply.github.com>

* fix: used config var for rateLimiter

Co-Authored-By: RandellDawson <5313213+RandellDawson@users.noreply.github.com>

* fix: add vars for production

* fix: add work-logs config

* fix: update gitconfig for work-logs

* fix: update path to work-logs

* docs(readme): add exception for admin v. user

* fix: dotenv will coerce boolean from string (freeCodeCamp#10)

* fix: changed to sync file save

* feat: updated label script

* feat: installed new libraries

* feat: renamed labelOpenPrs.js to sweeper.js

* feat: 1st attempt repo restructure

* feat: added descriptions to one-off scripts

* fix: rewrote the missing frontmatter message

* feat: created one-off scripts to find frontmatter issues

* fix: add links to relevant style guide

* fix: corrected gitignore input-files

* feat: renamed files/folders to lowercase

* fix: changed prStat.js to pr-stats.js

* fix: renamed prStat.js to pr-stats.js

* fix: renamed addLabels.js to add-labels.js

* fix: deleted typo

* feat: changed .env variables

* fix: added rateLimiter after retrieving pr files

* feat: improved logging functionality

* fix: added catch for unexpected frontmatter error

* fix: changed verbiage unexpected frontmatter error

* fix: correct logging bug

* feat: improved findFailures.js and closeOpen.js

* feat: modified the close/open scripts

* refac: moved labeler.js to pr-tasks

* fix: changed rateLimter time in close-open

* fix: changed delay between close/open

* install: added cli-progress library

* feat: added 2 progress bars for sweeper

* fix: changed rateLimiter for pr-relations script

* fix: corrected directory path for renaming of file to work

* first commit

* first commit

* test travis setup

* more travis setup

* get payload

* test

* test

* test

* app yml pull_requests write

* non-working pullRequest createComment

* problem setting permissions

* create-react-app setup.

* Added styled-components dependency.

* Merge pull request freeCodeCamp#1 from RandellDawson/feature/prototype

Created prototype.

* Merge pull request freeCodeCamp#3 from RandellDawson/feat/add-links-to-results

fix: improved input elem behavior

* wip

* test on repo

* tests passing

* fix test title

* issues--write in app.yml

* fix getLabel to createLabel pipeline

* this github scope

* Merge pull request freeCodeCamp#5 from RandellDawson/refactor/input-react-component

Implemented ref forwarding for Input component. Minor clean up.

* Merge pull request freeCodeCamp#6 from RandellDawson/feature/search-with-enter-keypress

Added the ability to search by pressing Enter. Associated refactoring.

* Merge pull request freeCodeCamp#7 from RandellDawson/feature/display-username-with-prs

Added the ability for usernames to be displayed along with found PRs.

* Merge pull request freeCodeCamp#8 from RandellDawson/feat/report-improvements

Feature: Added Pareto Report and Tabs Navigation

* Merge pull request freeCodeCamp#9 from RandellDawson/feature/styled-tab-borders

Restyled tab borders to remove doubled-up borders.

* Merge pull request freeCodeCamp#10 from RandellDawson/feature/styled-components-theme

Implemented styled-components theme.

* Merge pull request freeCodeCamp#11 from RandellDawson/feature/root-package-json

Adde `package.json` and `.gitignore` to the root folder.

* Merge pull request freeCodeCamp#14 from RandellDawson/feat/create-search-component

[feature] created Search component

* Merge pull request freeCodeCamp#16 from RandellDawson/feat/create-search-component

[Feature] Finalized Search Component functionality

* Merge pull request freeCodeCamp#18 from RandellDawson/fix/correct-search-result-messages

[Fix] Correct search result messages and add info footer

* Merge pull request freeCodeCamp#19 from RandellDawson/fix/change-link-color

[Fix] Changed links from blue to 006400

* refactor: move sweeper logic to its own directory

* feat: lernafy the sweeper

* refactor: prepare for dashboard backend move

* docs: re-arrange files for cleaner structure

* refactor: prepare @tbushman 's probot for move

* fix: prepare for importing probot

* chore(.gitignore): update root level and remove redundant copy

* refactor: prepare dashboard-client for move

* refactor: prepare repo for bringing in dashboard client

* chore: install deps, remove clutter

* feat: improve efficiency of pr relations script (freeCodeCamp#23)

* chore: update lock file (freeCodeCamp#24)

* Feature: API endpoint constants (freeCodeCamp#30)

* Implemented expeced behaviour for text input.

* Added constants for API endpoints. Refactored Footer, Pareto and Search components accordingly.

* fix: fixed several issues after move to mono repo (freeCodeCamp#31)

This PR has the following items:

1. Introduces a couple of fixes to the sweeper script from issues right before the move to the mono repo.  These were related to moving labeler out of the root of the sweeper folder and placing into the pr-tasks sub-folder.

2. Combined two scripts which were being used to update the data manually on Glitch (pr-relations.glitch.me).  The new one-off script (get-pr-relations-data.js) downloads the current data.json and then pulls down applicable Github data which updates the data.json and automatically uploads it back to the Glitch server.

3. In an effort to use the same log file across all current one-off scripts and sweeper.js, the ProcessLog class was modified, so now every log created has the same JSON structure as is uploaded to the Glitch server.  This removed a lot of redundant code across 3 files.

4. During a pair-coding session with @honmanyau, we tweaked the UI for the Dashboard app to give it a more consistent look across all views.

5. Based on feedback from a couple of the moderators using the new Dashboard app, the PR title was added along with some other styling. 

6. Added some environment variables for running dashboard-api and dashboard-client in a development mode.

7.  Added a sample_data.json file as a starter file, so someone does not have to do a full data pull to get things up and running. 

8. Modified Pareto view to only display files with 2 or more PRs to speed up the report.

* fix(.env): update paths relative from root of repo (freeCodeCamp#37)

* docs: update notes on the setup

* feat(tools): add eslint and prettier (freeCodeCamp#19)

* refactor(lint): apply linting from the tools (freeCodeCamp#39)

* Revert "refactor(lint): apply linting from the tools (freeCodeCamp#39)" (freeCodeCamp#40)

This reverts commit 8be7d12.

* chore: made changes to move off of Glitch

* fix: removed extra lines from sample.env

* docs: added local setup instructions

* docs: update local setup instruction

* docs: update contributing

* docs: create readme.md

* fix(client): CRA config conflicts with the babel-eslint from root (freeCodeCamp#42)

* feat: add routes and mongodb (freeCodeCamp#34)

* fix: removed dependace on data.json

* docs: updated README.md

* fix: corrected issues with pareto.js and pr.js

* refactor: simplified mongoose related logic

* feat: added seed shortcut to package.json

* fix: corrected typo

* fix: fixed bug with info.js

* fix: simplified info.js

* fix: corrected updatedAt Schema issue

* fix: corrected typo in comment

* chore(lockfile): update after install from root

* fix: add a seed script to root

* Fix/restructuring and unify code logic (freeCodeCamp#48)

* fix: first pass at restructure linting cleanup

* fix: second pass of restructure

* fix: corrected path for index.html

* Fix/restructuring (freeCodeCamp#49)

* moving server scripts to probot/index.js

* non-working express.static config

* config move for seed

* change constant API_HOST to /contribute/

* remove winston

* remove error middleware

* put back client in lerna.json

* fix: fixed CRA static folder issue

* fix: added work-logs folder for one-offs

* small changes

* change /contribute route to /dashboard

* fix: use cross-env in package.json

* formatted with prettier (freeCodeCamp#50)

* encode mongo uri (freeCodeCamp#51)

* fix: removed ref to probot/client/.env

* Fixed the format command (freeCodeCamp#55)

* chore: update lockfile (freeCodeCamp#56)

* fix: corrected config.oneoff.productionRun issue (freeCodeCamp#52)

In an earlier PR I use `joi` to make PRODUCTION_RUN environment variables a Boolean, but did not change to the correct reference and did not change the code logic to compare to a Boolean instead of a String value (as it had been before).  This PR corrects that logic, so that the one-off scripts will work in a production mode again.  Also, removed the now unnecessary ` SKIP_PREFLIGHT_CHECK` environment variable from the `probot/.env` file.

* fix: ran npm run format

* fix: corrected some require paths for update-db.js

* fix: drop only specified collections in models.js

* fix: removed lerna for two run scripts

* remove unnecessary environment variables and npm scripts (freeCodeCamp#59)

* fix: removed config variables not needed

* fix: added pem files to gitignore

* feat: added one-off-script to add english labels

* fix: modified script description

* fix: updated script to use aggregate function

* fix: added note about needing to change url

* init tests

* .toHaveBeenCalledTimes(0) for unrelated PR files

* run tests from root

* lerna run test --scope determined by 'name' field in each package.json

* run jsx in node with .mjs

* shut down mongoose afterEach test

* npm-run-all

* mongoose in tests

* comment out failing script for now

* use probot to get filenames

* remove jsdom and uncomment mongo updateOne test

* only connect mongoose once and better test for PRtest.delete

* fix: added cross-env on npm test and start

* fix: ignore PEM files

* fix: get probot to add stff to db

* fix: changed to aggregate to get info

* fix: renamed update-db to reflect probot

* dashboard route working

* fix: remove calls to update db for now

* fix: update db script for crontab

* Fix: Removal of seed-db (freeCodeCamp#64)

* fix: removed seeding from production

* fix: removed npm start from instructions

* Fix: Simplify log files for one off scripts (freeCodeCamp#65)

* fix: removed seeding from production

* fix: removed npm start from instructions

* fix: removed indices from log file

* fix: update lockfile (freeCodeCamp#66)

* docs: create a CoC

* fix: increased the number of files pulled per PR to Github max of 300 (freeCodeCamp#70)

* fix: made CRA work with local server running

* added run command just for CRA dev mode

* feat: started working on adding Pareto filters

* fix: added missing fonts for landing page

* fix: filter functionality complete

* fix: removed other as an option

* fix: make language all if no language for filetype

* feat: add some develop scripts

* responsive css (freeCodeCamp#73)

* Fix broke link of contribution guide (freeCodeCamp#75)

* [Fix] Update landing page links and make styling for landing page and Dashboard match (freeCodeCamp#79)

* fix: corrected links and changed header links

* fix: added fonts

* fix: changed layout of Pareto options

* fix: match main page styling

* fix: adjusted padding on menu

* fix: correct link href for Home

* fix: changed title of Dashbaord

* [Fix] Corrected client page title typo (freeCodeCamp#83)

* fix: corrected typo in page title

* fix: add info record if no collection exists

* docs: updated docs relating to local dev ports

* fix: add count increment when adding

* fix: be able to specify lanuage

* feat: new script to find merge conflicts

* fix: added recheck for unknown status

* fix: add pr number to no results message

* fix: changed from notifying to adding label

* chore: update lockfiles (freeCodeCamp#92)

* docs: update setup docs (freeCodeCamp#93)

* fix: update lerna config to install in ci mode

* docs: update readme

* fix/update-local-setup-doc (freeCodeCamp#98)

* fix/update-local-setup-doc

* fix/capitalization

* Update docs/README.md

Co-Authored-By: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>

* Update docs/README.md

Co-Authored-By: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>

* Update docs/README.md

Co-Authored-By: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>

* Update docs/README.md

Co-Authored-By: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>

* fix/update-homepage-instruction

* fix: remove all guide related code

* chore: remove eslint config from dashboard

* fix: temporarily pause linting of tools/dashboard

Remove this when we have time to configure it properly.

* fix: pause testing on tools/dashboard

Co-authored-by: Randell Dawson <rdawson@onepathtech.com>
Co-authored-by: RandellDawson <5313213+RandellDawson@users.noreply.github.com>
Co-authored-by: tbushman <tbushman@pu.bli.sh>
Co-authored-by: Honman Yau <honmanyau@users.noreply.github.com>
Co-authored-by: Valeriy <ValeraS@users.noreply.github.com>
Co-authored-by: Tracey Bushman <tracey.bushman@gmail.com>
Co-authored-by: Niraj Nandish <nirajnandish@icloud.com>
Co-authored-by: Musthaq Ahamad <musthu.gm@gmail.com>
Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
  • Loading branch information
11 people authored and abbathaw committed Jul 24, 2020
1 parent e6315ec commit 9089d72
Show file tree
Hide file tree
Showing 100 changed files with 41,993 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ client/.cache/**
client/static/**
client/public/**
api-server/public/**
api-server/lib/**
api-server/lib/**
tools/dashboard/**
5 changes: 5 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// TODO: remove this once /tools/dashboard's tests are configured correctly

module.exports = {
testPathIgnorePatterns: ['/node_modules/', '/tools/dashboard']
};
110 changes: 110 additions & 0 deletions tools/dashboard/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#-----
# Node
#-----

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless

# FuseBox cache
.fusebox/

#-----------------
# Create React App
#-----------------

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
build

# ------------
# Custom Files
# ------------

work-logs
# work-logs
#

# ------------
# Probot Files
# ------------

*.pem
*.vscode
5 changes: 5 additions & 0 deletions tools/dashboard/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": true,
"singleQuote": true,
"trailingComma": "none"
}
1 change: 1 addition & 0 deletions tools/dashboard/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
> Our Code of Conduct is available here: <https://code-of-conduct.freecodecamp.org/>
29 changes: 29 additions & 0 deletions tools/dashboard/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2018, freeCodeCamp.org
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5 changes: 5 additions & 0 deletions tools/dashboard/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
![freeCodeCamp Social Banner](https://s3.amazonaws.com/freecodecamp/wide-social-banner.png)

# contribute

Tools to help maintain [freeCodeCamp.org](https://www.freecodecamp.org)'s Open Source Codebase on GitHub. Dashboard is available at https://contribute.freecodecamp.org/home
57 changes: 57 additions & 0 deletions tools/dashboard/config/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
const Joi = require('joi');
const path = require('path');
// require and configure dotenv, will load vars in .env in PROCESS.ENV
const envPath = path.resolve(__dirname, '../probot/.env');
require('dotenv').config({ path: envPath });

// define validation for all the env vars
const envVarsSchema = Joi.object({
NODE_ENV: Joi.string()
.allow(['development', 'production', 'test', 'provision'])
.default('development'),
PORT: Joi.number().default(3001),
MONGO_HOST: Joi.string()
.required()
.description('Mongo DB host url'),
MONGO_PORT: Joi.number().default(27017),
GITHUB_USERNAME: Joi.string().required(),
GITHUB_ACCESS_TOKEN: Joi.string().required(),
REPOSITORY_OWNER: Joi.string().required(),
REPOSITORY: Joi.string().required(),
PRODUCTION_RUN: Joi.boolean()
.default(false),
WEBHOOK_PROXY_URL: Joi.string().required(),
APP_ID: Joi.number().required(),
WEBHOOK_SECRET: Joi.string().required()
})
.unknown()
.required();

const { error, value: envVars } = Joi.validate(process.env, envVarsSchema);
if (error) {
throw new Error(`Config validation error: ${error.message}`);
}

const config = {
env: envVars.NODE_ENV,
mongo: {
host: envVars.MONGO_HOST,
port: envVars.MONGO_PORT
},
github: {
id: envVars.GITHUB_USERNAME,
secret: envVars.GITHUB_ACCESS_TOKEN,
owner: envVars.REPOSITORY_OWNER,
repo: envVars.REPOSITORY,
probot: {
webhookUrl: envVars.WEBHOOK_PROXY_URL,
webhookSecret: envVars.WEBHOOK_SECRET,
appID: envVars.APP_ID
}
},
oneoff: {
productionRun: envVars.PRODUCTION_RUN
}
};

module.exports = config;
8 changes: 8 additions & 0 deletions tools/dashboard/docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Contributing

Todo

## Usage

Todo

81 changes: 81 additions & 0 deletions tools/dashboard/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
## Local Setup
- Follow the steps below to get this running on your local machine

### 1. Copy .env
- Copy the `sample.env` file into `.env`. The command below will do that in the terminal if your CWD(current working directory) is the `contribute` folder.
```bash
cp probot/sample.env probot/.env
```
- If you do not want to populate the database with the freeCodeCamp PR's you can [skip to step 6](#6-start-the-program)

### 2. Update .env
- Put your GitHub username in the `GITHUB_USERNAME` field of the `.env` file

### 3. Obtain GitHub Personal access token
- While on Github, click your profile icon > `Settings`
- Then click `Developer settings` > `Personal access tokens`
- Click `Generate new token`
- On the next page, give the token a name so you know what it’s for
- Scroll down to the bottom and click `Generate token`
- Copy the token string and paste it into the `GITHUB_ACCESS_TOKEN` field in the `.env` file. Note that you will not be able to see this token string on GitHub again

### 4. Create your own GitHub app
- While on GitHub, click your profile icon > `Settings`
- Then click `developer settings` > `New GitHub app`
- Fill in the `name` field with a name of your choice
- Fill in the `Homepage URL` field with the URL to the GitHub repository for your app. e.g. `https://github.com/username/contribute`
- In a new tab, go to https://smee.io/
- Click `Start a new channel` and copy the URL they give you. You can ignore the rest of the instructions on the `smee.io` page
- Paste the URL you copied into the `WEBHOOK_PROXY_URL` field of the `.env` file and the `Webhook URL` field of your new GitHub app
- Fill in the `Webhook secret` field on the GitHub app with a secret of your choice
- Put the same secret you just used in the `WEBHOOK_SECRET` field of the `.env` file
- Scroll to the bottom of your GitHub app page and click `Create GitHub App`
- On the next page, copy the `App ID` and paste it into the `APP_ID` field of the `.env` file
- Scroll to the bottom of this page and click `Generate Private Key`
- A popup menu will allow you to download the key file. Download it and put it in the `probot` folder

### 5. Run mongoDB
- Make sure a mongoDB instance is running by running the command below in the terminal.
```bash
mongod —dbpath=./database_folder
```

### 6. Start the program
- In a new terminal window or tab, run these three commands to start the program. Wait for one command to finish running before starting the next.
```bash
npm install
npm run build
npm run develop
```
- If you skipped steps 2-5, you can ignore the rest

### 7. Update the Database
- Run the command below to populate your local database with PR’s from the freeCodeCamp repo. Note that you must have the program running and mongoDB running.
```bash
node probot/server/tools/update-db.js
```
- This will take a while. If it stops running partway through, it's probably a timeout error. Run the command again and it should finish

## Caveats & Notes

### Local Ports when developing locally
Using `npm run develop` will start both the api server and the Create React App(Dashboard) in development mode. The api server runs on port 3001 and the React app runs on port 3000.

### The one-off scripts will error out on actions performed by repository admins
For example, if an admin removes a label from a Pull Request, the script can not add that label back. This is usually because the script is acting on behalf of a non-admin user with write access.
This is usually the case with the use of access tokens for scripts.

### Setting up Cron jobs for Sweeper Scripts
For updating dashboard data we use PM2 like so:
```bash
pm2 start --no-autorestart probot/server/tools/update-db.js --cron "*/10 * * * *"
```
This will start the script in the "no restart" mode and re-run it every 10 minutes.
A useful link to calculate a Cron expression: <https://crontab.guru/every-10-minutes>

### Starting the express server (via probot)
```bash
pm2 start "npm start" --name "contribute-app"
```
**Note:** Start only one instance of this app, you can't have multiple probot apps running. Starting multiple instances will crash the app.

4 changes: 4 additions & 0 deletions tools/dashboard/lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"packages": ["probot", "probot/client", "lib", "one-off-scripts"],
"version": "independent"
}
30 changes: 30 additions & 0 deletions tools/dashboard/lib/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const config = require('../config');

const owner = config.github.owner;
const repo = config.github.repo;
const fccBaseUrl = `https://github.com/${owner}/${repo}/`;
const prBaseUrl = `${fccBaseUrl}pull/`;

const octokitConfig = {
// 0 means no request timeout
timeout: 0,
headers: {
accept: 'application/vnd.github.v3+json',
// v1.2.3 will be current version
'user-agent': 'octokit/rest.js v1.2.3'
},
// custom GitHub Enterprise URL
baseUrl: 'https://api.github.com',
// Node only: advanced request options can be passed as http(s) agent
/* eslint-disable no-undefined */
agent: undefined
/* eslint-enable no-undefined */
};

const octokitAuth = {
type: 'basic',
username: config.github.id,
password: config.github.secret
};

module.exports = { owner, repo, prBaseUrl, octokitConfig, octokitAuth };
6 changes: 6 additions & 0 deletions tools/dashboard/lib/defaults.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
labelPRConflict: {
name: 'PR: potential-conflict',
color: 'c2e0c6'
}
};

0 comments on commit 9089d72

Please sign in to comment.