API: Ability to fork project #187
Labels
good first issue
Good for newcomers
help wanted
Extra attention is needed
pending-dependency
Stuck due to a required dependency
priority: high
scope: api
Everything related to the API
Description
This function will allow any user to fork a project into any of their workspace, where they have permission to create a project. This is directly dependent on #154, whereby only projects with
accessLevel
set toGLOBAL
will be allowed to fork. Forking a project will copy over all the configurations contained in a project.Solution
Technical details
accessLevel
isGLOBAL
.projectId
: ID of the project to be forkedworkspaceId
: (Optional) ID of the workspace to which the fork will belong to. Defaults to the user's default workspace. If any other workspace is specified, the user should haveCREATE_PROJECT
authority in the workspace. Otherwise, it should throw an error.forkName
: (Optional) Name of the forked project. Defaults to the actual project name. Should throw an error if not specified and a project with the same name already exists in the workspace.Implementation steps
project.service.ts
project.controller.ts
project.e2e.spec.ts
Helper function
Additionally, for the convenience of client applications, we would also like to add an endpoint in
workspace
module that will fetch all the workspaces where the users haveCREATE_PROJECT
or higher authorities set.Additional context
We have plans to set up an upstream just like GitHub or GitLab does. But this is set for the future, if and when we get the demand.
The text was updated successfully, but these errors were encountered: