You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-31Lines changed: 16 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,20 +6,12 @@
6
6
7
7
Oppiabot is a GitHub app built with [probot](https://github.com/probot/probot). It acts as a helper for the Oppia code repository to maintain the development workflow. It is hosted on [Heroku](https://www.heroku.com/).
8
8
9
-
The bot currently performs the following functions:
10
-
11
-
1. Checks whether a contributor creating a pull request has signed the CLA. It adds a label `Needs CLA` accordingly.
12
-
13
-
2. Checks merge conflict in a pull request and notifies the author of the pull request if there is a merge conflict.
14
-
15
-
3. Closes stale pull requests.
16
-
17
9
18
10
## Getting started
19
11
20
12
Please refer to the following instructions to setup Oppiabot for the first time on your machine:
21
13
22
-
1. Create a new, empty folder called `opensource/` within your home folder. Navigate to it (`cd opensource`), then [fork and clone](https://help.github.com/articles/fork-a-repo/) the Oppiabot repo. This will create a new folder named `opensource/oppiabot`. Navigate to `opensource/oppiabot/`.
14
+
1. Create a newfolder called `opensource/` within your home folder (or use one that you already have). Navigate to it (`cd opensource`), then [fork and clone](https://help.github.com/articles/fork-a-repo/) the Oppiabot repo. This will create a new folder named `opensource/oppiabot`. Navigate to `opensource/oppiabot/`.
23
15
24
16
2. Install [Node.Js](https://nodejs.org/) and [NPM](https://www.npmjs.com/) on your machine using the following commands:
25
17
@@ -32,13 +24,7 @@ Please refer to the following instructions to setup Oppiabot for the first time
@@ -47,7 +33,7 @@ Please refer to the following instructions to setup Oppiabot for the first time
47
33
```
48
34
49
35
#### Using Windows
50
-
Install using following [link](https://nodejs.org/en/download/). (Its always preferred to use LTS Version).
36
+
Use [WSL with Ubuntu](https://learn.microsoft.com/en-us/windows/wsl/install) and then follow the Ubuntu instructions.
51
37
52
38
3. Setup probot and other dependencies by running the following command:
53
39
```bash
@@ -56,10 +42,6 @@ Please refer to the following instructions to setup Oppiabot for the first time
56
42
57
43
4. The Oppiabot uses environment variables. These are configured in the server settings. To deploy the bot locally, create a `.env` file and copy the contents of `.env.example` to it. You will need to adjust these variables accordingly following the instructions in the subsequent steps. Run following command to copy `.env.example` to `.env`
58
44
59
-
If you're using Windows cmd, go to Oppiabot folder and type:
60
-
``` bash
61
-
copy .env.example .env
62
-
```
63
45
If you have Linux terminal type:
64
46
```bash
65
47
cp .env.example .env
@@ -68,33 +50,36 @@ If you have Linux terminal type:
68
50
5. Go to [smee.io](https://smee.io/) and click **Start a new channel**. Set `WEBHOOK_PROXY_URL`in`.env` to the URL that you are redirected to.
69
51
70
52
6. [Create a new GitHub App](https://github.com/settings/apps/new) with:
53
+
***GitHub App name**: Use something like "My Oppiabot testing App"
54
+
***Homepage URL**: Use any random URL
71
55
***Webhook URL**: Use your `WEBHOOK_PROXY_URL` from the previous step.
72
56
***Webhook Secret**: `development`
73
-
* **Permissions & events** The following permissions and events must be subscribed.If, for example, you only enable issue events, you will not be able to listen on pull request webhooks with the bot.
57
+
***Permissions & events** The following permissions and events must be subscribed.If, for example, you only enable issue events, you will not be able to listen on pull request webhooks with the bot.
7. Download the private key. It will be a `.pem` file. Move it to the root directory of the project. As long as it's in the root directory, it will be automatically detected regardless of the filename.
82
67
83
68
Make sure you remove
84
69
> PRIVATE_KEY=example_private_key
70
+
85
71
from .env file, Otherwise app will not work locally.
86
72
87
-
8. Edit `.env` and set`APP_ID` to the ID of the app you just created. The App ID can be found in your app settings page here.
73
+
8. Edit `.env` and set `APP_ID` to the ID of the app you just created and also `WEBHOOK_SECRET` to `development`. The App ID can be found in your app settings page here.
88
74
89
75
<p align="center">
90
-
<img src="images/sample-app-id.png">
76
+
<img src="images/docs/sample_app_id.png">
91
77
</p>
92
78
93
79
94
80
## Installing the bot on a repository
95
81
96
-
You'll need to identify a target repository and install the bot by clicking the **Install** button on the settings page of your app, e.g `https://github.com/apps/your-app-name`. In the `.env` file put your github account name in
97
-
`WHITELISTED_ACCOUNTS` and also add your repository (name in small caps) in the `constants.js` file locally.
82
+
You'll need to identify a target repository and install the bot by clicking the **Install** button on the settings page of your app, e.g `https://github.com/settings/apps/my-oppiabot-testing-app/installations`. In the `.env` file put your github account name in`WHITELISTED_ACCOUNTS` and also add your repository (name in small caps) in the `constants.js` file locally.
98
83
99
84
100
85
## Running the bot locally
@@ -104,12 +89,12 @@ The `dev` script will start the bot using [nodemon](https://github.com/remy/node
104
89
105
90
### Other available scripts
106
91
107
-
`$ npm start` to start the bot without watching files.
92
+
`npm start` to start the bot without watching files.
108
93
109
94
110
95
## Debugging
111
-
Always run `$ npm install` and restart the server if `package.json` has changed.
112
-
To turn on verbose logging, start server by running: `$ LOG_LEVEL=trace npm start`.
96
+
Always run `npm install` and restart the server if`package.json` has changed.
97
+
To turn on verbose logging, start server by running: `LOG_LEVEL=trace npm start`.
0 commit comments