Challenge Overview
Project Overview
TopCoder and the TopCoder community have worked hard to get the platform to its currently level of maturity, but we're far from done. It's time to take the platform to the next level. TopCoder is going to start taking some steps to open up the platform API to the outside and community developers so they could incorporate it in their websites, applications or build their own applications (web, mobile or desktop).
The ultimate goal is to open up and build an "API" that is targeting all different type of audiences - Software and Studio Competitors, SRM/MM competitors, Copilots, Admins and TopCoder partners - each audience will have different interests and usages of the API, so it will be a huge project and we need to make sure that we are in the right direction from the beginning.
This contest is going to find a elegant solution of inserting data for TEXT type fields, and update tests to verify the TEXT type field data.
Competition Task Overview
Please raise questions as quick as you can, I am familiar with related database and code base, I can provide as much support as I can.
Current the API code can be deployed in different OS environments, like CentOS, Mac OS, Ubuntu and Windows, please check https://github.com/cloudspokes/tc-api/wiki.
The updated code must still deploy and work on heroku - any submission which can't be deployed on heroku successfully will be failed in screening phase - primary reviewer must check this.
The implementation will base on the node.js version of TC platform API - https://github.com/cloudspokes/tc-api. Please follow the existing actionhero pattern for your development.
Text Field Data Insertion Solution
Currently, if you check the tests for Chanllenge Details API, like https://github.com/cloudspokes/tc-api/blob/master/test/test.challenges.js
You can see the TEXT type fields like detailedRequirements and finalSubmissionGuidelines for Develop Challenges , detailedRequirements for Design Challenges, are not tested, because for informix it is impossible to insert data into TEXT type fields by directly SQL statement.
For this contest, we are seeking general and elegant way to insert data into the TEXT type fields, so we can proper test these, instead of ignore them.
Here are the initial thought, that we can define a customized helper function by utilizing the informix-wrapper module (you can add custom methods in this module also) to update the TEXT field data.
In the scripts svn, we faced a similar problem to load queries into the TEXT type field, and we define a customized tool called UpdateTextColumn to handle this.
Basically, I am think of a custom function takes
1. a sql statement that is going to update the TEXT field, like "PDATE query SET project_spec= ? WHERE project_spec_id=?"
2. the corresponding primary key for project_spec_id
3. the string value for the TEXT field
and that will utilitize a custom method defined in informix-wrapper module to update the database.
But you are encougrated to find better solution if possible, which can be given higher score from the reviewer's review.
Then you are expected to update the tests in test.challenges.js to properly verify the TEXT type fields.
Standarize Query Naming Convensionwe like to use the underscore approach in all SQL queries under the queries directory, please follow same approach.
Notes, for the JSON data returned, we will use camelCase approach.
Testing
The API Framework supports tests. Use supertest with mocha. Don't install mocha globally.
you must use mocha BDD style (which is the default), within that, you can optionally use chai.
Note: Tests must follow this standard - Tests Creation Guide.docx
Code Format
All code must pass jslint. You may use "nomen: true".
Winner Only
Winner will create pull request against the main github repo in final fix phase and help merge with master. The changed files should be unix style, you can use dos2unix command to convert it before commiting.
Virutal Machines (VMs)
VM specific information is found here: http://www.topcoder.com/wiki/display/docs/VM+Image+2.5
Upon registration as a submitter or reviewer you will need to request a VM based on the TopCoder systems image. The VM will be active through aggregation review, after which it will be terminated except for the winner's and the reviewers'. To request your image, please post in contest forum.
Before requesting your VM, you need to ensure that you have an SSH key created and in your member profile. Instructions to do so are here: http://www.topcoder.com/wiki/display/projects/Generate+SSH+Key, and instructions to connect afterwards are here: http://www.topcoder.com/wiki/display/projects/Connect+Using+SSH+Key.
Please realize that VMs are currently issued manually. We make every attempt to issue the VM as soon as it is requested, however, there may be delays of up to 12 hours depending on time of day when you request. We encourage everyone to request a VM as soon as possible to minimize any such delays.
Technology Overview
- JavaScript
- Node.js 0.10.x
- actionhero.js framework
- supertest
- mocha
Final Submission Guidelines
Submission Deliverables
Below is an overview of the deliverables:
- Source Code Changes including commit hash the changes based on.
- Deployment guide to configure and verify the application.
Final Submission
For each member, the final submission should be uploaded to the Online Review Tool.