Register
Submit a solution
The challenge is finished.

Challenge Overview

When testing tc direct project service by integrating with direct app, we found it is very slow to create a new project, check the following logs.

14:12:30,239 INFO  [STDOUT] Enter into method [ProjectServiceBean#createProject(TCSubject, ProjectData)]
14:12:30,239 INFO  [STDOUT] Parameters: project data: 8547899:
14:12:30,239 INFO  [STDOUT] Parameters: project data: {1}
14:12:30,290 INFO  [STDOUT] Returns: <project id: 11009, name: Tony Test 2, description: s fsddsfsdfsdf sdf dsf , statusId: 1, forum category id: null, project type:No Project Type, project category:No Project Category, fixed bug contest fee:N/A, percentage bug contest fee:N/A, completion date:Not completed>
14:12:30,290 INFO  [STDOUT] Exit into method [ProjectServiceBean#createProject(ProjectData)]
14:12:30,291 INFO  [STDOUT] [Enter method: PermissionServiceBean.getPermissions(userid, resourceId)]
14:12:30,291 INFO  [STDOUT] [param1: 8,547,899, param2: 11,009]
14:12:30,299 INFO  [STDOUT] [Exit method: getPermissions(userid, resourceId)]
14:12:30,299 INFO  [STDOUT] [Enter method: PermissionServiceBean.addPermission(permission)]
14:12:30,299 INFO  [STDOUT] [param1: null]
14:12:30,306 INFO  [STDOUT] [Exit method: addPermission(permission)]
14:12:30,306 INFO  [STDOUT] Enter into method [ProjectServiceBean#getProject(tcSubject, long)]
14:12:30,307 INFO  [STDOUT] Parameters: current user id: 8,547,899
14:12:30,307 INFO  [STDOUT] Parameters: project id: 11,009
14:12:30,307 INFO  [STDOUT] Returns: <project id: 11009, name: Tony Test 2, description: s fsddsfsdfsdf sdf dsf , statusId: 1, forum category id: null, project type:No Project Type, project category:No Project Category, fixed bug contest fee:N/A, percentage bug contest fee:N/A, completion date:Not completed>
14:12:30,307 INFO  [STDOUT] Exit into method [ProjectServiceBean#getProject(long)]
14:12:35,793 INFO  [STDOUT] [Enter method: PermissionServiceBean.getPermissionsByProject(resourceId)]
14:12:35,793 INFO  [STDOUT] [param1: 11,009]
14:12:35,817 INFO  [STDOUT] [Exit method: getPermissionsByProject(resourceId)]
14:12:36,038 INFO  [STDOUT] Enter into method [ProjectServiceBean#updateProject(TCSubject, ProjectData)]
14:12:36,038 INFO  [STDOUT] Parameters: project data: 8,547,899
14:12:36,038 INFO  [STDOUT] Parameters: project data: {1}
14:12:36,050 INFO  [STDOUT] Exit into method [ProjectServiceBean#updateProject(ProjectData)]
14:12:36,051 INFO  [STDOUT] [Enter method: UserServiceBean.getUserHandle(8547899)]
14:12:36,051 INFO  [STDOUT] [param1: 8,547,899]
14:12:36,058 INFO  [STDOUT] [Exit method: getUserHandle(userid)]

If you dive into the code (
https://github.com/appirio-tech/direct-app/blob/dev/services/project_service_facade/src/java/main/com/topcoder/service/facade/project/ejb/ProjectServiceFacadeBean.java#L526), you can see the big slowness is at

14:12:30,307 INFO  [STDOUT] Exit into method [ProjectServiceBean#getProject(long)]

14:12:35,793 INFO  [STDOUT] [Enter method: PermissionServiceBean.getPermissionsByProject(resourceId)]

which is related to the code block here 
https://github.com/appirio-tech/direct-app/blob/dev/services/project_service_facade/src/java/main/com/topcoder/service/facade/project/ejb/ProjectServiceFacadeBean.java#L983-L1010

So we'd like to support a way to create project without creating forum.

Following are the expected to way to proceed.

1. Update https://github.com/appirio-tech/direct-app/blob/dev/services/project_service_facade/src/java/main/com/topcoder/service/facade/project/ProjectServiceFacade.java by adding a new method, which can be used to call to create project without creating forum. Please refactor existing createProject method if we can reuse it and add this option in. Notes, the existing functionality in direct app should not be affected.
2. Update the implementation in project service facade service.
3. Fork https://github.com/appirio-tech/temp-maven-repo, then Build a new project_service_facade.jar and install to it.
4. Update tc-direct-project-service to use your fork instead (see https://github.com/appirio-tech/temp-maven-repo/blob/master/README.md) and update the logic in (src/main/java/com/topcoder/service/project/manager/ProjectManager.java) to call the corresponding method to create project without creating forum.

About Testing
1. For testing, it is actually impossible to test really forum creation, so you need to add debug logging to demonostrate instead of real call in (https://github.com/appirio-tech/direct-app/blob/dev/services/project_service_facade/src/java/main/com/topcoder/service/facade/project/ejb/ProjectServiceFacadeBean.java#L969)
2. To run direct app locally, you can follow https://github.com/appirio-tech/tc-common-tutorials/tree/master/docker/direct-app to build and run
3. After running direct app locally in docker, you can run the tc direct project service locally by hooking with the direct app in docker, and use POSTMan to send create project request for testing (see docs directory for reference).

Winner Responsibility

Winner will be responsible to create the PRs for merging.

1. PR for direct app
2. PR for temp-maven-repo
3. PR for tc-direct-project-service (this will be done internally since it is private, but winner will help with any merging problem)





 

Final Submission Guidelines

- Code change for new feature.
- Deployment and Verification Steps

ELIGIBLE EVENTS:

2017 TopCoder(R) Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30055500