-
Notifications
You must be signed in to change notification settings - Fork 2
Initial commits #1
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
Open
pyokagan
wants to merge
15
commits into
se-edu:master
Choose a base branch
from
pyokagan:initial
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
011a4a7
Initial commit
pyokagan d4b29ed
server: add source-map-support
pyokagan 01e70df
server: implement support for ".env" files
pyokagan eb1554e
server: implement "Hello world!" web server
pyokagan 4129757
Implement testing support with mocha
pyokagan 096f261
lib/github: implement Github webhook support
pyokagan 6a5404a
logic: implement logic architecture
pyokagan 142ea4d
lib/github: support making authenticated API requests
pyokagan 9a24daa
logic: implement github API support
pyokagan c35a85e
logic: praise PR authors when their PRs are merged
pyokagan 5325ddd
logs: implement logging
pyokagan 627d9a4
lib/github: implement forEachPage() helper function
pyokagan 805a9a7
lib/Auth: implement support for authenticated user sessions
pyokagan 1eb4f04
logs: only allow organization members to access them
pyokagan d1fc430
README.adoc changes from dogfooding
pyokagan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| root = true | ||
|
|
||
| [*] | ||
| end_of_line = lf | ||
| insert_final_newline = true | ||
| indent_style = space | ||
| indent_size = 4 | ||
| trim_trailing_whitespace = true | ||
| charset = utf-8 | ||
| max_line_length = 120 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| /node_modules/ | ||
| /npm-debug.log | ||
| /se-edu-bot-*.tgz | ||
| /dist/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| language: node_js | ||
|
|
||
| node_js: | ||
| - "7" | ||
|
|
||
| script: npm run all build lint |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| Copyright 2017 seedu-bot contributors | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
| this software and associated documentation files (the "Software"), to deal in | ||
| the Software without restriction, including without limitation the rights to | ||
| use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | ||
| of the Software, and to permit persons to whom the Software is furnished to do | ||
| so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| web: npm start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| = se-edu-bot | ||
| :toc: preamble | ||
| :toc-title: | ||
| :sectnums: | ||
| ifdef::env-github[] | ||
| :tip-caption: :bulb: | ||
| :note-caption: :information_source: | ||
| endif::[] | ||
| ifdef::env-github,env-browser[:outfilesuffix: .adoc] | ||
|
|
||
| Helps out with managing SE-EDU projects. | ||
|
|
||
| == Local development setup | ||
|
|
||
| === Prerequisites | ||
|
|
||
| . Node `7.9.0` or later. | ||
| . An editor with Typescript language service support is strongly recommended. | ||
| (e.g. https://code.visualstudio.com/[VS Code]) | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe add a Note that for VSCode, the |
||
| . https://ngrok.com/[ngrok] | ||
|
|
||
| === Cloning the repo | ||
|
|
||
| . Fork this repo, and clone the fork to your computer. | ||
| . `cd` into the project directory. | ||
| . Run `npm install` to install dependencies. | ||
|
|
||
| === Setting up ngrok | ||
|
|
||
| We use https://ngrok.com/[ngrok] to expose our local server to the internet for Webhook testing. | ||
| Run | ||
|
|
||
| ---- | ||
| ngrok http 5000 | ||
| ---- | ||
|
|
||
| You should see a line like this: | ||
|
|
||
| ---- | ||
| Forwarding https://abcdefg123.ngrok.io -> localhost:5000 | ||
| ---- | ||
|
|
||
| This is your temporary ngrok URL which exposes your local server to the internet. | ||
| It is valid until the `ngrok` process terminates. | ||
| Take note of it, we'll use it in later steps. | ||
|
|
||
| === Building the project | ||
|
|
||
| * Build the project once. | ||
| + | ||
| [source,shell] | ||
| ---- | ||
| npm run build | ||
| ---- | ||
|
|
||
| * Do a clean build. | ||
| + | ||
| [source,shell] | ||
| ---- | ||
| npm run all clean build | ||
| ---- | ||
|
|
||
| === Running the server | ||
|
|
||
| The project must be built first (`npm run build`). | ||
|
|
||
| * Run the server | ||
| + | ||
| [source,shell] | ||
| ---- | ||
| npm start | ||
| ---- | ||
|
|
||
| * Run the server and watch for changes, | ||
| incrementally rebuilding the project and restarting the server whenever source files change. | ||
| + | ||
| [source,shell] | ||
| ---- | ||
| npm run watch | ||
| ---- | ||
|
|
||
| The server should be accessible via your ngrok address which you got in <<Setting up ngrok>>. | ||
|
|
||
| === Linting | ||
|
|
||
| [source,shell] | ||
| ---- | ||
| npm run lint | ||
| ---- | ||
|
|
||
| === Cleaning build products | ||
|
|
||
| [source,shell] | ||
| ---- | ||
| npm run clean | ||
| ---- | ||
|
|
||
| == Deploying to Heroku | ||
|
|
||
| This repository is setup to automatically deploy to Heroku whenever new commits are pushed to `master`. | ||
| As such, there is no need for any manual deployment. | ||
|
|
||
| Below is a guide for setting up the Heroku application from scratch should there be any need to (e.g. for testing). | ||
|
|
||
| === Setting up the Heroku application from scratch | ||
|
|
||
| . Go to the https://dashboard.heroku.com[Heroku dashboard] and login. | ||
| . `New` -> `Create new App`. | ||
| . Enter the app name (i.e. `se-edu-bot`) and click `Create App`. | ||
| . Under `Deployment method`, select `Github`. | ||
| . If Heroku Dashboard does not have access to your GitHub account, | ||
| it will display a single `Connect to GitHub` button. | ||
| Click on it, and then authorize the Heroku Dashboard to access your GitHub account and `se-edu` organization. | ||
| . Follow the instructions to connect the Heroku app to the `se-edu/se-edu-bot` repo. | ||
| . Ensure the `Wait for CI to pass before deploy` checkbox is checked, and then click `Enable Automatic Deploys`. | ||
| . Go to `Settings` -> `Config Variables`, and set `NPM_CONFIG_PRODUCTION` to `false`. | ||
|
|
||
| == Coding standard | ||
|
|
||
| We follow the oss-generic coding standard. | ||
|
|
||
| == License | ||
|
|
||
| MIT License | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| { | ||
| "name": "se-edu-bot", | ||
| "description": "Helps out with SE-EDU tasks", | ||
| "license": "MIT", | ||
| "private": true, | ||
| "engines": { | ||
| "node": ">=7.9.0" | ||
| }, | ||
| "files": [ | ||
| "dist" | ||
| ], | ||
| "scripts": { | ||
| "all": "npm-run-all", | ||
| "build": "tsc", | ||
| "postinstall": "npm run build", | ||
| "start": "node dist/server.js", | ||
| "watch:tsc": "tsc -w", | ||
| "watch:server": "nodemon --watch dist dist/server.js", | ||
| "watch": "npm-run-all --parallel \"watch:*\"", | ||
| "clean": "rimraf dist", | ||
| "lint": "tslint -p tsconfig.json --type-check" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/node": "^7.0.31", | ||
| "nodemon": "^1.11.0", | ||
| "npm-run-all": "^4.0.2", | ||
| "rimraf": "^2.6.1", | ||
| "tslint": "^5.4.3", | ||
| "tslint-language-service": "^0.9.6", | ||
| "typescript": "^2.3.4" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| if (require.main === module) { | ||
| console.log('Hello world!'); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "module": "commonjs", | ||
| "newLine": "LF", | ||
| "noImplicitReturns": true, | ||
| "noUnusedLocals": true, | ||
| "outDir": "dist", | ||
| "plugins": [ | ||
| {"name": "tslint-language-service"} | ||
| ], | ||
| "pretty": true, | ||
| "sourceMap": true, | ||
| "strict": true, | ||
| "target": "ES2017" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| { | ||
| "defaultSeverity": "error", | ||
| "lintOptions": { | ||
| "typeCheck": true | ||
| }, | ||
| "rules": { | ||
| "adjacent-overload-signatures": true, | ||
| "await-promise": true, | ||
| "class-name": true, | ||
| "comment-format": [true, "check-space"], | ||
| "curly": true, | ||
| "eofline": true, | ||
| "indent": [true, "spaces", 4], | ||
| "linebreak-style": [true, "LF"], | ||
| "max-line-length": [true, 120], | ||
| "member-access": [true, "no-public"], | ||
| "member-ordering": [true, { | ||
| "order": [ | ||
| "public-static-field", | ||
| "protected-static-field", | ||
| "private-static-field", | ||
| "public-instance-field", | ||
| "protected-instance-field", | ||
| "private-instance-field", | ||
| "constructor", | ||
| "public-static-method", | ||
| "protected-static-method", | ||
| "private-static-method", | ||
| "public-instance-method", | ||
| "protected-instance-method", | ||
| "private-instance-method" | ||
| ] | ||
| }], | ||
| "no-consecutive-blank-lines": true, | ||
| "no-floating-promises": true, | ||
| "no-inferrable-types": [true, "ignore-params", "ignore-properties"], | ||
| "no-trailing-whitespace": true, | ||
| "no-var-keyword": true, | ||
| "object-literal-sort-keys": true, | ||
| "only-arrow-functions": [true, "allow-declarations"], | ||
| "ordered-imports": true, | ||
| "prefer-const": true, | ||
| "prefer-template": [true, "allow-single-concat"], | ||
| "promise-function-async": true, | ||
| "quotemark": [true, "single"], | ||
| "semicolon": [true, "always"], | ||
| "space-before-function-paren": [ true, { | ||
| "anonymous": "never", | ||
| "named": "never", | ||
| "asyncArrow": "always" | ||
| }], | ||
| "trailing-comma": [true, {"multiline": "always", "singleline": "never"}], | ||
| "triple-equals": true, | ||
| "typedef": [true, "call-signature", "parameter", "property-declaration"], | ||
| "typedef-whitespace": [true, { | ||
| "call-signature": "nospace", | ||
| "index-signature": "nospace", | ||
| "parameter": "nospace", | ||
| "property-declaration": "nospace", | ||
| "variable-declaration": "nospace" | ||
| }, { | ||
| "call-signature": "onespace", | ||
| "index-signature": "onespace", | ||
| "parameter": "onespace", | ||
| "property-declaration": "onespace", | ||
| "variable-declaration": "onespace" | ||
| }], | ||
| "whitespace": [ | ||
| true, | ||
| "check-branch", | ||
| "check-decl", | ||
| "check-operator", | ||
| "check-module", | ||
| "check-separator", | ||
| "check-type", | ||
| "check-typecast", | ||
| "check-preblock" | ||
| ] | ||
| }, | ||
| "rulesDirectory": [] | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to specify required npm version as well.