-
Notifications
You must be signed in to change notification settings - Fork 17
Feat: Support 8base init with existing code base in the server #137
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
Open
Dav1nx1
wants to merge
41
commits into
master
Choose a base branch
from
PRODUCT-2458
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dav1nx1
commented
Oct 3, 2023
Contributor
Author
Dav1nx1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR include the changes of update the 8base CLI
…h created on based another
…h created on based another
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Additional reqirement added:
If user executes 8base environment sync and doesn’t have custom functions deployed in current envrionment we throw an error:There are no custom functions deployed in the current environment to sync
Story definition was updated, sum up:
We will not ask user about importing during 8base init →
if there is a deployed version of project Master at S3 → we just pull the project Master
If there is no deployed version of project Master at S3 → we create a project in a regular way with sample functions.
We will not have different success message about importing functions/re-deplyoing on 8base init.
We are not importing project/custom functions during 8base configure and we don’t ask anything
We would have command 8base environment sync that will be used to download project and custom functions for current active environment (current active environment is the one returned with 8base environment show)
When user runs 8base environment sync we will throw warning dialog with following text:Do you really want like to import project files and custom functions from the ? Contents of your local project will be completely overwritten with the new data. Proceed? (Y/N)
If user clicks Yes - we would display a loader and apply the same flow as for importing during init, but downloading the project version, deployed on the targeted environment.
If use clicks No - we cancel the execution, left the user with the empy terminal line.
After succesfull import we throw following message:Your project files and custom functions have been successfully imported from environment. To ensure consistency, we recommend redeploying your project using the 8base deploy command.
Text for -h flag of 8base environemnt sync:COMMAND
8base environment sync
DESCRIPTION
Imports project files and custom functions from the latest deployed version of current active environment.
New requirements:
If the project has several environments - we should ask from which environment the user wants to import custom functions. The selector similar to the one we use for the 8base environment set should be triggered after Y/N step.
The importing of project is allowed only for team members who have permissions for “Deploy” of custom functions both in current and “parent” project.
If user doesn’t have permissions we should throw the following message: You need 'Deploy' permissions for custom functions in both the parent and current project to execute the import
We need to have a new mechanism for importing project files and custom functions from a project to which the user connects by running 8base init or 8base configure via the CLI.
Every time a user initializes or configures a project, the system should determine if the parent project has custom functions deployed in Master (meaning there is a project on S3 deployed)
If the project has custom functions deployed in Master the new project must be generated with all the project files and custom functions downloaded from the selected project, which means:
The local project folder has all the project files and custom functions from the deployed earlier version of the project (Master environment)
The 8base.yml is populated with the correct custom functions configuration
Default custom functions are placed in the src folder of the project, in corresponding subfolders based on their function types.
Any other non-default folders and files existing in the project are imported and placed like in parent project
package.json is copied from the parent project
workspaces.json file has the data of current project
If the process takes time, a progress bar similar to the one displayed during deployment should also be displayed during importing.
After successful importing, we should advise the user to redeploy the project to guarantee consistency. Following message must be displayed:Your project files and custom functions have been successfully imported from the backend . To ensure consistency, we recommend redeploying your project using the 8base deploy command.