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
2.`GITHUB_TOKEN`: This is a token needed for Triagebot to send requests to GitHub. Go to GitHub Settings > Developer Settings > Personal Access Token, and create a new token. The `repo` permission should be sufficient.
44
-
If this is not set, Triagebot will also look in `~/.gitconfig` in the `github.oauth-token` setting.
45
-
3.`DATABASE_URL`: This is the URL to the database. See [Configuring a database](#configuring-a-database).
46
-
4.`GITHUB_WEBHOOK_SECRET`: Enter the secret you entered in the webhook above.
47
-
5.`RUST_LOG`: Set this to `debug`.
42
+
1. Copy `.env.sample` to `.env`
43
+
2.`GITHUB_TOKEN`: This is a token needed for Triagebot to send requests to GitHub. Go to GitHub Settings > Developer Settings > Personal Access Token, and create a new token. The `repo` permission should be sufficient.
44
+
If this is not set, Triagebot will also look in `~/.gitconfig` in the `github.oauth-token` setting.
45
+
3.`DATABASE_URL`: This is the URL to the database. See [Configuring a database](#configuring-a-database).
46
+
4.`GITHUB_WEBHOOK_SECRET`: Enter the secret you entered in the webhook above.
47
+
5.`RUST_LOG`: Set this to `debug`.
48
48
49
49
5. Run `cargo run --bin triagebot`. This starts the http server listening for webhooks on port 8000.
50
50
6. Add a `triagebot.toml` file to the main branch of your GitHub repo with whichever services you want to try out.
@@ -109,15 +109,28 @@ You need to sign up for a free account, and also deal with configuring the GitHu
109
109
3. Configure GitHub webhooks in the test repo you created.
110
110
In short:
111
111
112
-
1. Go to the settings page for your GitHub repo.
113
-
2. Go to the webhook section.
114
-
3. Click "Add webhook"
115
-
4. Include the settings:
112
+
1. Go to the settings page for your GitHub repo.
113
+
2. Go to the webhook section.
114
+
3. Click "Add webhook"
115
+
4. Include the settings:
116
116
117
-
* Payload URL: This is the URL to your Triagebot server, for example http://7e9ea9dc.ngrok.io/github-hook. This URL is displayed when you ran the `ngrok` command above.
118
-
* Content type: application/json
119
-
* Secret: Enter a shared secret (some longish random text)
120
-
* Events: "Send me everything"
117
+
* Payload URL: This is the URL to your Triagebot server, for example http://7e9ea9dc.ngrok.io/github-hook. This URL is displayed when you ran the `ngrok` command above.
118
+
* Content type: application/json
119
+
* Secret: Enter a shared secret (some longish random text)
120
+
* Events: "Send me everything"
121
+
122
+
### Cargo tests
123
+
124
+
You can run Cargo tests using `cargo test`. If you also want to run tests that access a Postgres database, you can specify an environment variables `TEST_DB_URL`, which should contain a connection string pointing to a running Postgres database instance:
125
+
126
+
```bash
127
+
$ docker run --rm -it -p5432:5432 \
128
+
-e POSTGRES_USER=triagebot \
129
+
-e POSTGRES_PASSWORD=triagebot \
130
+
-e POSTGRES_DB=triagebot \
131
+
postgres:14
132
+
$ TEST_DB_URL=postgres://triagebot:triagebot@localhost:5432/triagebot cargo test
0 commit comments