How to create multiple development environments?

Feature(s) impacted

  • Environment

Observed behavior

Currently there’s only one development environment, so when 2 or multiple users are developing on forest admin at the same time, there might be conflicts with layout changes, thus making the development unusable

Expected behavior

Able to create multiple development environments (with url http://localhost:5000)


  • Environment name: Development
  • Agent (forest package) name & version: forest-rails (forest_liana) v8.1.0
  • Database type: postgresql

Hello @yeboster and welcome to the community!

You can follow this note to understand Forest Admin’s philosophy on Development Workflow. The command forest init will allow you to create new development environments.

Best regards,

Thank you for the prompt reply!

The forest-cli init command verifies the existence of a development environment before setting up a new one, ensuring only one is maintained. How can we have two? As we want to develop 2 layouts at the same time.

If managing two development environments simultaneously is not feasible, what do you suggest?
A possible alternative is employing Ngrok to create a tunnel to a non-dev environment. However, I’m interested what other solutions you might suggest. Thanks

Development environments are supposed to be personal to a single developer, they should not be shared. If you executed the command init and the configuration happens to be the same as the already existing development environment it means that you are the owner.

This command should be executed by another user so that it generates a new environment.

Thank you for the answer!

We created a new user and we are trying to setup the developer env.
Unfortunately, when setting the branch with npx forest-cli branch dev --origin Production it returns User is not the owner of this environment. We tried multiple environments, as well as an environment set up from the new user but we got the same error. We also tried to set the new user as admin but no luck. How can we fix this?

As I have said, development environments are supposed to be personal to a single developer. From what I can see the environment on which you tried to create a new branch is owned by and the user trying to create the branch is

All edit/context change on a dev env must be made by its owner.

I understand your point. Because of this, I created a new environment ‘QA user’ directly from the new user ‘qa_set_reviewer’ account, and then tried to create a branch using this origin. Nevertheless, I wasn’t able to create it as I had the same error. What am I doing wrong?

The forest-cli commands will fetch environment variables from the execution directory, from what I can see the env secret that is sent in your latest calls still references the environment devteam1 and not the newly created one.

Thanks for the clarification! That fixed the issue as I was able to properly access the new dev env! Thanks a lot

1 Like