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

Commit e6f4fe4

Browse files
author
James Cori
committed
Merge branch 'develop'
2 parents 73259a2 + 627f385 commit e6f4fe4

File tree

5 files changed

+6
-23
lines changed

5 files changed

+6
-23
lines changed

README.md

-5
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ The following config parameters are supported, they are defined in `config/defau
2929
| TOPIC | the kafka subscribe topic name | tc-x-events |
3030
| PARTITION | the kafka partition | 0|
3131
| KAFKA_OPTIONS | the connection option for kafka | see below about KAFKA options |
32-
|TC_DEV_ENV| the flag whether to use topcoder development api or production| false|
33-
| TC_AUTHN_URL | the Topcoder authentication url | https://topcoder-dev.auth0.com/oauth/ro |
34-
| TC_AUTHZ_URL | the Topcoder authorization url | https://api.topcoder-dev.com/v3/authorizations |
3532
| NEW_CHALLENGE_TEMPLATE | the body template for new challenge request. You can change the subTrack, reviewTypes, technologies, .. here | see `default.js` |
3633
| NEW_CHALLENGE_DURATION_IN_DAYS | the duration of new challenge | 5 |
3734
|TC_URL| the base URL of topcoder to get the challenge URL| defaults to `https://www.topcoder-dev.com`|
@@ -40,7 +37,6 @@ The following config parameters are supported, they are defined in `config/defau
4037
|FIX_ACCEPTED_ISSUE_LABEL|the label name for fix accepted, should be one of the label configured in topcoder x ui|'tcx_FixAccepted'|
4138
|ASSIGNED_ISSUE_LABEL| the label name for assigned, should be one of the label configured in topcoder x ui| 'tcx_Assigned'|
4239
|OPEN_FOR_PICKUP_ISSUE_LABEL| the label name for open for pickup, should be one of the label configured in topcoder x ui| 'tcx_OpenForPickup'|
43-
|TC_OR_DETAIL_LINK|the link to online review detail of challenge| see `default.js`, OR link for dev environment|
4440
|RETRY_COUNT| the number of times an event should be retried to process| 3|
4541
|RETRY_INTERVAL| the interval at which the event should be retried to process in milliseconds | 120000|
4642
|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'|
@@ -58,7 +54,6 @@ The following config parameters are supported, they are defined in `config/defau
5854
|TYPE_ID_TASK| The registered type id of a task ||
5955
|DEFAULT_TIMELINE_TEMPLATE_ID| The default timeline template id ||
6056
|TC_API_URL| The topcoder backend API url |`https://api.topcoder-dev.com/v5`|
61-
|TC_API_URL_V3| The topcoder backend API url V3 |`https://api.topcoder-dev.com/v3`|
6257

6358
KAFKA_OPTIONS should be object as described in https://github.com/oleksiyk/kafka#ssl
6459
For using with SSL, the options should be as

config/default.js

-8
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ module.exports = {
2525
passphrase: 'secret', // NOTE:* This configuration specifies the private key passphrase used while creating it.
2626
}
2727
},
28-
TC_DEV_ENV: process.env.NODE_ENV === 'production' ? false : true,
29-
TC_AUTHN_URL: process.env.TC_AUTHN_URL || 'https://topcoder-dev.auth0.com/oauth/ro',
30-
TC_AUTHZ_URL: process.env.TC_AUTHZ_URL || 'https://api.topcoder-dev.com/v3/authorizations',
31-
TC_DIRECT_ID: 7377,
3228
NEW_CHALLENGE_TEMPLATE: process.env.NEW_CHALLENGE_TEMPLATE || {
3329
status: 'Draft'
3430
},
@@ -38,7 +34,6 @@ module.exports = {
3834
NEW_CHALLENGE_DURATION_IN_DAYS: process.env.NEW_CHALLENGE_DURATION_IN_DAYS || 5,
3935
TC_URL: process.env.TC_URL || 'https://www.topcoder-dev.com',
4036
TC_API_URL: process.env.TC_API_URL || 'https://api.topcoder-dev.com/v5',
41-
TC_API_URL_V3: process.env.TC_API_URL_V3 || 'https://api.topcoder-dev.com/v3',
4237
GITLAB_API_BASE_URL: process.env.GITLAB_API_BASE_URL || 'https://gitlab.com',
4338
ISSUE_LABEL_PREFIX: process.env.ISSUE_LABEL_PREFIX || 'tcx_',
4439
PAID_ISSUE_LABEL: process.env.PAID_ISSUE_LABEL || 'tcx_Paid',
@@ -48,10 +43,8 @@ module.exports = {
4843
OPEN_FOR_PICKUP_ISSUE_LABEL: process.env.READY_FOR_REVIEW_ISSUE_LABEL || 'tcx_OpenForPickup',
4944
NOT_READY_ISSUE_LABEL: process.env.NOT_READY_ISSUE_LABEL || 'tcx_NotReady',
5045
CANCELED_ISSUE_LABEL: process.env.CANCELED_ISSUE_LABEL || 'tcx_Canceled',
51-
TC_OR_DETAIL_LINK: process.env.TC_OR_DETAIL_LINK || 'https://software.topcoder-dev.com/review/actions/ViewProjectDetails?pid=',
5246
RETRY_COUNT: process.env.RETRY_COUNT || 2,
5347
RETRY_INTERVAL: process.env.RETRY_INTERVAL || 120000, // 2 minutes
54-
CANCEL_CHALLENGE_INTERVAL: process.env.CANCEL_CHALLENGE_INTERVAL || 24 * 60 * 60 * 1000, // 24 Hours
5548
DYNAMODB: {
5649
AWS_ACCESS_KEY_ID: process.env.AWS_ACCESS_KEY_ID,
5750
AWS_SECRET_ACCESS_KEY: process.env.AWS_SECRET_ACCESS_KEY,
@@ -68,7 +61,6 @@ module.exports = {
6861
GRANT_TYPE: 'client_credentials',
6962

7063
// used as base to construct various URLs
71-
WEBSITE: process.env.WEBSITE || 'http://topcoderx.topcoder-dev.com',
7264
WEBSITE_SECURE: process.env.WEBSITE_SECURE || 'https://topcoderx.topcoder-dev.com',
7365

7466
ROLE_ID_COPILOT: process.env.ROLE_ID_COPILOT || 'cfe12b3f-2a24-4639-9d8b-ec86726f76bd',

configuration.md

-6
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ The following config parameters are supported, they are defined in `config/defau
1212
|KAFKA_GROUP_ID | The Kafka group id name| topcoder-x-processor |
1313
|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 |
1414
|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-
|TC_DEV_ENV| the flag whether to use topcoder development api or production| false|
16-
| TC_AUTHN_URL | the Topcoder authentication url | https://topcoder-dev.auth0.com/oauth/ro |
17-
| TC_AUTHZ_URL | the Topcoder authorization url | https://api.topcoder-dev.com/v3/authorizations |
1815
| NEW_CHALLENGE_TEMPLATE | the body template for new challenge request. You can change the subTrack, reviewTypes, technologies, .. here | see `default.js` |
1916
| NEW_CHALLENGE_DURATION_IN_DAYS | the duration of new challenge | 5 |
2017
|TC_URL| the base URL of topcoder to get the challenge URL| defaults to `https://www.topcoder-dev.com`|
@@ -23,13 +20,11 @@ The following config parameters are supported, they are defined in `config/defau
2320
|FIX_ACCEPTED_ISSUE_LABEL|the label name for fix accepted, should be one of the label configured in topcoder x ui|'tcx_FixAccepted'|
2421
|ASSIGNED_ISSUE_LABEL| the label name for assigned, should be one of the label configured in topcoder x ui| 'tcx_Assigned'|
2522
|OPEN_FOR_PICKUP_ISSUE_LABEL| the label name for open for pickup, should be one of the label configured in topcoder x ui| 'tcx_OpenForPickup'|
26-
|TC_OR_DETAIL_LINK|the link to online review detail of challenge| see `default.js`, OR link for dev environment|
2723
|RETRY_COUNT| the number of times an event should be retried to process| 3|
2824
|RETRY_INTERVAL| the interval at which the event should be retried to process in milliseconds | 120000|
2925
|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'|
3026
|NOT_READY_ISSUE_LABEL| the label name for not ready, should be one of the label configured in topcoder x ui|'tcx_NotReady'|
3127
|CANCELED_ISSUE_LABEL| the label name for canceled, should be one of the label configured in topcoder x ui|'tcx_Canceled'|
32-
|CANCEL_CHALLENGE_INTERVAL| the time in millisecond after which the challenge will be closed| '24*60*60*1000'|
3328
|AWS_ACCESS_KEY_ID | The Amazon certificate key to use when connecting. Use local dynamodb you can set fake value|FAKE_ACCESS_KEY_ID |
3429
|AWS_SECRET_ACCESS_KEY | The Amazon certificate access key to use when connecting. Use local dynamodb you can set fake value|FAKE_SECRET_ACCESS_KEY |
3530
|AWS_REGION | The Amazon certificate region to use when connecting. Use local dynamodb you can set fake value|FAKE_REGION |
@@ -44,7 +39,6 @@ The following config parameters are supported, they are defined in `config/defau
4439
|TYPE_ID_TASK| The registered type id of a task ||
4540
|DEFAULT_TIMELINE_TEMPLATE_ID| The default timeline template id ||
4641
|TC_API_URL| The topcoder backend API url |`https://api.topcoder-dev.com/v5`|
47-
|TC_API_URL_V3| The topcoder backend API url V3 |`https://api.topcoder-dev.com/v3`|
4842
|DEFAULT_TRACK_ID| The default track id ||
4943

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

services/IssueService.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ async function ensureChallengeExists(event, issue, create = true) {
109109
async function getProjectDetail(event) {
110110
const fullRepoUrl = gitHelper.getFullRepoUrl(event);
111111
const project = await dbHelper.scanOne(models.Project, {
112-
repoUrl: fullRepoUrl
112+
repoUrl: fullRepoUrl,
113+
archived: 'false'
113114
});
114115

115116
return project;
@@ -860,7 +861,8 @@ async function process(event) {
860861
event.data.repository.repoUrl = fullRepoUrl;
861862

862863
const project = await dbHelper.scanOne(models.Project, {
863-
repoUrl: fullRepoUrl
864+
repoUrl: fullRepoUrl,
865+
archived: 'false'
864866
});
865867

866868
issue.projectId = project.id;

utils/topcoder-api-helper.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,10 @@ async function getProjectBillingAccountId(id) {
266266
*/
267267
async function getTopcoderMemberId(handle) {
268268
try {
269-
const response = await axios.get(`${config.TC_API_URL_V3}/members/${handle}`);
269+
const response = await axios.get(`${config.TC_API_URL}/members/${handle}`);
270270
const statusCode = response ? response.status : null;
271271
loggerFile.info(`EndPoint: GET members/${handle}, GET parameters: null, Status Code:${statusCode}, Response:${circularJSON.stringify(response.data)}`);
272-
return _.get(response, 'data.result.content.userId');
272+
return _.get(response, 'data.userId');
273273
} catch (err) {
274274
loggerFile.info(`EndPoint: GET members/${handle}, GET parameters: null, Status Code:null,
275275
Error: 'Failed to get topcoder member id.', Details: ${circularJSON.stringify(err)}`);

0 commit comments

Comments
 (0)