Skip to content

[$400] Challenge Refactor #242

Closed
Closed
@rootelement

Description

@rootelement

This is a refactor to bring v5 in line with its original intent, making the object model simplified, and pushing the logic to translate to v4 into the legacy processors as it should be. Each section will have checkboxes for main tasks, then clarification underneath.

What this Solves

  1. v4 to v5 migration inconsistencies because the typeId is a v5 object, but track is not. Logical mapping of types from v4 to v5, v5 to v4 is inconsistent between migration/sync and legacy processor
  2. ChallengeType is overloaded with v4/legacy information and shouldn't be.
  3. A single point of truth (/challenge-migration/convert-to-v4, /challenge-migration/convert-to-v5) for track/subtrack to track/type conversion in either direction
  4. Tasks are cleaner and easier to deal with
  5. Creating a challenge processor (doesn't exist right now) to act on challenges when other bus events happen. This will immediately help with tasks and tasks being assigned or not, but also can be used with the new autopilot or other systems that expect challenges to react to system changes

Changes

Data Model

  • Add ChallengeTrack object { name, abbreviation, isActive } (Example: { name: 'Quality Assurance', abbreviation: 'QA', isActive: true }
  • Add Challenge Object Properties:
    • trackId (String) [UUID of ChallengeTrack object]
    • typeId (String) [UUID of ChallengeType object]
    • legacy.subTrack (String) [populated from v4 subTrack]
    • task, which is an object of properties { isTask: true/false, isAssigned: true/false, memberId: (String or Null) }
  • Remove Challenge Object Properties:
    • legacy.isTask
  • Update/add Seed files
    • Challenge Type: (Challenge, First2Finish, Task)
    • Challenge Track: (Design, Development, Data Science, QA)
    • Update ChallengeTypeTimelineTemplate.json

Challenge API

  • Update filters to work with the new data model properties
  • Update CRUD operations and validation
  • Add ChallengeTrack table and CRUD api
  • Update Task functionality
  • Update Swagger
    • Data Model
    • Challenge Track object
    • Challenge Type Timeline rename
  • Populate track from trackId (String: Design, Data Science, Development, Quality Assurance)
  • Populate type from trackId (String: Challenge, First2Finish, Task)

Challenge Processor

  • Create a challenge processor - https://github.com/topcoder-platform/challenge-processor
  • When a user registers on a challenge, if task.isTask, change task.isAssigned = true and populate memberId
  • When a user unregisters from a challenge, if task.isTask, change task.isAssigned = false and null memberId
  • Trigger Challenge proc ES update
  • Set up Dev & Prod CircleCI / AWS
  • Deploy in Dev
  • Deploy in Prod

Resources API

  • Prevent adding more than one submitter on a challenge.task.isTask = true

Legacy Challenge Processor

  • Update Legacy Challenge Processor to
    • Utilize the new properties
    • Convert track, subtrack and type to the v4 properties using the /challenge-migration/convert-to-v4
    • Populate the isTask properly
  • Disable HTML Conversion of Markdown ?

Legacy Challenge Resource Processor

Legacy Challenge Migration script

  • Create GET /challenge-migration/convert-to-v4?track=:track&type=:type&tags=:tags
    • Response { track, subTrack, isTask }
  • Create GET /challenge-migration/convert-to-v5?track=:track&subTrack=:subTrack&isTask:true/false
    • Response: { trackId, typeId, track, type, tags }
  • Update migration to
    • Utilize the new properties
    • Convert track, subtrack and type to the v5 properties using the service function that powers the /convert-to-v5 api above
    • Populate the task property
  • Update sync to do the following:
    • Update all properties, except track, type, and only update description and privateDescription if descriptionFormat == HTML
  • Add Marathon Match as a platform in legacy system
  • Remove Dynamo ChallengeTypeTimelineTemplate table
  • Update v5 challenge role to add access to ChallengeTimelineTemplate table
  • Add /v5/challenge-tracks endpoint in tyk

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions