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

Commit 0900828

Browse files
committed
Merge branch 'develop'
2 parents 0361e09 + 60541c4 commit 0900828

12 files changed

+740
-33
lines changed

config/default.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ module.exports = {
3131
RESOURCES_API_URL: process.env.RESOURCES_API_URL || 'https://api.topcoder-dev.com/v5/resources',
3232
GROUPS_API_URL: process.env.GROUPS_API_URL || 'https://api.topcoder-dev.com/v5/groups',
3333
TERMS_API_URL: process.env.TERMS_API_URL || 'https://api.topcoder-dev.com/v5/terms',
34+
V4_CHALLENGE_API_URL: process.env.V4_CHALLENGE_API_URL || 'https://api.topcoder-dev.com/v4/challenges',
35+
V3_MEMBER_API_URL: process.env.V3_MEMBER_API_URL || 'https://api.topcoder-dev.com/v3/members',
36+
V4_ES_FEEDER_API_URL: process.env.V4_ES_FEEDER_API_URL || 'https://api.topcoder-dev.com/v4/esfeeder/challenges',
37+
FORCE_ES_FEEDER: process.env.FORCE_ES_FEEDER ? process.env.FORCE_ES_FEEDER === 'true' : false,
3438
CREATED_DATE_BEGIN: process.env.CREATED_DATE_BEGIN,
3539
POPULATE_MIGRATION_TABLE_DATE_BEGIN: process.env.POPULATE_MIGRATION_TABLE_DATE_BEGIN || process.env.CREATED_DATE_BEGIN || new Date(),
3640

@@ -204,6 +208,8 @@ module.exports = {
204208
SUCCESS: 'Success'
205209
},
206210

211+
MM_DIRECT_PROJECT_ID: process.env.MM_DIRECT_PROJECT_ID || 23650,
212+
MM_CONNECT_PROJECT_ID: process.env.MM_CONNECT_PROJECT_ID || 16612,
207213
SUBMITTER_ROLE_ID: process.env.SUBMITTER_ROLE_ID || '732339e7-8e30-49d7-9198-cccf9451e221',
208214
SUBMISSION_TYPE: process.env.SUBMISSION_TYPE || 'Contest Submission',
209215
CHECKPOINT_SUBMISSION_TYPE: process.env.CHECKPOINT_SUBMISSION_TYPE || 'Checkpoint Submission',
@@ -219,5 +225,7 @@ module.exports = {
219225
WRITE: process.env.SCOPE_CHALLENGES_WRITE || 'write:challenges',
220226
ALL: process.env.SCOPE_CHALLENGES_ALL || 'all:challenges'
221227
}
222-
}
228+
},
229+
230+
COPILOT_PAYMENT_TYPE: process.env.COPILOT_PAYMENT_TYPE || 'copilot'
223231
}

package-lock.json

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
"bluebird": "^3.5.5",
99
"config": "^3.1.0",
1010
"cors": "^2.8.5",
11+
"csv-parser": "^2.3.3",
1112
"dynamoose": "^1.11.1",
1213
"elasticsearch": "^16.1.1",
1314
"express": "^4.17.1",
1415
"express-interceptor": "^1.2.0",
16+
"fs": "0.0.1-security",
1517
"hashmap": "^2.4.0",
1618
"http-aws-es": "^6.0.0",
1719
"informix-wrapper": "git+https://github.com/appirio-tech/informix-wrapper.git#less-logs",

src/controllers/syncController.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const config = require('config')
22
const logger = require('../util/logger')
33
// const moment = require('moment')
4-
const { slice, union, toString, toNumber } = require('lodash')
4+
const { slice, union, toString, toNumber, remove } = require('lodash')
55
const challengeSyncStatusService = require('../services/challengeSyncStatusService')
66
const challengeSyncHistoryService = require('../services/challengeSyncHistoryService')
77
const syncService = require('../services/syncService')
@@ -77,12 +77,14 @@ async function queueChallenges (filter) {
7777
// get active challenges from v4
7878
const { ids: v4IdArray } = await syncService.getV4ChallengeIds(filter)
7979
// console.log('v4', v4IdArray)
80+
// logger.debug(`v4 Array ${v4IdArray}`)
8081
// get active challenges from v5
8182
const { ids: v5IdArray } = await syncService.getV5LegacyChallengeIds(filter)
82-
// console.log('v5', v5IdArray)
83+
// logger.debug(`v5 Array ${v5IdArray}`)
8384

8485
// combine arrays, return unique
8586
const combinedArray = union(v4IdArray, v5IdArray)
87+
remove(combinedArray, n => toString(n) === 'NaN')
8688
const totalChallengesCount = combinedArray.length
8789
// console.log('union length', combinedArray.length)
8890

0 commit comments

Comments
 (0)