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

Commit 4723ef9

Browse files
committed
Preliminary Azure DevOps support
1 parent 4b6dd04 commit 4723ef9

13 files changed

+471
-21
lines changed

config/default.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ module.exports = {
6969
NEW_CHALLENGE_DURATION_IN_DAYS: process.env.NEW_CHALLENGE_DURATION_IN_DAYS || 5,
7070
TC_URL: process.env.TC_URL || 'https://www.topcoder-dev.com',
7171
GITLAB_API_BASE_URL: process.env.GITLAB_API_BASE_URL || 'https://gitlab.com',
72+
AZURE_API_BASE_URL: process.env.AZURE_API_BASE_URL || 'https://app.vssps.visualstudio.com',
73+
AZURE_DEVOPS_API_BASE_URL: process.env.AZURE_DEVOPS_API_BASE_URL || 'https://dev.azure.com',
7274
ISSUE_LABEL_PREFIX: process.env.ISSUE_LABEL_PREFIX || 'tcx_',
7375
PAID_ISSUE_LABEL: process.env.PAID_ISSUE_LABEL || 'tcx_Paid',
7476
FIX_ACCEPTED_ISSUE_LABEL: process.env.FIX_ACCEPTED_ISSUE_LABEL || 'tcx_FixAccepted',
@@ -93,5 +95,15 @@ module.exports = {
9395
TOKEN_CACHE_TIME: process.env.TOKEN_CACHE_TIME || 43200,
9496
AUTH0_CLIENT_ID: process.env.AUTH0_CLIENT_ID,
9597
AUTH0_CLIENT_SECRET: process.env.AUTH0_CLIENT_SECRET,
96-
AUTH0_PROXY_SERVER_URL: process.env.AUTH0_PROXY_SERVER_URL
98+
AUTH0_PROXY_SERVER_URL: process.env.AUTH0_PROXY_SERVER_URL,
99+
100+
AZURE_ACCESS_TOKEN_DEFAULT_EXPIRATION: 3600 * 24 * 14,
101+
AZURE_REFRESH_TOKEN_BEFORE_EXPIRATION: 300,
102+
AZURE_OWNER_CALLBACK_URL: '/api/v1/azure/owneruser/callback',
103+
AZURE_CLIENT_SECRET: process.env.AZURE_CLIENT_SECRET,
104+
105+
// used as base to construct various URLs
106+
WEBSITE: process.env.WEBSITE || 'http://topcoderx.topcoder-dev.com',
107+
WEBSITE_SECURE: process.env.WEBSITE_SECURE || 'https://topcoderx.topcoder-dev.com',
108+
97109
};

constants.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
// The user types
1515
const USER_TYPES = {
1616
GITHUB: 'github',
17-
GITLAB: 'gitlab'
17+
GITLAB: 'gitlab',
18+
AZURE: 'azure'
1819
};
1920

2021
// The user roles

models/Issue.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const schema = new Schema({
4848
name: 'RepositoryIdIndex'
4949
}
5050
},
51+
repositoryIdStr: {type: String, required: false},
5152
labels: {
5253
type: Array,
5354
required: false

models/Project.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const schema = new Schema({
3030
}
3131
},
3232
repoUrl: {type: String, required: true},
33+
repoId: {type: String, required: false},
3334
rocketChatWebhook: {type: String, required: false},
3435
rocketChatChannelName: {type: String, required: false},
3536
archived: {type: String, required: true},

models/User.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ const schema = new Schema({
2828
name: 'UsesProviderIdIndex'
2929
}
3030
},
31+
userProviderIdStr: {
32+
type: String,
33+
required: false
34+
},
3135
username: {
3236
type: String,
3337
required: true,

models/UserMapping.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ const schema = new Schema({
2525
},
2626
githubUsername: String,
2727
gitlabUsername: String,
28+
azureEmail: String,
2829
githubUserId: Number,
29-
gitlabUserId: Number
30+
gitlabUserId: Number,
31+
azureUserId: String
3032
});
3133

3234
module.exports = schema;

models/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ dynamoose.setDefaults({
2929
if (process.env.CREATE_DB) {
3030
dynamoose.setDefaults({
3131
create: true,
32-
update: true,
32+
update: true
3333
});
3434
}
3535

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
"no-kafka": "^3.2.10",
4444
"node-gitlab-api": "^2.2.8",
4545
"nodemailer": "^4.6.7",
46+
"superagent": "^3.6.0",
47+
"superagent-promise": "^1.1.0",
4648
"tc-core-library-js": "appirio-tech/tc-core-library-js.git#v2.6.3",
4749
"topcoder-api-challenges": "^1.0.6",
4850
"topcoder-api-projects": "^1.0.1",

0 commit comments

Comments
 (0)