Skip to content

Supporting Release for Connect 2.4.8 #220

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 64 commits into from
Jan 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
7e69869
Added gzip compression for project listing endpoints as well after si…
Dec 12, 2018
ff08ba4
temporary making feature branch deployable
Dec 12, 2018
86c3a8a
Removed the feature branch from deployable list
Dec 12, 2018
c9ece96
Merge pull request #202 from topcoder-platform/feature/gzip_compressi…
Dec 12, 2018
0c1ce34
team management challenge and final fixes
gondzo Dec 16, 2018
13f5dfd
update invite change
gondzo Dec 16, 2018
5cf210e
Merge pull request #205 from topcoder-platform/hotfix/silent_ignore_m…
Dec 24, 2018
0aed2c5
Added new field subCategory to productTemplates to support Addons
RishiRajSahu Dec 26, 2018
b3de8d0
Corrected table name in migration script.
RishiRajSahu Dec 26, 2018
57bc809
Merge pull request #207 from topcoder-platform/feature/Add_new_field_…
RishiRajSahu Dec 26, 2018
ec2577b
fix validation for productTemplates update endpoint
maxceem Dec 27, 2018
ccb64d4
Merge pull request #209 from maxceem/fix-product-templates-update
Dec 28, 2018
7be5db3
Fixed testcase for productTemplate PATCH calls.
RishiRajSahu Dec 28, 2018
06dffae
Merge pull request #211 from topcoder-platform/feature/fixed_testcases
RishiRajSahu Dec 28, 2018
3e97ee4
integration changes
gondzo Jan 3, 2019
95595e1
return invites in GET /projects/:id
gondzo Jan 3, 2019
d38c9d1
ignore duplicate member invites; fix invite remove error
gondzo Jan 3, 2019
6428620
fix tests
gondzo Jan 3, 2019
a59f535
lint fix
gondzo Jan 3, 2019
0d29c21
fix tests
gondzo Jan 3, 2019
01fabde
fix update role permission
gondzo Jan 3, 2019
031a600
fix tests
gondzo Jan 3, 2019
39541c4
send email event for email invites
gondzo Jan 7, 2019
a6ff782
fix tests
gondzo Jan 7, 2019
19b4774
Fixed typo in event naming.
RishiRajSahu Jan 7, 2019
581e640
Corrected the migration script
RishiRajSahu Jan 7, 2019
e82e9a4
Merge pull request #212 from topcoder-platform/feature/teamManagement
RishiRajSahu Jan 7, 2019
40b823d
Fixed the constant import
Jan 7, 2019
8f1ac5c
lint fix
Jan 7, 2019
31c2a64
lint fix
Jan 7, 2019
f564ac1
fixing possible error in log statements
Jan 7, 2019
9273601
fixing possible error in log statements
Jan 7, 2019
59927f6
Config changes and migration script correction
RishiRajSahu Jan 7, 2019
b340265
Added new env vars
RishiRajSahu Jan 7, 2019
f0502ee
fixed typo
RishiRajSahu Jan 7, 2019
6190399
Fixed env value for category of email
Jan 7, 2019
e720e3c
email invitation template data update
gondzo Jan 7, 2019
4f99606
Merge branch 'feature/teamManagement' of https://github.com/topcoder-…
gondzo Jan 7, 2019
8fc83b8
merge dev
gondzo Jan 7, 2019
5117d45
Merge pull request #216 from topcoder-platform/feature/adding_new_env…
RishiRajSahu Jan 8, 2019
39e723f
Merge pull request #217 from topcoder-platform/feature/teamManagement
Jan 8, 2019
b217239
More configurable variables in invite email
Jan 8, 2019
7c6d9c0
Configurable invite email section title
Jan 8, 2019
36600a5
lint fixes
Jan 8, 2019
92f3497
Trying to fix the deploy script
Jan 8, 2019
48f1412
Github issue#2742, [Team Management 2.0] Inviting already invited use…
Jan 12, 2019
12c675e
Added initiator user id for fetching information about inviting user …
Jan 12, 2019
346c391
Github issue#2742, [Team Management 2.0] Inviting already invited use…
Jan 12, 2019
6558bb1
lint fix
Jan 12, 2019
1dd16df
Fixed unit tests
Jan 12, 2019
98a7a22
fix connect app issue 2741 - [Team Management 2.0] Handle the case wh…
maxceem Jan 14, 2019
c52e099
improved unit test
maxceem Jan 15, 2019
cf04b21
Merge pull request #218 from maxceem/connect-issue-2741-invite-existe…
RishiRajSahu Jan 15, 2019
fa2fd52
fix for inviting existent users
maxceem Jan 15, 2019
a499d04
Merge branch 'dev' into connect-issue-2741-invite-existent-user
maxceem Jan 15, 2019
7f7818b
Merge pull request #219 from maxceem/connect-issue-2741-invite-existe…
RishiRajSahu Jan 15, 2019
abe921a
fix 2 for inviting existent users
maxceem Jan 15, 2019
ba99512
fix 3 for inviting existent users
maxceem Jan 15, 2019
2766b8e
trying to send initiator user details in email data
Jan 15, 2019
a40bc20
lint fix
Jan 15, 2019
04ed897
Fixed unit tests
Jan 15, 2019
50c73aa
setting longer timeout (5000 instead of 3000) for lookupUserEmails
maxceem Jan 15, 2019
013cd91
Merge branch 'master' into dev
RishiRajSahu Jan 15, 2019
17b0bce
fixed syntax error
Jan 15, 2019
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ workflows:
- test
filters:
branches:
only: ['dev', 'feature/auth0-proxy-server']
only: ['dev']
- deployProd:
requires:
- test
Expand Down
6 changes: 5 additions & 1 deletion config/custom-environment-variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,9 @@
"AUTH0_AUDIENCE": "AUTH0_AUDIENCE",
"TOKEN_CACHE_TIME" : "TOKEN_CACHE_TIME",
"whitelistedOriginsForUserIdAuth": "WHITELISTED_ORIGINS_FOR_USERID_AUTH",
"AUTH0_PROXY_SERVER_URL" : "AUTH0_PROXY_SERVER_URL"
"AUTH0_PROXY_SERVER_URL" : "AUTH0_PROXY_SERVER_URL",
"connectUrl": "CONNECT_URL",
"accountsAppUrl": "ACCOUNTS_APP_URL",
"inviteEmailSubject": "INVITE_EMAIL_SUBJECT",
"inviteEmailSectionTitle": "INVITE_EMAIL_SECTION_TITLE"
}
9 changes: 8 additions & 1 deletion config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,12 @@
"AUTH0_URL": "",
"TOKEN_CACHE_TIME": "",
"whitelistedOriginsForUserIdAuth": "[\"https:\/\/topcoder-newauth.auth0.com\/\",\"https:\/\/api.topcoder-dev.com\"]",
"AUTH0_PROXY_SERVER_URL" : ""
"AUTH0_PROXY_SERVER_URL" : "",
"EMAIL_INVITE_FROM_NAME":"Topcoder",
"EMAIL_INVITE_FROM_EMAIL":"noreply@connect.topcoder.com",
"inviteEmailSubject": "You are invited to Topcoder",
"inviteEmailSectionTitle": "Project Invitation",
"connectUrl":"https://connect.topcoder-dev.com",
"accountsAppUrl": "https://accounts.topcoder-dev.com"

}
33 changes: 31 additions & 2 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ make_task_def(){
"name": "CONNECT_PROJECTS_URL",
"value": "%s"
},
{
"name": "CONNECT_URL",
"value": "%s"
},
{
"name": "ACCOUNTS_APP_URL",
"value": "%s"
},
{
"name": "SEGMENT_ANALYTICS_KEY",
"value": "%s"
Expand Down Expand Up @@ -195,6 +203,22 @@ make_task_def(){
{
"name": "AUTH0_PROXY_SERVER_URL",
"value": "%s"
},
{
"name": "EMAIL_INVITE_FROM_NAME",
"value": "%s"
},
{
"name": "EMAIL_INVITE_FROM_EMAIL",
"value": "%s"
},
{
"name": "INVITE_EMAIL_SUBJECT",
"value": "%s"
},
{
"name": "INVITE_EMAIL_SECTION_TITLE",
"value": "%s"
}
],
"portMappings": [
Expand Down Expand Up @@ -230,6 +254,8 @@ make_task_def(){
DIRECT_PROJECT_SERVICE_ENDPOINT=$(eval "echo \$${ENV}_DIRECT_PROJECT_SERVICE_ENDPOINT")
FILE_SERVICE_ENDPOINT=$(eval "echo \$${ENV}_FILE_SERVICE_ENDPOINT")
CONNECT_PROJECTS_URL=$(eval "echo \$${ENV}_CONNECT_PROJECTS_URL")
CONNECT_URL=$(eval "echo \$${ENV}_CONNECT_URL")
ACCOUNTS_APP_URL=$(eval "echo \$${ENV}_ACCOUNTS_APP_URL")
SEGMENT_ANALYTICS_KEY=$(eval "echo \$${ENV}_SEGMENT_ANALYTICS_KEY")
MESSAGE_SERVICE_URL=$(eval "echo \$${ENV}_MESSAGE_SERVICE_URL")
if [ "$ENV" = "PROD" ]; then
Expand All @@ -250,11 +276,14 @@ make_task_def(){
KAFKA_CLIENT_CERT_KEY=$(eval "echo \$${ENV}_KAFKA_CLIENT_CERT_KEY")
KAFKA_GROUP_ID=$(eval "echo \$${ENV}_KAFKA_GROUP_ID")
KAFKA_URL=$(eval "echo \$${ENV}_KAFKA_URL")
AUTH0_PROXY_SERVER_URL=$(eval "echo \$${ENV}_AUTH0_PROXY_SERVER_URL")

AUTH0_PROXY_SERVER_URL=$(eval "echo \$${ENV}_AUTH0_PROXY_SERVER_URL")
EMAIL_INVITE_FROM_NAME=$(eval "echo \$${ENV}_EMAIL_INVITE_FROM_NAME")
EMAIL_INVITE_FROM_EMAIL=$(eval "echo \$${ENV}_EMAIL_INVITE_FROM_EMAIL")
INVITE_EMAIL_SUBJECT=$(eval "echo \$${ENV}_INVITE_EMAIL_SUBJECT")
INVITE_EMAIL_SECTION_TITLE=$(eval "echo \$${ENV}_INVITE_EMAIL_SECTION_TITLE")

task_def=$(printf "$task_template" $1 $ACCOUNT_ID $ACCOUNT_ID $AWS_ECS_CONTAINER_NAME $ACCOUNT_ID $AWS_REGION $AWS_REPOSITORY $CIRCLE_SHA1 $2 $3 $4 $NODE_ENV $ENABLE_FILE_UPLOAD $LOG_LEVEL $CAPTURE_LOGS $LOGENTRIES_TOKEN $API_VERSION $AWS_REGION $AUTH_DOMAIN $AUTH_SECRET $VALID_ISSUERS $DB_MASTER_URL $MEMBER_SERVICE_ENDPOINT $IDENTITY_SERVICE_ENDPOINT $BUS_API_URL $MESSAGE_SERVICE_URL $SYSTEM_USER_CLIENT_ID $SYSTEM_USER_CLIENT_SECRET $PROJECTS_ES_URL $PROJECTS_ES_INDEX_NAME $RABBITMQ_URL $DIRECT_PROJECT_SERVICE_ENDPOINT $FILE_SERVICE_ENDPOINT $CONNECT_PROJECTS_URL $SEGMENT_ANALYTICS_KEY "$AUTH0_URL" "$AUTH0_AUDIENCE" $AUTH0_CLIENT_ID "$AUTH0_CLIENT_SECRET" $TOKEN_CACHE_TIME "$KAFKA_CLIENT_CERT" "$KAFKA_CLIENT_CERT_KEY" $KAFKA_GROUP_ID $KAFKA_URL "$AUTH0_PROXY_SERVER_URL" $PORT $PORT $AWS_ECS_CLUSTER $AWS_REGION $NODE_ENV)
task_def=$(printf "$task_template" $1 $ACCOUNT_ID $ACCOUNT_ID $AWS_ECS_CONTAINER_NAME $ACCOUNT_ID $AWS_REGION $AWS_REPOSITORY $CIRCLE_SHA1 $2 $3 $4 $NODE_ENV $ENABLE_FILE_UPLOAD $LOG_LEVEL $CAPTURE_LOGS $LOGENTRIES_TOKEN $API_VERSION $AWS_REGION $AUTH_DOMAIN $AUTH_SECRET $VALID_ISSUERS $DB_MASTER_URL $MEMBER_SERVICE_ENDPOINT $IDENTITY_SERVICE_ENDPOINT $BUS_API_URL $MESSAGE_SERVICE_URL $SYSTEM_USER_CLIENT_ID $SYSTEM_USER_CLIENT_SECRET $PROJECTS_ES_URL $PROJECTS_ES_INDEX_NAME $RABBITMQ_URL $DIRECT_PROJECT_SERVICE_ENDPOINT $FILE_SERVICE_ENDPOINT $CONNECT_PROJECTS_URL $CONNECT_URL $ACCOUNTS_APP_URL $SEGMENT_ANALYTICS_KEY "$AUTH0_URL" "$AUTH0_AUDIENCE" $AUTH0_CLIENT_ID "$AUTH0_CLIENT_SECRET" $TOKEN_CACHE_TIME "$KAFKA_CLIENT_CERT" "$KAFKA_CLIENT_CERT_KEY" $KAFKA_GROUP_ID $KAFKA_URL "$AUTH0_PROXY_SERVER_URL" "$EMAIL_INVITE_FROM_NAME" "$EMAIL_INVITE_FROM_EMAIL" "$INVITE_EMAIL_SUBJECT" "$INVITE_EMAIL_SECTION_TITLE" $PORT $PORT $AWS_ECS_CLUSTER $AWS_REGION $NODE_ENV)
}

push_ecr_image(){
Expand Down
38 changes: 37 additions & 1 deletion local/mock-services/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const middlewares = jsonServer.defaults();
const authMiddleware = require('./authMiddleware');

const members = require('./services.json').members;
const roles = require('./services.json').roles;

server.use(middlewares);

Expand All @@ -29,7 +30,12 @@ server.get('/v3/members/_search', (req, res) => {
const ret = {};
const splitted = single.split(':');
// if the result can be parsed successfully
const parsed = jsprim.parseInteger(splitted[1], { allowTrailing: true, trimWhitespace: true });
let parsed = Error();
try {
parsed = jsprim.parseInteger(splitted[1], { allowTrailing: true, trimWhitespace: true });
} catch (e) {
// no-empty
}
if (parsed instanceof Error) {
ret[splitted[0]] = splitted[1];
} else {
Expand All @@ -38,6 +44,7 @@ server.get('/v3/members/_search', (req, res) => {
return ret;
});
const userIds = _.map(criteria, 'userId');
const handles = _.map(criteria, 'handle');
const cloned = _.cloneDeep(members);
const response = {
id: 'res1',
Expand All @@ -53,13 +60,42 @@ server.get('/v3/members/_search', (req, res) => {
found = _.pick(found, fields);
}
return found;
} else if (_.indexOf(handles, single.result.content.handle) > -1) {
let found = single.result.content;
if (fields.length > 0) {
found = _.pick(found, fields);
}
return found;
}
return null;
}).filter(_.identity);
response.result.metadata = { totalCount: response.result.content.length };
res.status(200).json(response);
});

// add additional search route for project members
server.get('/roles', (req, res) => {
const filter = _.isString(req.query.filter) ?
req.query.filter.replace('%2520', ' ').replace('%20', ' ').split('=') : [];
const cloned = _.cloneDeep(roles);
const response = {
id: 'res1',
result: {
success: true,
status: 200,
},
};
const role = filter ? _.find(cloned, (single) => {
if (single.userId === filter[1]) {
return single.roles;
}
return null;
}) : null;

response.result.content = role ? role.roles : [];
res.status(200).json(response);
});

server.use(router);

server.listen(PORT, () => {
Expand Down
8 changes: 8 additions & 0 deletions local/mock-services/services.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,13 @@
},
"version": "v3"
}
],
"roles": [
{ "userId": "40051334", "roles": [ { "roleName": "Connect Manager" } ] },
{ "userId": "40051332", "roles": [ { "roleName": "Connect Copilot" } ] },
{ "userId": "40051333", "roles": [ { "roleName": "administrator" } ] },
{ "userId": "40051336", "roles": [ { "roleName": "Connect Admin" }, { "roleName": "Connect Copilot" } ] },
{ "userId": "40051331", "roles": [ ] },
{ "userId": "40051335", "roles": [ ] }
]
}
41 changes: 41 additions & 0 deletions migrations/20181201_create_project_member_invites.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
--
-- CREATE NEW TABLES:
-- project_member_invites
--

--
-- project_member_invites
--

CREATE TABLE project_member_invites (
id bigint NOT NULL,
"projectId" bigint,
"userId" bigint,
email character varying(255),
role character varying(255) NOT NULL,
status character varying(255) NOT NULL,
"createdAt" timestamp with time zone,
"updatedAt" timestamp with time zone,
"deletedAt" timestamp with time zone,
"createdBy" integer NOT NULL,
"updatedBy" integer NOT NULL,
"deletedBy" bigint
);

ALTER TABLE ONLY project_member_invites
ADD CONSTRAINT project_member_invites_pkey PRIMARY KEY (id);

CREATE SEQUENCE project_member_invites_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;

ALTER SEQUENCE project_member_invites_id_seq OWNED BY project_member_invites.id;

ALTER TABLE project_member_invites
ALTER COLUMN id SET DEFAULT nextval('project_member_invites_id_seq');

ALTER TABLE ONLY project_member_invites
ADD CONSTRAINT "project_member_invites_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES projects(id) ON UPDATE CASCADE ON DELETE CASCADE;
14 changes: 14 additions & 0 deletions migrations/20181226_productTemplates_subCategory.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--
-- UPDATE EXISTING TABLES:
-- product_templates:
-- added column `subCategory`

--
-- product_templates

-- Add new column
ALTER TABLE product_templates ADD COLUMN "subCategory" character varying(45);
-- Update new column
UPDATE product_templates SET "subCategory"="category" WHERE "subCategory" is NULL;
-- Set not null
ALTER TABLE product_templates ALTER COLUMN "subCategory" SET NOT NULL;
Loading