Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: Ability to fork project #187

Closed
rajdip-b opened this issue Apr 20, 2024 · 3 comments · Fixed by #239
Closed

API: Ability to fork project #187

rajdip-b opened this issue Apr 20, 2024 · 3 comments · Fixed by #239
Assignees
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

Comments

@rajdip-b
Copy link
Member

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 to GLOBAL will be allowed to fork. Forking a project will copy over all the configurations contained in a project.

Solution

Technical details

  • Users should be able to fork a project only if the accessLevel is GLOBAL.
  • Forking will take the following details:
    • projectId: ID of the project to be forked
    • workspaceId: (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 have CREATE_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.
  • Forking will copy over all the variables, secrets and environments along with the configuration versions into the user's project.
  • Making changes to the fork SHOULD NOT reflect changes in the original project.

Implementation steps

  • Get Add project access level #154 implemented if not already done
  • Add the business logic in project.service.ts
  • Add the controller logic in project.controller.ts
  • Add relevant test in 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 have CREATE_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.

@rajdip-b rajdip-b added good first issue Good for newcomers help wanted Extra attention is needed pending-dependency Stuck due to a required dependency scope: api Everything related to the API labels Apr 20, 2024
@rajdip-b rajdip-b moved this to Todo in keyshade-api Apr 20, 2024
@rayaanoidPrime
Copy link
Contributor

/attempt

Copy link

Assigned the issue to you!

@rayaanoidPrime rayaanoidPrime removed their assignment May 19, 2024
@rajdip-b rajdip-b moved this from Todo to In progress in keyshade-api May 19, 2024
@rajdip-b rajdip-b self-assigned this May 19, 2024
@rajdip-b rajdip-b moved this from In progress to Under review in keyshade-api May 24, 2024
@github-project-automation github-project-automation bot moved this from Under review to Done in keyshade-api May 24, 2024
@rajdip-b
Copy link
Member Author

🎉 This issue has been resolved in version 1.4.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants