Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit a6bdc75

Browse files
committed
Remove Circle CI stuff so it doesn’t get confusing for devops. Also add configuration documentation to aid in production deploys and setup.
1 parent 0824a3d commit a6bdc75

File tree

6 files changed

+61
-206
lines changed

6 files changed

+61
-206
lines changed

.circleci/circle.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,7 @@ npm run lint
2525

2626
## Configuration
2727

28-
The following config parameters are supported, they are defined in `config/default.js` and can be configured in system environment:
29-
30-
31-
| Name | Description | Default |
32-
| :----------------------------- | :----------------------------------------: | :------------------------------: |
33-
| PORT | the port the application will listen on | 3000 |
34-
| LOG_LEVEL | the log level | info |
35-
| TOPIC | the kafka subscribe topic name | tc-x-events |
36-
| KAFKA_OPTIONS | the connection option for kafka | see below about KAFKA options |
37-
| MONGODB_URL | the MongoDB URL which must be same as Topcoder x tool | mongodb://127.0.0.1:27017/topcoderx|
38-
39-
KAFKA_OPTIONS should be object as described in https://github.com/SOHU-Co/kafka-node#kafkaclient
40-
For using with SSL, the options should be as
41-
```
42-
{
43-
kafkaHost: '<server>',
44-
sslOptions: {
45-
cert: '<certificate>',
46-
key: '<key>'
47-
}
48-
}
49-
```
28+
See "configuration.md"
5029

5130
`config/local.js` will not tracked by git.
5231

@@ -63,8 +42,6 @@ use `ngrok` to make your local deploy accessible by internet:
6342
ngrok http 3002
6443
```
6544

66-
Copy the forwarding URL to set in `HOOK_BASE_URL` of topcoder-x in config.json
67-
6845
## Setup for verification
6946
Before verifying the tool, 3 service needs be configured and run them
7047
- processor
@@ -101,4 +78,4 @@ Now, receiver service can receive the webhooks from git host's project. Now you
10178
- add/remove a label to an issue, you can see the logs in `receiver` and `processor`, the `issue.labelUpdated` event is generated.
10279
- create a pull request, you can see the logs in `receiver` and `processor`, the `pull_request.created` event is generated.
10380
- close a pull request without merge, you can see the logs in `receiver` and `processor`, the `pull_request.closed` event is generated and the `merged` property is `false`.
104-
- merge a pull request, you can see the logs in `receiver` and `processor`, the `pull_request.closed` event is generated and the `merged` property is `true`.
81+
- merge a pull request, you can see the logs in `receiver` and `processor`, the `pull_request.closed` event is generated and the `merged` property is `true`.

buildvar.conf

Lines changed: 0 additions & 10 deletions
This file was deleted.

configuration.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Topcoder x receiver configuration
2+
The following config parameters are supported, they are defined in `config/default.js` and can be configured in env variables:
3+
4+
5+
| Name | Description | Default |
6+
| :------------------------------------- | :----------------------------------------: | :------------------------------: |
7+
| PORT | The port the application will listen on | 3002 |
8+
| LOG_LEVEL | The log level | info |
9+
| MONGODB_URI | The MongoDB URI. This needs to be the same MongoDB used by topcoder-x-receiver, topcoder-x-processor, and topcoder-x-site | mongodb://127.0.0.1:27017/topcoderx |
10+
|TOPIC | The Kafka topic where events are published. This must be the same as the configured value for topcoder-x-processor| |
11+
|KAFKA_OPTIONS | Kafka connection options| |
12+
|KAFKA_HOST | The Kafka host to connect to| localhost:9092 |
13+
|KAFKA_CLIENT_CERT | The Kafka SSL certificate to use when connecting| Read from kafka_client.cer file, but this can be set as a string like it is on Heroku |
14+
|KAFKA_CLIENT_CERT_KEY | The Kafka SSL certificate key to use when connecting| Read from kafka_client.key file, but this can be set as a string like it is on Heroku|
15+
16+
KAFKA_OPTIONS should be object as described in https://github.com/SOHU-Co/kafka-node#kafkaclient
17+
For using with SSL, the options should be as
18+
```
19+
{
20+
kafkaHost: '<server>',
21+
sslOptions: {
22+
cert: '<certificate>',
23+
key: '<key>'
24+
}
25+
}
26+
```
27+
28+
## Endpoints
29+
30+
- POST /webhooks/github - The webhook handler for github
31+
- POST /webhooks/gitlab - The webhook handler for gitlab
32+
33+
## Github Verification
34+
35+
#### Webhook configuration
36+
37+
Configure a Github project with a webhook with a format like this: https://<receiver URL>:<receiver port>/webhooks/github
38+
39+
#### Smoke test
40+
- Create an issue in the repo, you can see the logs in `receiver`, the `issue.created` event is generated.
41+
42+
You can test other events, but just validating that an issue.created event is generated in Kafka is enough to smoke test the receiver is set up properly.
43+
44+
#### Debugging
45+
You can re-run and debug the responses to webhook requests on Github, in the configuration for the webhook. This can be useful if things aren't coming through properly in the receiver.
46+
47+
## Github Verification
48+
49+
#### Webhook configuration
50+
51+
Configure a Gitlab project with a webhook with a format like this: https://<receiver URL>:<receiver port>/webhooks/gitlab
52+
53+
#### Smoke test
54+
- Create an issue in the repo, you can see the logs in `receiver`, the `issue.created` event is generated.
55+
56+
You can test other events, but just validating that an issue.created event is generated in Kafka is enough to smoke test the receiver is set up properly.
57+
58+
#### Debugging
59+
You can re-run and debug the responses to webhook requests on Gitlab, in the configuration for the webhook. This can be useful if things aren't coming through properly in the receiver.

container.template

Lines changed: 0 additions & 80 deletions
This file was deleted.

templateupdate.sh

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)