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

Commit 1cec9d9

Browse files
committed
Merge branch 'develop' of github.com:topcoder-platform/topcoder-x-receiver into develop
# Conflicts: # config/default.js
2 parents 2bf3e7d + 57a1a07 commit 1cec9d9

File tree

7 files changed

+21
-4
lines changed

7 files changed

+21
-4
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ npm-debug.log
3131

3232
/config/local.js
3333
.DS_Store
34+
35+
package-lock.json

app.js

+14
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ const express = require('express');
1212
const logger = require('morgan');
1313
const cookieParser = require('cookie-parser');
1414
const bodyParser = require('body-parser');
15+
const healthcheck = require('topcoder-healthcheck-dropin');
16+
17+
/**
18+
* Method to check the service status
19+
* @returns {Object} The returned status
20+
*/
21+
function check() {
22+
// No checks to run. The output of this itself is an indication that the app is actively running
23+
return {
24+
checksRun: 1
25+
};
26+
}
1527

1628
const webhooks = require('./routes/webhooks');
1729

@@ -26,6 +38,8 @@ app.use(bodyParser.json({
2638
app.use(bodyParser.urlencoded({extended: false}));
2739
app.use(cookieParser());
2840

41+
app.use(healthcheck.middleware([check]));
42+
2943
app.use('/webhooks', webhooks);
3044

3145
// catch 404 and forward to error handler

build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ AWS_REPOSITORY=$(eval "echo \$${ENV}_AWS_REPOSITORY")
2525
#App variables
2626
KAFKA_CLIENT_CERT=$(eval "echo \$${ENV}_KAFKA_CLIENT_CERT")
2727
KAFKA_CLIENT_CERT_KEY=$(eval "echo \$${ENV}_KAFKA_CLIENT_CERT_KEY")
28-
KAFKA_HOST=$(eval "echo \$${ENV}_KAFKA_URL")
28+
KAFKA_URL=$(eval "echo \$${ENV}_KAFKA_URL")
2929
ZOO_KEEPER=$(eval "echo \$${ENV}_ZOO_KEEPER")
3030
TOPIC=$(eval "echo \$${ENV}_TOPIC")
3131
MONGODB_URI=$(eval "echo \$${ENV}_MONGODB_URI")

config/default.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = {
1818
LOG_LEVEL: process.env.LOG_LEVEL || 'info',
1919
TOPIC: process.env.TOPIC || 'tc-x-events',
2020
KAFKA_OPTIONS: {
21-
connectionString: process.env.KAFKA_HOST || 'localhost:9092',
21+
connectionString: process.env.KAFKA_URL || 'localhost:9092',
2222
ssl: {
2323
cert: process.env.KAFKA_CLIENT_CERT || fs.readFileSync('./kafka_client.cer'), // eslint-disable-line no-sync
2424
key: process.env.KAFKA_CLIENT_CERT_KEY || fs.readFileSync('./kafka_client.key') // eslint-disable-line no-sync

configuration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The following config parameters are supported, they are defined in `config/defau
88
| LOG_LEVEL | The log level | info |
99
|TOPIC | The Kafka topic where events are published. This must be the same as the configured value for topcoder-x-processor| |
1010
|KAFKA_OPTIONS | Kafka connection options| |
11-
|KAFKA_HOST | The Kafka host to connect to| localhost:9092 |
11+
|KAFKA_URL | The Kafka host to connect to| localhost:9092 |
1212
|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 |
1313
|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|
1414
|AWS_ACCESS_KEY_ID | The Amazon certificate key to use when connecting. Use local dynamodb you can set fake value|FAKE_ACCESS_KEY_ID |

models/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ module.exports = {
5050
PullRequestCreatedEvent,
5151
PullRequestClosedEvent,
5252
LabelUpdatedEvent,
53-
Project: dynamoose.model('Project', Project),
53+
Project: dynamoose.model('Topcoder_X.Project', Project),
5454
IssueClosedEvent
5555
};

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"joi": "^11.4.0",
2020
"morgan": "~1.8.1",
2121
"no-kafka": "^3.2.10",
22+
"topcoder-healthcheck-dropin": "^1.0.3",
2223
"winston": "^2.4.2"
2324
},
2425
"devDependencies": {

0 commit comments

Comments
 (0)