Skip to content

PM-973 decomision connect #793

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/custom-environment-variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"whitelistedOriginsForUserIdAuth": "WHITELISTED_ORIGINS_FOR_USERID_AUTH",
"AUTH0_PROXY_SERVER_URL" : "AUTH0_PROXY_SERVER_URL",
"connectUrl": "CONNECT_URL",
"workManagerUrl": "WORK_MANAGER_URL",
"accountsAppUrl": "ACCOUNTS_APP_URL",
"inviteEmailSubject": "INVITE_EMAIL_SUBJECT",
"inviteEmailSectionTitle": "INVITE_EMAIL_SECTION_TITLE",
Expand Down
9 changes: 4 additions & 5 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"customerPaymentIndexName": "customer_payments",
"customerPaymentDocType": "doc"
},
"connectProjectUrl": "",
"dbConfig": {
"masterUrl": "postgres://coder:mysecretpassword@localhost:5432/projectsdb",
"maxPoolSize": 50,
Expand All @@ -40,8 +39,8 @@
"url": "localhost:9092"
},
"analyticsKey": "",
"VALID_ISSUERS": "[\"https:\/\/topcoder-newauth.auth0.com\/\",\"https:\/\/api.topcoder-dev.com\",\"https:\/\/topcoder-dev.auth0.com\/\"]",
"validIssuers": "[\"https:\/\/topcoder-newauth.auth0.com\/\",\"https:\/\/api.topcoder-dev.com\",\"https:\/\/topcoder-dev.auth0.com\/\"]",
"VALID_ISSUERS": "[\"https:\/\/topcoder-newauth.auth0.com\/\",\"https:\/\/api.topcoder-dev.com\",\"https:\/\/topcoder-dev.auth0.com\/\", \"https:\/\/auth.topcoder-dev.com\/\"]",
"validIssuers": "[\"https:\/\/topcoder-newauth.auth0.com\/\",\"https:\/\/api.topcoder-dev.com\",\"https:\/\/topcoder-dev.auth0.com\/\", \"https:\/\/auth.topcoder-dev.com\/\"]",
"jwksUri": "",
"busApiUrl": "http://api.topcoder-dev.com/v5",
"messageApiUrl": "http://api.topcoder-dev.com/v5",
Expand All @@ -54,7 +53,7 @@
"EMAIL_INVITE_FROM_EMAIL": "noreply@connect.topcoder.com",
"inviteEmailSubject": "You are invited to Topcoder",
"inviteEmailSectionTitle": "Project Invitation",
"connectUrl": "https://connect.topcoder-dev.com",
"workManagerUrl": "https://challenges.topcoder-dev.com",
"accountsAppUrl": "https://accounts.topcoder-dev.com",
"MAX_REVISION_NUMBER": 100,
"UNIQUE_GMAIL_VALIDATION": false,
Expand Down Expand Up @@ -87,4 +86,4 @@
},
"STRIPE_SECRET_KEY": "",
"sfdcBillingAccountNameField": "Billing_Account_name__c"
}
}
2 changes: 1 addition & 1 deletion config/development.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"pubsubQueueName": "dev.project.service",
"pubsubExchangeName": "dev.projects",
"attachmentsS3Bucket": "topcoder-dev-media",
"connectProjectsUrl": "https://connect.topcoder-dev.com/projects/",
"workManagerUrl": "https://challenges.topcoder-dev.com/",
"fileServiceEndpoint": "https://api.topcoder-dev.com/v5/files",
"memberServiceEndpoint": "https://api.topcoder-dev.com/v5/members",
"identityServiceEndpoint": "https://api.topcoder-dev.com/v3/",
Expand Down
2 changes: 1 addition & 1 deletion config/production.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"authDomain": "topcoder.com",
"connectProjectsUrl": "https://connect.topcoder.com/projects/",
"workManagerUrl": "https://challenges.topcoder.com/",
"sfdcBillingAccountNameField": "Billing_Account_name__c",
"sfdcBillingAccountMarkupField": "Mark_up__c",
"sfdcBillingAccountActiveField": "Active__c"
Expand Down
4 changes: 2 additions & 2 deletions src/events/busApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const mapEventTypes = {
* @returns {string} the connect project attachment url
*/
function connectProjectAttachmentUrl(projectId, attachmentId) {
return `${config.get('connectProjectsUrl')}${projectId}/attachments/${attachmentId}`;
return `${config.get('workManagerUrl')}projects/${projectId}/attachments/${attachmentId}`;
}

/**
Expand All @@ -48,7 +48,7 @@ function connectProjectAttachmentUrl(projectId, attachmentId) {
* @returns {string} the connect project url
*/
function connectProjectUrl(projectId) {
return `${config.get('connectProjectsUrl')}${projectId}`;
return `${config.get('workManagerUrl')}projects/${projectId}`;
}

module.exports = (app, logger) => {
Expand Down
6 changes: 3 additions & 3 deletions src/events/timelines/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const eClient = util.getElasticSearchClient();
* @param {string|number} projectId the project id
* @returns {string} the connect project url
*/
function connectProjectUrl(projectId) {
return `${config.get('connectProjectsUrl')}${projectId}`;
function wmProjectUrl(projectId) {
return `${config.get('workManagerUrl')}projects/${projectId}`;
}

/**
Expand Down Expand Up @@ -169,7 +169,7 @@ async function timelineAdjustedKafkaHandler(app, topic, payload) {
createEvent(BUS_API_EVENT.PROJECT_PLAN_UPDATED, {
projectId: project.id,
projectName: project.name,
projectUrl: connectProjectUrl(project.id),
projectUrl: wmProjectUrl(project.id),
userId: payload.userId,
initiatorUserId: payload.userId,
}, app.logger);
Expand Down
4 changes: 2 additions & 2 deletions src/routes/projectMemberInvites/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ const buildCreateInvitePromises = (req, inviteEmails, inviteUserIds, invites, da
};

const sendInviteEmail = (req, projectId, invite) => {
req.log.debug(`Sending invite email: ${JSON.stringify(req)}, ${projectId}, ${JSON.stringify(invite)}`)
req.log.debug(`Sending invite email: ${JSON.stringify(req.body)}, ${projectId}, ${JSON.stringify(invite)}`)
req.log.debug(req.authUser);
const emailEventType = CONNECT_NOTIFICATION_EVENT.PROJECT_MEMBER_EMAIL_INVITE_CREATED;
const promises = [
Expand All @@ -219,7 +219,7 @@ const sendInviteEmail = (req, projectId, invite) => {
};
createEvent(emailEventType, {
data: {
connectURL: config.get('connectUrl'),
workManagerUrl: config.get('workManagerUrl'),
accountsAppURL: config.get('accountsAppUrl'),
subject: config.get('inviteEmailSubject'),
projects: [{
Expand Down