Challenge Overview
Challenge service is responsible for orchestrating the challenge workflow. Workflow varies based on challenge type. For every member registered for a submitter role there should be a “submit” task in the system with a pending state. Once a registered user makes a code submission for a code challenge through submission service, the submission service records the submission and fires an event (this part is out of scope and will be done externally).
In this challenge, we are going to make some updates to the existing challenge service to work with such events and also add new endpoint to challenge service:
1. Challenge service should listen to the rabbitmq message fired by submission service. It should lookup the challenge task for that userId + challengeId and mark the “submit” task completed and record the submission id in a metadata field (json type). You can assume the event data will at least contain submission id, challengeId, userId and dates. If you feel more data fields are needed please let us know.
2. For a non-competitive code challenge type - once a user submits, a review task should be created and assigned to a reviewer (challenge_registrants role reviewer) or creator of the challenge if no reviewer is registered. We'll need one review task per submission, it's very similar to the current F2F challenge, except that there's only one registrant (this is going to be used to replace the current Jira private tasks).
3. We will be adding other workflows overtime so make sure event handlers can be registered per challenge type.
4. If there is another submission from the same user for the same challenge another entry should be made in the task table.
5. Once the co-pilot / owner of the challenge is happy with the submission, they can mark the challenge complete. (new endpoint POST /v4/challenges/{id}/complete, this means adding a new complete.js code file to app/routes/challenges folder). The review task should be marked complete and the challenge status should be transitioned to ‘completed’. ‘challenge.completed’ event should be fired as well.
6. If processing of the event fails, the error or exception should be caught and logged. ‘next()’ callback should be called with an error. Invoking the callback with an error will result in the message being added to an exception queue to be processed later. (Not in scope for this challenge - just call the callback with an error in this challenge).
7. Please provide unit tests for the new endpoint (complete.spec.js) and new events.
8. To test the events, you will need to use rabbitmq CLI to send messages.
9. Please note that challenge service is one of the consumers of these events - since this helps run asynchronously, see app/events/challenges/index.js for an example of how it fires the event and also consumes the event.
Register to get access to the code in the challenge forum.
Update the readme (if necessary) to explain how to deploy the application including configuration information
A separate verification guide with details on how the new features can be verified.
In this challenge, we are going to make some updates to the existing challenge service to work with such events and also add new endpoint to challenge service:
1. Challenge service should listen to the rabbitmq message fired by submission service. It should lookup the challenge task for that userId + challengeId and mark the “submit” task completed and record the submission id in a metadata field (json type). You can assume the event data will at least contain submission id, challengeId, userId and dates. If you feel more data fields are needed please let us know.
2. For a non-competitive code challenge type - once a user submits, a review task should be created and assigned to a reviewer (challenge_registrants role reviewer) or creator of the challenge if no reviewer is registered. We'll need one review task per submission, it's very similar to the current F2F challenge, except that there's only one registrant (this is going to be used to replace the current Jira private tasks).
3. We will be adding other workflows overtime so make sure event handlers can be registered per challenge type.
4. If there is another submission from the same user for the same challenge another entry should be made in the task table.
5. Once the co-pilot / owner of the challenge is happy with the submission, they can mark the challenge complete. (new endpoint POST /v4/challenges/{id}/complete, this means adding a new complete.js code file to app/routes/challenges folder). The review task should be marked complete and the challenge status should be transitioned to ‘completed’. ‘challenge.completed’ event should be fired as well.
6. If processing of the event fails, the error or exception should be caught and logged. ‘next()’ callback should be called with an error. Invoking the callback with an error will result in the message being added to an exception queue to be processed later. (Not in scope for this challenge - just call the callback with an error in this challenge).
7. Please provide unit tests for the new endpoint (complete.spec.js) and new events.
8. To test the events, you will need to use rabbitmq CLI to send messages.
9. Please note that challenge service is one of the consumers of these events - since this helps run asynchronously, see app/events/challenges/index.js for an example of how it fires the event and also consumes the event.
Register to get access to the code in the challenge forum.
Final Submission Guidelines
Updated code that covers all the requirements.Update the readme (if necessary) to explain how to deploy the application including configuration information
A separate verification guide with details on how the new features can be verified.