Module Assembly - TopCoder Competition Engine - Update Logic for Processing ChangeRoundRequest

Register
Submit a solution
The challenge is finished.

Challenge Overview

Project Overview

TopCoder Competition Engine is a system used for Single Round Matches (SRM) and Marathon Matches (MM).

About Source Code Change

Recently, we have migrated all source code for TopCoder Competition Engine from svn to github repositories, please check https://github.com/appirio-tech/arena-web/wiki/Source-Code-Repositories-for-TopCoder-Competition-Engine for details.

Competition Task Overview

Currently, for web socket listener, it can process ChangeRoundRequest and LoadRoundRequest from Web Arena to activiate matches.

but there is a problem to do that, unless we first make the user login through admin listener.

If you check com.topcoder.server.listener.WebSocketConnector, we get around it by doing login for admin user, like

// login to admin tool if this is a admin user, so that we can do round operation
String[] userInfo = CoreServices.getUserInfoBySSO(lr.getSSO());
if (userInfo != null) {
    User user = CoreServices.getUser(userInfo[0], false);
    if (user != null && user.isLevelTwoAdmin()) {
        try {
            LoginResponse response = adminServices.
                    processLoginRequest(new BackEndLoginRequest(cid, userInfo[0], userInfo[1].toCharArray()));
            ListenerMain.info(response.toString());
            this.write(cid, response);
        } catch (Exception e) {
            this.write(cid, new PopUpGenericResponse("Login Admin Error",
                    "Error occured while processing your request", ContestConstants.GENERIC,
                    ContestConstants.LABEL));
            ListenerMain.error(e);
        }
    }
}

But since we are adding new Web Arena Super role to do match activiation, we'd like to revise the logic for backend.

  1. When calling processChangeRoundRequest, we'd like to not require user login first.
  2. but we do need to check permissions.
    • admin is able to change/load any round
    • web arena super role can only able to change/load the round created by himself.
  3. Remove the login logic for admin user in WebSocketConnector

Clear Use Case to Cover

  1. login web arena as heffan(admin) or ksmith (web arena super role)
  2. navigate to Match Management Page by clicking the icon in the Top Nav
  3. Create a Match by using Create Wizard
  4. Assign Problems
  5. Set Terms
  6. First Click the Change button, then Load button.
  7. After that, the Matches can be see in Active Matches Widget.

About Web Arena

You can following the guide in wiki to setup it in your own environment, currently, CentOS, Windows, Ubuntu and Mac OS are supported officially.

About VMs

Before asking your own VM, you need to have a public key on your profile before asking for the VM.

You can find more details on how to generate a key http://apps.topcoder.com/wiki/display/projects/Generate+SSH+Key and how to connect using it http://apps.topcoder.com/wiki/display/projects/Connect+Using+SSH+Key.

All Arena related code can be found at /home/apps/dev account, please login as apps account.



Final Submission Guidelines

  • Code changes for backend, so we can change and load rounds through Web Arena
  • Clear Deployment and verification guide.

ELIGIBLE EVENTS:

2015 topcoder Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30048739