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

File tree

6 files changed

+609
-547
lines changed

6 files changed

+609
-547
lines changed

config/default.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ module.exports = {
8686
READY_FOR_REVIEW_ISSUE_LABEL: process.env.READY_FOR_REVIEW_ISSUE_LABEL || 'tcx_ReadyForReview',
8787
ASSIGNED_ISSUE_LABEL: process.env.READY_FOR_REVIEW_ISSUE_LABEL || 'tcx_Assigned',
8888
OPEN_FOR_PICKUP_ISSUE_LABEL: process.env.READY_FOR_REVIEW_ISSUE_LABEL || 'tcx_OpenForPickup',
89+
NOT_READY_ISSUE_LABEL: process.env.NOT_READY_ISSUE_LABEL || 'Not Ready',
8990
TC_OR_DETAIL_LINK: process.env.TC_OR_DETAIL_LINK || 'https://software.topcoder-dev.com/review/actions/ViewProjectDetails?pid=',
90-
RETRY_COUNT: process.env.RETRY_COUNT || 3,
91+
RETRY_COUNT: process.env.RETRY_COUNT || 2,
9192
RETRY_INTERVAL: process.env.RETRY_INTERVAL || 120000, // 2 minutes
92-
CANCEL_CHALLENGE_INTERVAL: process.env.CANCEL_CHALLENGE_INTERVAL || 20 * 1000,
93+
CANCEL_CHALLENGE_INTERVAL: process.env.CANCEL_CHALLENGE_INTERVAL || 24 * 60 * 60 * 1000, // 24 Hours
9394
};

configuration.md

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ The following config parameters are supported, they are defined in `config/defau
3131
|RETRY_COUNT| the number of times an event should be retried to process| 3|
3232
|RETRY_INTERVAL| the interval at which the event should be retried to process in milliseconds | 120000|
3333
|READY_FOR_REVIEW_ISSUE_LABEL| the label name for ready for review, should be one of the label configured in topcoder x ui|'tcx_ReadyForReview'|
34+
|NOT_READY_ISSUE_LABEL| the label name for not ready, should be one of the label configured in topcoder x ui|
35+
'Not Ready'|
3436
|CANCEL_CHALLENGE_INTERVAL| the time in millisecond after which the challenge will be closed| '24*60*60*1000'|
3537

3638
KAFKA_OPTIONS should be object as described in https://github.com/oleksiyk/kafka#ssl

models/Issue.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,29 @@ const mongoose = require('mongoose');
1212

1313
const schema = new mongoose.Schema({
1414
// From the receiver service
15-
number: {type: Number, required: true},
16-
title: {type: String, required: true},
15+
number: { type: Number, required: true },
16+
title: { type: String, required: true },
1717
body: String,
18-
prizes: [{type: Number, required: true}], // extracted from title
19-
provider: {type: String, required: true}, // github or gitlab
20-
repositoryId: {type: Number, required: true},
21-
labels: [{type: String, required: true}],
22-
assignee: {type: String, required: false},
18+
prizes: [{ type: Number, required: true }], // extracted from title
19+
provider: { type: String, required: true }, // github or gitlab
20+
repositoryId: { type: Number, required: true },
21+
labels: [{ type: String, required: true }],
22+
assignee: { type: String, required: false },
2323
updatedAt: {
2424
type: Date,
2525
default: Date.now
2626
},
2727
// From topcoder api
28-
challengeId: {type: Number, required: false, unique: true, sparse: true},
29-
projectId: {type: mongoose.Schema.Types.ObjectId, ref: 'Project'},
30-
status: {type: String},
31-
assignedAt: {type: Date, required: false}
28+
challengeId: { type: Number, required: false, unique: true, sparse: true },
29+
projectId: { type: mongoose.Schema.Types.ObjectId, ref: 'Project' },
30+
status: { type: String },
31+
assignedAt: { type: Date, required: false }
3232
});
3333

3434
// Issue number, provider, repositoryId must be unique
35-
schema.index({number: 1, provider: 1, repositoryId: 1}, {unique: true});
36-
schema.index({labels: 1});
37-
schema.index({projectId: 1});
35+
schema.index({ number: 1, provider: 1, repositoryId: 1 }, { unique: true });
36+
schema.index({ labels: 1 });
37+
schema.index({ projectId: 1 });
3838

3939
schema.pre('save', function preSave(next) {
4040
this.updatedAt = Date.now(); // eslint-disable-line

0 commit comments

Comments
 (0)