Topcoder Connect - Milestone Bulk Updates (repost)

Key Information

Register
Submit
The challenge is finished.

Challenge Overview

Welcome to the Topcoder challenge. You may implement this task and submit your solution until the deadline. Reviewers would score it and 2 people with higher scores (not less than minimal) would get the prizes. Learn "How to compete" and read the task below.

Context

Project Context

Topcoder Connect App is the client-facing application of Topcoder. Customers may create Topcoder projects there and Topcoder managers and copilots pick it up from there.

Challenge Context

Topcoder Project Service is the main backend service of the Topcoder Connect App. Projects in Connect App might have timelines, and each timeline may have several milestones inside, see screenshot. When we update some milestone properties like status, duration or dates the main backend service (Topcoder Project Service) might perform some automatic updates of other properties (ex: when we change duration of milestone it updates end date of milestone) or even cascading updates to other milestones (ex: when we change duration of one of the milestones in the middle it updates stars/end dates of the following milestones).

This logic has a big downside caused by the Topcoder Project Service architecture. If we send some request to change one milestone and immediately after that request other milestones to get updated data we might get outdated data because Topcoder Project Service "caches" all the data in ElasticSearch index and it takes some time for data to be indexed.

To overcome this issue, in a recent challenge we removed logic for automatic and cascading milestone updates on Topcoder Project Service and created a new bulk update endpoint which can create, update and delete several milestones with one request, so Connect App can make cascading updates by itself while still making only one request to the server.

Expected Outcome

Move logic for automatic and cascading updates of milestones from the server to the client by using bulk update endpoint.

Challenge Details

Technology Stack

  • React

  • Redux

  • CSS Modules

Code access

The work for this challenge has to be done in one repository:

- Connect App repo https://github.com/appirio-tech/connect-app branch `feature/bulk-milestone-updates` commit `17de46640595338835472a1db720aeece6ac6d8d` or later.

- Demo user is provided on the forum.

- Updated version of Topcoder Project Service uses branch `feature/bulk-milestone-updates` see a pull request and deployed to http://167.71.90.133:8001/v5. While the current version of Topcoder Project Services uses branch `develop` and is deployed to http://api.topcoder-dev.com/v5.

Individual requirements

1) Move logic from server to client

Move all the logic of automatic and cascading updates when we update milestone properties "duration", "status", "startDate", "endDate", "actualStartDate", "completionDate" from the server to the client. 

  • When we update one milestone, all the automatic updates (code) in the milestone should be done client side before sending to the server.

  • When we update one milestone, all the cascading updates (code 1 and code 2) in other milestones should be done client side before sending to the server.
    - To update several milestones with one request use a new endpoint for bulk updates "PATCH /v5/timelines/:timelineId(\\d+)/milestones". You may learn the logic of this endpoint on this screenshot, and check swagger file online.

2) Use bulk endpoint

  • We already have some situations at the client-side when to perform one operation we have to make several calls to the server. As now we have an endpoint which can update several milestones at once, we have to use it in all such situations and make a single call instead of several ones. Here are some situations:
    - complete milestone
    - submit final fixes
    - complete final fixes

  • You might need to create new actions/reducers for this purpose or update existing.

  • Currently, after making updates to the milestones we often have to reload the whole timeline to get possible updates to other milestones and timeline itself. We should not make this call anymore in any situation, as we would get all updates milestones from the bulk update endpoint.

Verification guide

How to create a project for testing

See video on how to do it:
- using user "pshah_customer" create a new project
- using user "pshah_manager" join project, add a new phase "Development Iteration (3 Milestones)", and change status of the phase to "In Progress"

Test cases

Here are the most important cases to validate:
- Complete milestone - when we complete a milestone the next one becomes active and the start date set to the current date, see video. We have to make only 1 server request instead of 3.
- Edit milestone duration - when we update the duration of a milestone, the start date of the next milestone should be updated accordingly, see video. We have to make only 1 server request instead of 2.
- Edit actual start date and completion date by admins - when we update actual start date or completion date, the duration is updated automatically, see video. We have to make only 1 server request instead of 2. (To see these fields as admin, uncomment the next line).
- Approve extension - when we approve extension, the duration should be increased on that number of days, and the next milestone start date should move accordingly, see video. We have to make only 1 server request instead of 2.
- Submit final fixes - when a user requests final fixes, the new "Files Fixes" milestone should show up with the final fixes description, see video. We have to make only 1 server request instead of 2.
- Complete final fixes - when we complete final fixes, the milestone becomes completed and the last milestone also becomes completed. Also, the link we add in the final fixes milestone, appears in the Delivery milestone, see video. We have to make only 2 server requests instead of 4.
- "RUX Iteration" milestone should work as it is now - In particular, when we complete a milestone or complete final fixes we are setting "prevMilestoneContent'' and "prevMilestoneType'' to the next milestone, see code 1 and code 2, because of this when we are adding links in "Add Links" milestone they appear in "Design Final Selection" milestone, see video.

General requirements

  • All existing functionality should work as it is. You can always check how it works now on https://connect.topcoder-dev.com/ and compare to your implementation on a local machine.

  • Put logic for automatic updates and cascading updates in some methods and reuse it everywhere, instead of putting several copies of code.

  • Properly split code into meaningful functions to make it easier to understand the code.

  • Properly structure code in services/actions/reducers, update existent ones and create new ones when needed.

  • Use React and Redux best practices.

  • Lint should pass

Scorecard Aid

If you have any questions or concerns, feel free to raise a question on the forum.



Final Submission Guidelines

Submit a zip file which would include:

  • git patch with changes you’ve made to the code in our repository

Additionally, the winner would be required to raise a pull request to the repository after the challenge is completed.

ELIGIBLE EVENTS:

2020 Topcoder(R) Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30124366