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
{{ message }}
This repository was archived by the owner on Mar 13, 2025. It is now read-only.
| PORT | the port the application will listen on | 3000 |
34
34
| LOG_LEVEL | the log level | info |
35
-
| TOPIC | the kafka subscribe topic name | events_topic |
35
+
| TOPIC | the kafka subscribe topic name | tc-x-events |
36
+
| WEBHOOK_SECRET_TOKEN | the webhook security token for githost, it must be same as `WEBHOOK_SECRET_TOKEN` configured for Topcoder-X-backend|`ka75hsrq65cFEr61Hd4x`|
36
37
|KAFKA_OPTIONS | the connection option for kafka | see below about KAFKA options |
37
-
| GITHUB_SECRET_TOKEN | the webhook security token for github ||
38
-
| GITLAB_SECRET_TOKEN | the webhook security token for gitlab ||
39
-
| WATCH_REPOS | the repos we want to watch ||
38
+
| MONGODB_URL | the MongoDB URL which must be same as Ragnar tool | mongodb://127.0.0.1:27017/ragnar|
40
39
41
40
KAFKA_OPTIONS should be object as described in https://github.com/SOHU-Co/kafka-node#kafkaclient
42
41
For using with SSL, the options should be as
@@ -50,71 +49,41 @@ For using with SSL, the options should be as
50
49
}
51
50
```
52
51
53
-
To change the WATCH_REPOS, you'd better create a `config/local.js` file to override the WATCH_REPOS, see `config/sample-local.js` for example.
54
-
55
52
`config/local.js` will not tracked by git.
56
53
57
-
Normally you just need config the GITHUB_SECRET_TOKEN and GITLAB_SECRET_TOKEN (optional in this challenge):
54
+
## Local Setup
58
55
59
56
```shell
60
-
export GITHUB_SECRET_TOKEN=...
61
-
export GITLAB_SECRET_TOKEN=...
57
+
npm start
62
58
```
63
59
64
-
Or on windows:
60
+
Server should be started at port 3002.
65
61
62
+
use `ngrok` to make your local deploy accessible by internet:
66
63
```shell
67
-
set GITHUB_SECRET_TOKEN=...
68
-
set GITLAB_SECRET_TOKEN=...
64
+
ngrok http 3002
69
65
```
70
66
67
+
Copy the forwarding URL to set in `HOOK_BASE_URL` of topcoder-x-ui in config.json
71
68
72
-
## GitHub Webhook Setup
69
+
## Setup for verification
70
+
Before verifying the tool, 4 service needs be configured and run them
71
+
- processor
72
+
- receiver
73
+
- Ragnar Tool
74
+
- Topcoder X (both backend and UI)
73
75
74
-
- login into github.com
75
-
- go to the repository you want to watch
76
-
- click: Settings -> Options(in the left panel) -> Webhooks
for example: `https://4bb6c860.ngrok.io/webhooks/github`
81
-
- Content Type: application/json
82
-
- Secret: type your secret and remember it to set into GITHUB_SECRET_TOKEN
83
-
- Check: Send me everything
84
-
- Check: Active
85
-
- click: 'Add Webhook' button
76
+
First login in Ragnar tool with admin and Add owner for which requires topcoder handle, git host's username and type of git host.
86
77
87
-
## GitLab Webhook Setup (optional for this challenge)
78
+
Go to Topcoder X UI login with above used topcoder username and
79
+
- go to settings and make sure git hosts are correctly setup, if not click setup and authorize to setup.
88
80
89
-
- login into gitlab.com
90
-
- go to the repository you want to watch
91
-
- click: Settings -> Integrations
92
-
- fill the form:
93
-
- URL: `https://<YOUR_HOST>/webhooks/gitlab`,
94
-
for example: `https://4bb6c860.ngrok.io/webhooks/gitlab`
95
-
- Secret Token: type your secret and remember it to set into GITLAB_SECRET_TOKEN
96
-
- Trigger: Check all the events
97
-
- Check: Enable SSL Verifications
98
-
- click: 'Add Webhook' button
81
+
- Go to Topcoder X UI and go to project management and add a project from git account and click save, and edit the same project and click 'Add Webhooks' button (you need to add personnel access token), verify that webhooks are set up correctly on git host's project.
99
82
100
-
101
-
## Local Setup
102
-
103
-
```shell
104
-
npm start
105
-
```
106
-
107
-
Server should be started at port 3000.
108
-
109
-
use `ngrok` to make your local deploy accessible by internet:
110
-
```shell
111
-
ngrok http 3000
112
-
```
83
+
Now, receiver service can receive the webhooks from git host's project. Now you can verify this service by following the verfication steps below
113
84
114
85
## GitHub Verification
115
86
116
-
- properly config and run the `receiver` app.
117
-
- properly config and run the `processor` app.
118
87
- create an issue in the repo, you can see the logs in `receiver` and `processor`, the `issue.created` event is generated.
119
88
- update an issue in the repo, you can see the logs in `receiver` and `processor`, the `issue.updated` event is generated.
120
89
- create a comment on an issue, you can see the logs in `receiver` and `processor`, the `comment.created` event is generated.
@@ -128,8 +97,6 @@ ngrok http 3000
128
97
129
98
## Gitlab Verification
130
99
131
-
- properly config and run the `receiver` app.
132
-
- properly config and run the `processor` app.
133
100
- create an issue in the repo, you can see the logs in `receiver` and `processor`, the `issue.created` event is generated.
134
101
- update an issue in the repo, you can see the logs in `receiver` and `processor`, the `issue.updated` event is generated.
135
102
- create a comment on an issue, you can see the logs in `receiver` and `processor`, the `comment.created` event is generated.
0 commit comments