Skip to content

Commit 77dfeb7

Browse files
authored
Merge pull request #715 from topcoder-platform/dev
[PROD RELEASE] TSJR-297 Drop Ubahn & ES dependency
2 parents 49b1001 + 6c58575 commit 77dfeb7

File tree

61 files changed

+8922
-3188
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+8922
-3188
lines changed

.circleci/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ workflows:
7878
branches:
7979
only:
8080
- dev
81-
- TSJR-246
8281

8382
# Development builds are executed on "develop" branch only.
8483
- "build-qa":

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ web_modules/
7676
.env
7777
.env.test
7878
taas-es-processor.env
79+
dev-env.sh
7980

8081
# parcel-bundler cache (https://parceljs.org/)
8182
.cache
@@ -125,3 +126,6 @@ api.env
125126

126127
# macOS files
127128
.DS_Store
129+
130+
# db backups
131+
db-backups

config/default.js

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ module.exports = {
1515
AUTH0_URL: process.env.AUTH0_URL,
1616
// Auth0 audience, used to get TC M2M token
1717
AUTH0_AUDIENCE: process.env.AUTH0_AUDIENCE,
18-
// Auth0 audience for U-Bahn
19-
AUTH0_AUDIENCE_UBAHN: process.env.AUTH0_AUDIENCE_UBAHN,
2018
// Auth0 token cache time, used to get TC M2M token
2119
TOKEN_CACHE_TIME: process.env.TOKEN_CACHE_TIME,
2220
// Auth0 client id, used to get TC M2M token
@@ -58,39 +56,6 @@ module.exports = {
5856
// the default path for importing and exporting data
5957
DEFAULT_DATA_FILE_PATH: './data/demo-data.json',
6058

61-
esConfig: {
62-
// the elasticsearch host
63-
HOST: process.env.ES_HOST || 'http://localhost:9200',
64-
65-
ELASTICCLOUD: {
66-
// The elastic cloud id, if your elasticsearch instance is hosted on elastic cloud. DO NOT provide a value for ES_HOST if you are using this
67-
id: process.env.ELASTICCLOUD_ID,
68-
// The elastic cloud username for basic authentication. Provide this only if your elasticsearch instance is hosted on elastic cloud
69-
username: process.env.ELASTICCLOUD_USERNAME,
70-
// The elastic cloud password for basic authentication. Provide this only if your elasticsearch instance is hosted on elastic cloud
71-
password: process.env.ELASTICCLOUD_PASSWORD
72-
},
73-
74-
// The Amazon region to use when using AWS Elasticsearch service
75-
AWS_REGION: process.env.AWS_REGION || 'us-east-1', // AWS Region to be used if we use AWS ES
76-
77-
// the job index
78-
ES_INDEX_JOB: process.env.ES_INDEX_JOB || 'job',
79-
// the job candidate index
80-
ES_INDEX_JOB_CANDIDATE: process.env.ES_INDEX_JOB_CANDIDATE || 'job_candidate',
81-
// the resource booking index
82-
ES_INDEX_RESOURCE_BOOKING: process.env.ES_INDEX_RESOURCE_BOOKING || 'resource_booking',
83-
// the role index
84-
ES_INDEX_ROLE: process.env.ES_INDEX_ROLE || 'role',
85-
// the userMeetingSettings index
86-
ES_INDEX_USER_MEETING_SETTINGS: process.env.ES_INDEX_USER_MEETING_SETTINGS || 'user_meeting_settings',
87-
88-
// the max bulk size in MB for ES indexing
89-
MAX_BULK_REQUEST_SIZE_MB: process.env.MAX_BULK_REQUEST_SIZE_MB || 20,
90-
// the max number of documents per bulk for ES indexing
91-
MAX_BULK_NUM_DOCUMENTS: process.env.MAX_BULK_NUM_DOCUMENTS || 100
92-
},
93-
9459
// Topcoder Bus API URL
9560
BUSAPI_URL: process.env.BUSAPI_URL || 'https://api.topcoder-dev.com/v5',
9661
// The error topic at which bus api will publish any errors

docs/swagger.yaml

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,8 @@ paths:
635635
required: false
636636
schema:
637637
type: string
638-
format: uuid
638+
example: '443211'
639+
description: 'The topcoder user id'
639640
description: The user id.
640641
- in: query
641642
name: status
@@ -1654,7 +1655,8 @@ paths:
16541655
required: false
16551656
schema:
16561657
type: string
1657-
format: uuid
1658+
example: '443211'
1659+
description: 'The topcoder user id'
16581660
description: The job id.
16591661
- in: query
16601662
name: projectId
@@ -3186,11 +3188,11 @@ paths:
31863188
parameters:
31873189
- in: path
31883190
name: userId
3189-
description: The userId
3191+
description: 'The topcoder user id'
31903192
required: true
31913193
schema:
31923194
type: string
3193-
format: uuid
3195+
example: '443211'
31943196

31953197
responses:
31963198
"200":
@@ -3243,11 +3245,12 @@ paths:
32433245
parameters:
32443246
- in: path
32453247
name: userId
3246-
description: The UUID of the User whose calendar should be deleted
3248+
description: The topcoder id of the User whose calendar should be deleted
32473249
required: true
32483250
schema:
32493251
type: string
3250-
format: uuid
3252+
example: '443211'
3253+
description: 'The topcoder user id'
32513254
- in: path
32523255
name: calendarId
32533256
description: The id of the calendar to delete. This id comes from Nylas backend server
@@ -4518,9 +4521,8 @@ components:
45184521
description: "The project id."
45194522
userId:
45204523
type: string
4521-
format: uuid
4522-
example: "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a"
4523-
description: "The user id."
4524+
example: '443211'
4525+
description: "The topcoder user id."
45244526
status:
45254527
type: string
45264528
enum:
@@ -4589,9 +4591,8 @@ components:
45894591
description: "The project id."
45904592
userId:
45914593
type: string
4592-
format: uuid
4593-
example: "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a"
4594-
description: "The user id."
4594+
example: '443211'
4595+
description: "The topcoder user id."
45954596
status:
45964597
type: string
45974598
enum:
@@ -4678,9 +4679,8 @@ components:
46784679
description: "The project id."
46794680
userId:
46804681
type: string
4681-
format: uuid
4682-
example: "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a"
4683-
description: "The user id."
4682+
example: '443211'
4683+
description: "The topcoder user id."
46844684
status:
46854685
type: string
46864686
enum:
@@ -4862,8 +4862,8 @@ components:
48624862
description: "The handle of the interview host"
48634863
hostUserId:
48644864
type: string
4865-
example: "00000000-0000-0000-0000-000000000000"
4866-
description: "The userId of the interview host"
4865+
example: "442321"
4866+
description: "The topcoder userId of the interview host"
48674867
jobCandidateId:
48684868
type: string
48694869
format: uuid
@@ -4949,7 +4949,8 @@ components:
49494949
pattern: "^[0-9]{1,2}:[0-9]{2}$"
49504950
hostUserId:
49514951
type: string
4952-
format: uuid
4952+
example: '443211'
4953+
description: 'The topcoder user id of the host'
49534954

49544955
UpdateInterviewByRequestBody:
49554956
properties:
@@ -4962,7 +4963,7 @@ components:
49624963
example: "Europe/London"
49634964
hostUserId:
49644965
type: string
4965-
description: "UUID of interview host user"
4966+
description: "The topcoder id of interview host user"
49664967
expireTimestamp:
49674968
type: string
49684969
format: date-time
@@ -5122,9 +5123,8 @@ components:
51225123
description: "The project id."
51235124
userId:
51245125
type: string
5125-
format: uuid
5126-
example: "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a"
5127-
description: "The external id."
5126+
example: "442312"
5127+
description: "The topcoder id."
51285128
jobId:
51295129
type: string
51305130
format: uuid
@@ -5206,9 +5206,8 @@ components:
52065206
description: "The project id."
52075207
userId:
52085208
type: string
5209-
format: uuid
5210-
example: "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a"
5211-
description: "The external id."
5209+
example: "442321"
5210+
description: "The topcoder id."
52125211
sendWeeklySurvey:
52135212
type: boolean
52145213
example: true,
@@ -5566,8 +5565,8 @@ components:
55665565
description: The job id.
55675566
userId:
55685567
type: string
5569-
format: uuid
5570-
description: The user id.
5568+
example: '442321'
5569+
description: 'The topcoder user id'
55715570
projectId:
55725571
type: integer
55735572
description: The project id.
@@ -5779,8 +5778,8 @@ components:
57795778
description: "The resource booking id."
57805779
userId:
57815780
type: string
5782-
format: uuid
5783-
description: "The user id."
5781+
example: '442321'
5782+
description: "The topcoder user id."
57845783
handle:
57855784
type: string
57865785
example: "Tony"
@@ -6023,8 +6022,8 @@ components:
60236022
description: "The job candidate id."
60246023
userId:
60256024
type: string
6026-
format: uuid
6027-
description: "User id."
6025+
example: '44231'
6026+
description: "The topcoder user id."
60286027
resume:
60296028
type: string
60306029
format: url
@@ -6369,7 +6368,7 @@ components:
63696368
userId:
63706369
type: number
63716370
example: 40157055
6372-
description: the user id
6371+
description: 'The topcoder user id'
63736372
handle:
63746373
type: string
63756374
example: maxceemdev
@@ -6701,7 +6700,8 @@ components:
67016700
properties:
67026701
userId:
67036702
type: string
6704-
format: uuid
6703+
example: '442321'
6704+
description: 'The topcoder user id'
67056705
defaultAvailableTime:
67066706
type: array
67076707
items:
Loading

migrations/2021-04-22-3-populate-work-periods-for-resource-bookings.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ module.exports = {
3232
await Promise.all(resourceBookings.map(async rb => {
3333
if (!_.isNil(rb.startDate) && !_.isNil(rb.endDate)) {
3434
const periods = helper.extractWorkPeriods(rb.startDate, rb.endDate)
35-
const user = await helper.ensureUserById(rb.userId)
35+
let tcUser = await helper.ensureTopcoderUserIdExists(rb.userId)
3636
_.forEach(periods, period => {
3737
workPeriodData.push({
3838
id: uuid(),
3939
resource_booking_id: rb.id,
4040
project_id: rb.projectId,
41-
user_handle: user.handle,
41+
user_handle: tcUser.handleLower,
4242
start_date: period.startDate,
4343
end_date: period.endDate,
4444
days_worked: null,

migrations/2021-06-14-recreate-and-repopulate-work-periods-for-resource-bookings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ module.exports = {
7373
for (const rb of resourceBookings) {
7474
if (!_.isNil(rb.startDate) && !_.isNil(rb.endDate)) {
7575
const periods = helper.extractWorkPeriods(rb.startDate, rb.endDate)
76-
const user = await helper.ensureUserById(rb.userId)
76+
let tcUser = await helper.ensureTopcoderUserIdExists(rb.userId)
7777
_.forEach(periods, period => {
7878
workPeriodData.push({
7979
id: uuid(),

0 commit comments

Comments
 (0)