From a2be8f465e4910ee85bfc0115fd161da3509b380 Mon Sep 17 00:00:00 2001 From: Seema Kamath Date: Thu, 13 Oct 2016 10:28:04 -0700 Subject: [PATCH 1/9] Update contributing.md --- CONTRIBUTING.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c5fd65e..0f6c05e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,21 +2,20 @@ ## Developing locally -To develop locally, you will need the latest version of [Node.js](https://nodejs.org/). After cloning the repo: - +0. Clone the repo +0. Make sure you have the latest version of [Node.js](https://nodejs.org/) to develop locally. 0. Run `$ script/bootstrap` to install all the project dependencies -0. Run `$ script/server` to run the server on http://localhost:3000 +0. Until this gets built into a proper [Integration](https://developer.github.com/early-access/integrations/), the bot will need a valid GitHub API token to be able to do anything useful. Create a new [Personal access token](https://github.com/settings/tokens/new) and select the `repo` scope. +0. Re-start the local server with the token by running: `$ GITHUB_TOKEN=xxx script/server` to run the server on http://localhost:3000 +0. Download [ngrok](https://ngrok.com/download) (`$ brew cask install ngrok` on a mac), which will expose a local server to the internet. +0. With the server still running, open a new terminal tab and run `ngrok http 3000`, which should output something like `Forwarding http://4397efc6.ngrok.io -> localhost:3000`. To test with a real GitHub repository, you'll need to create a test repository and configure a new webhook: -0. Download [ngrok](https://ngrok.com/download) (`$ brew cask install ngrok` on a mac), which will expose a local server to the internet. -0. With the server still running, open a new terminal tab and run `ngrok http 3000`, which should output something like `Forwarding http://4397efc6.ngrok.io -> localhost:3000`. 0. Head over to the **Settings** page of your repository, and click on **Webhooks & services**. Then, click on **Add webhook**. Configure it with: - **Payload URL:** Use the full `*.ngrok.io` - **Secret:** `development` - **Which events would you like to trigger this webhook?:** Choose **Send me everything**. -0. Until this gets built into a proper [Integration](https://developer.github.com/early-access/integrations/), the bot will need a valid GitHub API token to be able to do anything useful. Create a new [Personal access token](https://github.com/settings/tokens/new) and select the `repo` scope. -0. Re-start the local server with the token by running: `$ GITHUB_TOKEN=xxx script/server` 0. Create a `.probot.yml` in your repo with: behaviors: - on: issues.opened From 2661fb0a63b79b0b15a231dfcb1272e2d81216ad Mon Sep 17 00:00:00 2001 From: Seema Kamath Date: Thu, 13 Oct 2016 10:31:07 -0700 Subject: [PATCH 2/9] Change title to Setup --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0f6c05e..7c9fa06 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing -## Developing locally +## Setup 0. Clone the repo 0. Make sure you have the latest version of [Node.js](https://nodejs.org/) to develop locally. From a12e03309fe73b985b965bc1995c45fc79394c95 Mon Sep 17 00:00:00 2001 From: Seema Kamath Date: Thu, 13 Oct 2016 11:50:01 -0700 Subject: [PATCH 3/9] Add note on enabling debug mode for github client --- CONTRIBUTING.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7c9fa06..2cbc57f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,3 +22,9 @@ To test with a real GitHub repository, you'll need to create a test repository a then: comment: "Hello World! Your bot is working!" 0. Open a new issue. Your bot should post a comment (you may need to refresh to see it). + +## Debugging +0. To see what requests are going out, enable debugging mode for GitHub client in /server.js: + const github = new GitHubApi({ + debug: true + }); From 1181e8e7c32308c7ec75cf909fa58687cd2b38e2 Mon Sep 17 00:00:00 2001 From: Seema Kamath Date: Thu, 13 Oct 2016 12:02:59 -0700 Subject: [PATCH 4/9] Fix code block formatting --- CONTRIBUTING.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2cbc57f..eca3b51 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,14 +17,18 @@ To test with a real GitHub repository, you'll need to create a test repository a - **Secret:** `development` - **Which events would you like to trigger this webhook?:** Choose **Send me everything**. 0. Create a `.probot.yml` in your repo with: + ``` behaviors: - - on: issues.opened - then: - comment: "Hello World! Your bot is working!" + - on: issues.opened + then: + comment: "Hello World! Your bot is working!" + ``` 0. Open a new issue. Your bot should post a comment (you may need to refresh to see it). ## Debugging 0. To see what requests are going out, enable debugging mode for GitHub client in /server.js: + ``` const github = new GitHubApi({ debug: true }); + ``` From bbd3f7cf1326ba4befbf7a44a8c4829a66b30d34 Mon Sep 17 00:00:00 2001 From: Seema Kamath Date: Thu, 13 Oct 2016 12:04:03 -0700 Subject: [PATCH 5/9] Actually fix formatting --- CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eca3b51..ea494c8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,18 +17,18 @@ To test with a real GitHub repository, you'll need to create a test repository a - **Secret:** `development` - **Which events would you like to trigger this webhook?:** Choose **Send me everything**. 0. Create a `.probot.yml` in your repo with: - ``` + behaviors: - on: issues.opened then: comment: "Hello World! Your bot is working!" - ``` + 0. Open a new issue. Your bot should post a comment (you may need to refresh to see it). ## Debugging 0. To see what requests are going out, enable debugging mode for GitHub client in /server.js: - ``` + const github = new GitHubApi({ debug: true }); - ``` + From ac00529d75082f721c3fee70e7c9fe2f91785ddc Mon Sep 17 00:00:00 2001 From: Seema Kamath Date: Thu, 13 Oct 2016 12:05:39 -0700 Subject: [PATCH 6/9] Add testing section header --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ea494c8..ce0f6f6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,6 +10,7 @@ 0. Download [ngrok](https://ngrok.com/download) (`$ brew cask install ngrok` on a mac), which will expose a local server to the internet. 0. With the server still running, open a new terminal tab and run `ngrok http 3000`, which should output something like `Forwarding http://4397efc6.ngrok.io -> localhost:3000`. +## Testing To test with a real GitHub repository, you'll need to create a test repository and configure a new webhook: 0. Head over to the **Settings** page of your repository, and click on **Webhooks & services**. Then, click on **Add webhook**. Configure it with: From fdb86b9e21e5fab5af2daecf5a1b81247479686e Mon Sep 17 00:00:00 2001 From: Seema Kamath Date: Thu, 13 Oct 2016 12:06:42 -0700 Subject: [PATCH 7/9] Tweak formatting --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ce0f6f6..7f6c02b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,7 +27,7 @@ To test with a real GitHub repository, you'll need to create a test repository a 0. Open a new issue. Your bot should post a comment (you may need to refresh to see it). ## Debugging -0. To see what requests are going out, enable debugging mode for GitHub client in /server.js: +0. To see what requests are going out, enable debugging mode for GitHub client in `/server.js`: const github = new GitHubApi({ debug: true From 002300a460e36e3c044718163d4cc2332a8869cc Mon Sep 17 00:00:00 2001 From: Seema Kamath Date: Thu, 13 Oct 2016 14:11:05 -0700 Subject: [PATCH 8/9] Address @bkeepers feedback --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7f6c02b..4b6a95e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,7 +22,7 @@ To test with a real GitHub repository, you'll need to create a test repository a behaviors: - on: issues.opened then: - comment: "Hello World! Your bot is working!" + comment: "Hello World! Your bot is working!" 0. Open a new issue. Your bot should post a comment (you may need to refresh to see it). From 7288d9e36a57e57fe3c49579b5836d7f14aef7e3 Mon Sep 17 00:00:00 2001 From: Seema Kamath Date: Thu, 13 Oct 2016 14:18:10 -0700 Subject: [PATCH 9/9] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4b6a95e..cbae233 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,4 +32,4 @@ To test with a real GitHub repository, you'll need to create a test repository a const github = new GitHubApi({ debug: true }); - +0. Always run `$ script/bootstrap` and restart the server if package.json has changed.