topcoder-platform / forums

0 stars 0 forks source link

Moving all threads from one challenge to another #686

Open jmgasper opened 2 years ago

jmgasper commented 2 years ago

We would like to add a new endpoint to the REST API of the forums that will move a forum from one challenge to another. This will be used for things like reposts of a challenge, where we want to keep all the original questions and answers available.

New API

The new endpoint should be POST /groups/move with a body like:

{ 
  "originalChallengeId":{GUID},
  "newChallengeId":{GUID},
  "movePermissions":bool, optional
}

Where the "GUID" for each item is the v5 challenge API ID of the challenge. Note that we want to accept the challenge IDs, NOT the group ID, because this will likely be called externally from support tools or the platform that won't know what group ID matches a given challenge ID. You will need to make sure your code internally handles the mapping of challenge ID to internal group ID.

Code

Please look at the code for the groups plugin, which includes the REST API for the current groups paths: https://github.com/topcoder-platform/forums-groups-plugin

We will target the "develop" branch of all dependencies, but there shouldn't currently be any difference between "develop" and "master" for anything.

What to move

Use case

If a challenge fails, like due to a failing review or no submissions, it can be reposted. When a challenge is reposted, it's useful to have the original forum questions and answers available to the repost, to avoid confusion and redundant questions and answers. Currently, for a copilot or Topcoder support, moving the old questions and answers is a manual process. Adding in the new REST API to move the group threads from one challenge forum to a new challenge forum will allow us to automate the repost process.