Skip to content

Conversation

@Dav1nx1
Copy link
Contributor

@Dav1nx1 Dav1nx1 commented Oct 3, 2023

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.

Copy link
Contributor Author

@Dav1nx1 Dav1nx1 left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants